Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Deal

A deal represents a set of ordered products.

Deals can contain one and only one type of product:

  • A la carte products: Any number of products sold separately. I.e. Choco Truffle Cake
  • Combo products: Specific products sold in groups under a unique group name. I.e. WOW everyday value at 199 each

When there's an interest in combining combo products and a la carte products orders must include multiple deals.

Identifying deals

Deals are identified depending on the type of ordered products.

When ordering a la carte products they must be enclosed under a deal identified with the fixed value of ND (no-deal).

However, when ordering combo products a deal must be identified with that particular combo identifier; please refer to Product.id.

For example, while ordering the combo WOW everyday value at 199Rs each the deal must be identified with the wow-199 value.

For a sample list of combos products click here.

Pricing strategies

There are two main types of pricing strategies:

Deals with fixed price

Only deals including a combo product can have a fixed price by setting the deal price to a value different than zero. On the contrary of variable price deals, each child product with a price is going to be considered an up-sell price.

For example, consider the following excerpt of an order including a Meal for 2 combo:

{
  id: 'meal-for-two'
  price: 399,
  pizzas: [
   { id: "classic-corn-pan-medium", price: 0, lineItemPrice: 199 },
   { id: "chicken-pan-medium", price: 50, lineItemPrice: 249 }
  ]
}

The deal price has been set to 399 and the Chicken Pan Medium pizza has been priced as 50; this indicates that the Chicken Pan Medium is an up-sell product and the resulting price of the order would be the deal price plus the up-sell product price. For this example, the resulting order total will be 449.

Warning: Do not set a deal price for a la carte products.

Deals with variable price

Deals including either a combo or a la carte products can have a variable price by setting the deal price to zero and then each child product having a Product.price set. On the contrary of fixed price deals, child products with a price represent the full price of the item within the deal.

For example, consider the following excerpt of an order including a WOW 199 combo:

{
  id: 'wow-199'
  price: 0,
  pizzas: [
   { id: "classic-corn-pan-medium", price: 199, lineItemPrice: 199 },
   { id: "veggie-pan-medium", price: 199, lineItemPrice: 199 }
  ],
  ...
}

The deal price has been set to zero and both pizzas have been priced as 199. The order will be then priced by adding up both the Classic Corn Pan Medium and the Veggie Pan Medium prices. For this example, the resulting order total will be 398.

Order total price

The total price of the order gets calculated by adding up all the price properties of all deals within an order. Note that these prices do not include taxes. For more information refer to taxes.

Hierarchy

  • Deal

Implements

Index

Properties

Optional desserts

desserts: Dessert[]

A list of ordered desserts.

Note: This collection of ordered entities are not product objects.

Example:

{
  ...
  desserts: [
   { id: "choco-truffle-cake-single", ... }
  ]
}

Optional dips

dips: Dips

A list of ordered dips.

Note: This collection of ordered entities are not product objects.

Example:

{
  ...
  dips: [
   { id: "dip-id",  ...}
  ]
}

Optional drinks

drinks: Drink[]

A list of ordered drinks.

Note: This collection of ordered entities are not product objects.

Example:

{
  ...
  drinks: [
   { id: "pepsi-600ml", ... }
  ]
}

id

id: string

Represents the identifier of a deal.

Optional originalPrice

originalPrice: undefined | number

Represents the list price of the ordered deal without any discounts.

Optional pizzas

pizzas: Pizza[]

A list of ordered pizzas.

Note: This collection of ordered entities are not product objects.

Example:

{
  ...
  pizzas: [
   { id: "classic-corn-pan-medium", ... }
  ]
}

price

price: number

Represents the list price of the ordered deal (excluding any upsells and modifiers) Can be zero

Optional redeemable_id

redeemable_id: string | undefined

Optional sides

sides: Side[]

A list of ordered sides.

Note: This collection of ordered entities are not product objects.

Example:

{
  ...
  sides: [
   { id: "garlic-bread-spicy-supreme-single",  ...}
  ]
}

Optional total

total: undefined | number

Represents the list price of the deal and any included items (including any upsells and modifiers)

Generated using TypeDoc