Often enough i see different problems / business cases that start with individual aggregates and eventually parent constraints apply, which seem to be a great case for aggregate members:
-
A monthly restaurant invoice that has several different payables, like online orders payable (+), equipment rental (-), delay penalties (-), excelence bonuses (+), etc…
-
A monthly courier salary that has several paylables, like attendance per hour wage (+), bonus per delivery(+), vacations (+), unjustified absences (-)…
So the questions:
-
Are these good use cases to have a monthly/period aggregate responsible to enforce rules applied for all the payables and especially to define the lifecycle of the period (like the salary, open, in review, closed or restaurant invoice open) where for instance later/retroactive vacations approvals are rejected and reaccounted in the new salary aggregate/target period?
-
Is there a reference/suggestion on how to move from isolated entities to a parent aggregate?