I have a currently-existing stock management dashboard. The user selects a warehouse, and it displays the current stock in this warehouse. The stock management teams wants to display a date, calculated with various parameters.
The problem is that there are several warehouses, and since they work differently, they want to display the date based on different factors.
For instance, one might process regular items like cloths, the other processes large items like furniture, and a third processes fresh items (food). So they have very different ways of handling their stock.
How should I design my app so that the date handling is specific to each warehouse?
I see 2 possibilities:
- using a rules engine, but I'm very not sure that it's appropriate (I only know that the concept exists)
- using a factory design pattern, which will instantiate one warehouse class or another depending on the warehouse ID from the DB, and use this class to calculate the date.
Which one seems the more appropriate? Maybe I missed another possibility?