Aggregates modelling
I have this case: I have a tax that represents an amount of money that a user must pay, which can be organized into multiple installments.
For this tax, payment requests must be created for the users. These payment requests must then be transmitted to an external system, and any transmission errors must be recorded on the payment request and must disappear once the payment has been successfully transmitted.
Payment requests can only be added if the tax is not in draft status, otherwise it must not be possible to add payment requests.
So we have 4 entities: the tax, the installment, the payment requests, and the transmission errors of the payment requests.
How would you structure the aggregate or aggregates?
u/skilletfancy — 6 days ago