I am making an attempt to implement a system that limits the quantity of complete orders the system can settle for for for a given timeframe.
State of affairs: a enterprise can solely fulfill 5 orders per hours. As soon as that timeframe is crammed, no extra orders will be accepted. This function would reset every day.
Excessive Degree Design:
Enterprise Desk – holds enterprise data, and so forth. (construction:
Timeframe Desk – holds out there timeframes for the day. (construction:
Enterprise Timeframes Desk – reference enterprise with out there timeframes. (construction:
Having set this up, I can assign a enterprise with out there timeframes. To create a counter, I am considering that I ought to create one other desk, which references a business_id, timeframe_id, out there, crammed, and presumably datetime/timestamp.
Because the counter would reset every day, and there’s a chance of implementing future orders (ship for at this time vs tomorrow vs day after), what can be one of the simplest ways to go about this design?