I am trying to implement a booking system for charging stations that can either extend or refund a booking. I basically have the following tables:
- booking
- booking_logs
- payment
- refunds
With how the 3rd party payment system we are using is set up, the refunds are attached to payments. Meaning a payment can have multiple refunds, but refunds only belong to one payment.
Now I want to log those actions as I want to be able to display the history of what went on in a single booking. Because a user can extend as many times as they want and we can also refund them if for some reason the charging didn't go well.
Here is my ERD so far.
I just want to know if what I am doing with the booking_logs is okay. I have read about Polymorphic Associations but I don't think it would apply to me as payment and refund have a 1:M relationship and even if they didn't, it seems like it is not always advised to use Polymorphic Associations.
booking_log
be related to? What is your doubt?