I have to come up with an idea on how to transparently create invoices. Customers are diverse and usually government type institutions. As such, they have strict rules for creating invoices and what goes into them. The rules are very specific and different between customers. For example:
- For every 10 items, another invoice needs to be created
- If a specific service is going into invoice, materials used should be excluded
- Some items are free of charge either by contract or by law
- Some really expensive items must go into separate invoices
Rules are IMO too diverse to be saved in relational database in a traditional form and they are too flexible to be hard coded into the system. So, the question is: how would you solve this challenge?