I am trying to come up the tables design that each category have different type of point calculation.
First Example: customer order a ‘Intel CPU Core i7 3770K’ item from CPU category – point will be calculated via (category_point / item_cost)
Second Example: customer order a ‘OCZ SSD’ item from a SSD category – point will be calculated via (category_point / item_cost + bonus_point + other_name_point + other_name_point)
I need to specify the fixed value for bonus_point, other_name_point, category_point in the table, etc It can be changed every month or so.
Price Range Example (Different from above) – if customer order any item from Motherboard category – point will be calculated base on item cost range like:
0.00 to £40 = 10 points
40.00 to £40 = 52 points
more than £40 = 64 points
I need to specify the point manually of the price range. This is not part of category_point / item_cost + bonus_point + other_name_point + other_name_point
How to design the tables for the points setting?
May be something like:
Customers:Id,Name,Orders:Id,OrderDate,CustomerId,*ItemsOrders:*ItemId,OrderId,Items:ITemCost,Categories:CategoryId,Name,CategoryPoints:CategoryId,PointId,Points::PointId,PointNam,PointCostType bit (‘fixed’ or ‘changing’),PointsCostsRanges: for not fixed pints onlyId(Surrorgate key).PointId,FromRange.ToRange.Note that:
bonus_point,other_name_pointandother_name_point? If so you can get rid of the tablePointsand add three columns to theCategoryPointstable.bonus_point,other_name_pointandother_name_pointthen it has 3 points or what?