I am making a software to store all my company invoices (and then infer some statistics about it).
The idea is:
- My company issues invoices to it's clients.
- My company receive invoices from it's suppliers.
I made this class model to this problem.
But after looking at it again I realised that this may not be the best model since I have companies that are my suppliers and my clients at the same time and that would force me to have TaxPayers instances that are Clients and Suppliers at the same time which is easy to implement in the persistent layer but hard to manage in the domain layer.
Any suggestions to improve this model?
EDIT: This may not be relevent for the question but I am using PHP 7.2 (Symfony framework 4.1 + Doctrine 2.6 for the persistent layer) + MySQL 8.0