i have trouble implementing policy based, time based and customer based pricing for our SKUs (Stock keeping units). So far i have created following table for time based pricing
SKUPrices
ID Pk
SKUID FK_To_Sku
DateFrom
DateTo
Price
I believe this schema can handle time based pricing well (i need community review on it though) but i can not figure out how to handle customer based pricing (if we want to sell few skus to some customers at subsidized rates for some time period) and policy based pricing (where subsidized rates will be applied to skus if sold under some policy for some time period).
A very easy way to implement the above requirements would be to just add 2 more columns like this:
Then you could just provide default values for customer and policy ids (
NULLor0), if you want to enter date based values. Add the customer or policy FKs, if you want to store customer or policy specific prices.It’s a quite simple price storing schema, but it may suffice for your needs. You might also want to take care of price scales (different prices at different quantities) or other needs. Maybe you can already address this through your policies, I don’t know.