While working on an application, I am facing an issue. And I am not sure how to solve this.
For explanation I have managed to come up with a simple example below:
Consider a Grocery Store application.
From conventional wisdom I decided to represent this structure in Relational DB as following tables:
This works out so far good. Here is the issue.
Once user saves the basket, at the process of checkout the store would impose some rules/discounts which are set for individual scenario, For example:
User will not be aware of these above rules at the time of adding Items to basket. But these rules are imposed at the time of checkout.
My problem is HOW and WHERE should I store these rules? I can not hard code them in application. They have to be stored somewhere as guidelines to cashier at the time of checkout.
I am not sure if I could articulate my issue properly but I have simplified this as much as I could.
If any one have any solutions please let me know.