Business Rules
output
Rule 1:
Deal cannot have more than one output;
Rule 2:
If the output is orderTotalDiscount and the 'proportion' field is populated, the 'type' field cannot be '%' or 'PERCENT_OFF';
Rule 3:
If the output is lineItemDiscount and the 'proportion' field is populated, the 'type' field cannot be '%' or 'PERCENT_OFF' or 'PROMOTIONAL_PRICE' or '@';
Rule 4:
If the output is lineItemScaledDiscount, and the 'proportion' field inside ranges list is populated, the 'type' field cannot be '%' or 'PERCENT_OFF' or 'PROMOTIONAL_PRICE' or '@';
Rule 5:
If the output is freeGoods, each vendorItems filled in must be unique in the items lists;
Rule 6:
If the output is multipleLineItemDiscount, each vendorItemId filled in must be unique in the items list;
How it can be used:
To DO.
accumulationType
Rule 1:
If the 'accumulationType' is one of the fullowing values (ADD, COMPOSE, UNIQUE, HIGH, LOW) and the multipleLineItemDiscount as the output, then the 'type' field can only be 'PERCENT_OFF' or '%';
How it can be used:
To DO.
condition
Rule 1:
When the condition is multipleLineItem the output needs to be multipleLineItemDiscount;
Rule 2:
When the condition is lineItem the output needs to be different of multipleLineItemDiscount, making some fields mandatory like 'output.line_item_discount.type', 'output.line_item_discount.value', 'conditions.line_item.shared_minimum_quantity', 'conditions.line_item.cross_discount', 'conditions.line_item.minimum_quantity';
Rule 3:
If the condition is multipleLineItem, and it has two or more items in the list with the same 'vendorItemIds', then the 'minimumQuantity' values cannot be different;
Rule 4:
In condition the pricing-engine will receive the firstOrder information in the simulation request, and does not have the knowledge if it's or not a first order purchase. The orchestrators in front of Pricing Engine will have the information of the first purchase, and send a firstOrder boulean field in the simulation request so it can verify if the firstOrder deal condition is met;
How it can be used:
To DO.
country
Rule 1:
If the country is 'AR', 'PY' or 'UY' then some fields are mandatory like 'accumulationType' and 'priority'.
Rule 2:
If the country is different from 'US' then some fields are mandatory like 'freeGoods.items.quantity', 'lineItemDiscount.type', 'lineItemDiscount.discount', 'lineItem.minimumQuantity', 'lineItem.sharedMinimumQuantity', 'lineItem.crossDiscount', 'lineItemScaledDiscount.ranges.value', 'lineItemScaledDiscount.ranges.type', 'palletDiscount.proportion', 'palletDiscount.measureUnit', 'palletDiscount.discount', 'orderTotalDiscount.discount', 'orderTotalDiscount.type';
How it can be used:
To DO.
Deals per type
This section will refer to specific deals types, as well as deals metadata.
Regular discount