e-commerce and retail

Loyalty Discount

This Decision Table uses a calculation column to compute discount based on loyalty class.

DecisionRules

David Škarka

Template author

This Decision Table is designed to determine the final price of a transaction and generate a corresponding customer message. It utilizes a specific calculation column to compute a percentage discount based on the customer's loyalty class, their accumulated credit, and the basic price of the item.

Solution Components
The logic relies on specific input data and pre-defined user variables to execute the rules:
  • Input Data:
    • Basic Price: The starting price of the item (basicPrice).
    • Loyalty Class: The customer's assigned tier, such as "REGULAR", "LOYALTY1", or "FIRST_VISIT" (customer.loyaltyClass).
    • Credit: A numeric score representing the customer's credit standing (customer.credit).
  • Rule Variables (configuration):
    • regularDiscount: Set to a value of 10.
    • loyaltyDiscount: Set to a value of 20.
    • specialDiscount: Set to a value of 40.
Decision Logic
The decision table evaluates rules top-down, segmented by price caps and loyalty tiers. 
Output Calculation
Once the discount percentage is determined by the logic, the Final Price (finalPrice) is computed, and the specific message (e.g., "You get 20% discount!") is generated.
Check iconA checkmark inside a circle signifying "yes"Minus iconA minus inside a circle signifying "no"PROS IconA plus symbol representing positive aspects or benefits.CONS IconA minus symbol representing negative aspects or drawbacks.

More Templates

See Other Templates