E-commerce | Subject area: PRICE AND DISCOUNT
Help Docs → E-commerce → Subject area: PRICE AND DISCOUNT
Subject area: PRICE AND DISCOUNT
Overview
The Logical Data Model of the PRICE AND DISCOUNT Subject Area includes the following entities:
Entity: PRICE
This entity records information about the Items prices.
Attributes | |
---|---|
ID | PRIMARY KEY |
Item_ID | Lookup for the Item for which the price is applied. NOT NULL. |
Store_ID | Lookup for the Store where the Item price is applied. NOT NULL. |
Description | Price description. |
Current_Item_Cost | The Item price that was paid to Item supplier. If Moving_Average_Price method is active, then the Current_Item_Cost is re-calculated for the entire Item stock after each Item Purchase. See Subject Area: INVENTORY AND STOCK, Entity: STOCK_HISTORY for more information.NOT NULL |
Markup_Percentage | Markup Percentage applied to Item. NOT NULL |
Price_Before_Tax | Item Price before Tax ( usually the same as Current_Item_Cost) . NOT NULL |
Tax_Value | Tax Value calculated as sum of all applicable taxes to Item. See Subject Area: PRODUCT, Entity: ITEM_TAX_TYPE for more information. NOT NULL |
Price_After_Tax | Price_After_Tax = Price_Before_Tax + Tax_Value. NOT NULL |
Sale_Price | Sale_Price = Price_After_Tax + Price_After_Tax*Markup_Percentage/100. NOT NULL |
Price_Change_Allowed | Flag attribute to indicate if the Price can be changed when the Item is added to an Order Line. Example: ⦁ If Price_Change_Allowed is TRUE then the Price can be changed (adjusted) when the Item is added to an Order Line. See Subject Area: ORDER, Entity: ORDER_LINE, Attribute: Price_Adjustment for more information. NOT NULL |
Created_Time | Timestamp when the price record was created. NOT NULL |
Created_Emp_Login_ID | Lookup for the Employee Login session that created the Price record. NOT NULL. |
Start_Time | The start timestamp from which the price is applicable. NOT NULL |
End_Time | The end timestamp after which the price is not applicable. When End_Time is NULL the price is still applicable. |
Is_Active | Flag attribute to indicate if the Price is still available at the Store or it was canceled permanently from the Store offer. NOT NULL |
Comments | Internal notes used for clarifications on record content. |
Entity: DISCOUNT_TYPE
List of discount types that can be applied by a Store.
Attributes | |
---|---|
ID | PRIMARY KEY |
Store_ID | Lookup for the Store where the discount can be applied. NOT NULL. |
Name | Discount Type name. Example: 'All items at 25%', '50% discount for minimum 3 items bought' etc. NOT NULL |
Description | Discount Type description |
Is_Percentage | Flag to indicate if the discount value is a percentage or a flat amount. Example: ⦁ If Is_Percentage is TRUE and Value is '40' then it means a 40% discount ⦁ If Is_Percentage is FALSE and Value is '40' then it means 40 money amount expressed in Store default currency. See Subject Area: STORE, Entity: STORE, Attribute: Currency_ID for more information. NOT NULL |
Value | Value of discount. Example: ⦁ If Is_Percentage is TRUE then the Value is the discount percentage. For example a value of '14.50' means 14.50% discount of the price. ⦁ If Is_Percentage is FALSE then the Value is the money amount discounted. For example a discount Value of '14.50' means a discount of 14.50 expressed in Store default currency. See Subject Area: STORE, Entity: STORE, Attribute: Currency_ID for more information. NOT NULL |
Created_Time | Timestamp when the discount type record was created. NOT NULL |
Start_Time | The start timestamp from which the discount type is applicable. NOT NULL |
End_Time | The end timestamp after which the discount type is not applicable. When the End_Time is NULL the price is still applicable. |
Loyalty_Card_Type_ID | Lookup for the Loyalty Card Type for which the discount is applicable. If Loyalty_Card_Type_ID is NULL, it means the discount is applicable without a Loyalty Card. |
Coupon_Code | The Coupon code for which the discount type is applicable. If the Coupon_Code is NULL, it means the discount is applicable without a Coupon_Code. |
Min_Order_Value | The Minimum Order Value from which the discount type is applicable. Example: A Minimum Order Value of '140' means that the discount type is applicable only for Orders with a total value greater than 140 (expressed in Store currency). See Subject Area: STORE, Entity: STORE, Attribute: Currency_ID for more information. NOT NULL |
Min_Item_Quantity | The Minimum Item Quantity from which the discount type is applicable. Example: A Minimum Item Quantity of '3' means that the discount type is applicable only for Orders that contains the Item added three times at least. NOT NULL |
Apply_To_All | Flag attribute to indicate if the Discount Type is applicable to all quantity when the quantity is >= Min_Item_Quantity. For example: Apply_To_All flag is 'TRUE', Min_Item_Quantity is 3 and a Customer bought 4 items. In this case the Discount Type is applied to all 4 items bought. NOT NULL |
Apply_To_Next | Flag attribute to indicate if the Discount Type is applicable only to the next quantity bought after the Min_Item_Quantity. For example: Apply_To_Next flag is 'TRUE', Min_Item_Quantity is 3 and a Customer bought 4 items. In this case the Discount Type is applied only to 1 item (next 1 item bought after Min_Item_Quantity. NOT NULL |
Max_Discount_Value | The Maximum Discount Value applicable for an Order. Example: A Maximum Discount Value for an Order is '30' (expressed in Store currency). In this case, for an Order that contains an Item with price of '80' and with "All items 50% off" discount type, the discount is 30 instead of 40. NOT NULL |
Is_Active | Flag attribute to indicate if the Discount Type is still available at the Store or it was canceled permanently from the Store offer. NOT NULL |
Comments | Internal notes used for clarifications on record content. |
Entity: DISCOUNT
This entity records information about the discounts applied to Items or Item Categories.
Attributes | |
---|---|
ID | PRIMARY KEY |
Discount_Type_ID | Lookup for the Discount Type to be applied to an Item or to an Item Category. NOT NULL. |
Item_Category_ID | The discount record can be created for an Item or for an Item Category. If the discount record is created for an Item Category, then the Item_Category_ID is the lookup for that Item Category. In this case the Item_ID is NULL. |
Item_ID | The discount record can be created for an Item or for an Item Category. If the discount record is created for an Item, then the Item_ID is the lookup for that Item Category. In this case the Item_Category_ID is NULL. |
Description | Discount description |
Comments | Internal notes used for clarifications on record content. |
Entity: DISCOUNT_HOUR
This entity records information about the Discount Types applicable only on specific days of the week (for example during weekends) and only for a limited time interval (for example from 2 PM to 4 PM).
Attributes | |
---|---|
ID | PRIMARY KEY |
Discount_Type_ID | Lookup for the Discount Type applicable only on specific days of the week and only for a limited time interval . NOT NULL |
Week_Day_ID | Lookup for the week day when the Discount Type is applicable. NOT NULL |
Start_Hour_ID | Lookup for the start hour when the Discount Type is applicable. NOT NULL |
End_Hour_ID | Lookup for the end hour when the Discount Type is applicable. NOT NULL |
Comments | Internal notes used for clarifications on record content. |
Example
DISCOUNT_HOUR
ID | Discount Type | ID | Week Day | ID | Start Hour | ID | End Hour |
---|---|---|---|---|---|---|---|
7 | All Coffees 5% Off | 6 | Saturday | 9 | 8 AM | 14 | 4 PM |
7 | All Coffees 5% Off | 7 | Sunday | 10 | 9 AM | 24 | 5 PM |
3 | All Items 25% Off | 1 | Monday | 13 | 12 AM | 14 | 4 PM |
If you don't need to control the discount hours just let this table empty. |
Important The above values for the Discount_Type_ID, Week_Day_ID, Start_Hour_ID, End_Hour_ID are just samples. When populate the DISCOUNT_HOUR table with values, you should use the Discount_Type_ID, Week_Day_ID, Start_Hour_ID, End_Hour_ID values from your database.
Entity: WEEK_DAY
Week days list. This entity facilitates week days selection and display.
Attributes | |
---|---|
ID | PRIMARY KEY |
Name | Week day name. NOT NULL UNIQUE |
Short_Name | Week day short name. NOT NULL UNIQUE |
Sequence_No | The sequence number helps to order the week days list when displayed. NOT NULL UNIQUE |
Description | Week day description |
Example
WEEK_DAY
Name | Sequence No |
---|---|
Monday | 1 |
Tuesday | 2 |
Wednesday | 3 |
etc |
Accelerate every database schema design with powerful data models
We have already designed the data model and prepared the SQL scripts for creating the database schema objects.
© 2025 Data Model Pack · Terms of Use · Privacy