-
-
Notifications
You must be signed in to change notification settings - Fork 247
Description
Hey @rez1dent3
Can you suggest to me how should I go about the below use case?
I am working on the logistics app, where I have shipments from multiple customers.
Every customer has cod-wallet
I have to deposit Cash on delivery amount from shipments to cod-wallet.
The problem here is there is a background service which picks up unpaid shipments from DB and processes deposit, also I cannot maintain any flag in shipment model for paid status as it would not be reliable, I directly want to join with transactions table and check if the entry exists with type deposit for a shipment.
Unfortunately, the transaction only takes metadata from the user side, using the JSON column I cannot take advantage of joins.
My thoughts on giving developers the flexibility to customize model
- We can have a
morphTorelation in the transaction model for developers to extend according to their requirements and allow developers to pass transaction class while doing transactions. - We can make use of virtual columns reference: https://mysqlserverteam.com/indexing-json-documents-via-virtual-columns/#:~:text=As%20the%20MySQL%20manual%20notes,value%20from%20the%20JSON%20column.
- add an external_ref_id column to transaction table
Any suggestions would really help.
Thanks in advance