A project I have recently started to work on involves me creating a Domain model that represents a Chart of Accounts within an Accounting package.
The information I need to hold on an account is as follows:
Id
Name
Description
Account Code
Parent Account Id
Account Type
Now my initial design was to have Account being the aggregate root but then I started to try and decide how the tree structure of the CoA would fit into that. In reading a bit on this I have seen a number of different approaches on how this could be modelled, one of which was to hold the entire CoA under a single root and that each level had child accounts which fits with the Chart of Accounts structure exatly but now sure on how efficient that would be.
Does anyone have any thoughts/experiences on how I can achieve this.
The company I am working for is following a CQRS/Event Sourcing approach for this part of our system.
Any thoughts/help would be most appreciated.
Regards,
Stuart