Get Prices Determinations and Calculations
All products in the get prices service are decomposed. Prices and discounts are determined in the offer; then the price is calculated.
Product Decomposition
All products defined in CalculationProduct(s), Optional product(s) and InventoryProduct(s) are decomposed in their auto provisioned child products. CalculationProducts are decomposed in their optional or non-auto provisioned children. To identify optional children, the parent product and the child product must share the same LinkDefinitions, such as the same subscriber, or certain UDFs. The fields that are taken for the link are specified in the ProductComprisedOf relationship. This enables the pricing part of OPE to detect child products. When setting LinkedOnly in the ProductRequiredForPriceGroup and ProductRequiredForDiscountGroup, the LinkDefinitions can differ from the LinkDefinitions that are used to decompose products.
Price Determination
The price for each product is determined on its priority for the product. In the case of the priority being the same, the weight for the price is decided as per the relationships. The price is determined for the quantity mentioned for the calculation product. This means if the quantity is specified as >1, the price is mapped for each price type (CLASS) until all the quantities are exhausted for that price type. The price for the parent price is calculated first. Then the child prices using the pricecomprisedof relationship are calculated for the parent price quantity and are then aggregated towards the parent price. The quantity is reset for each new price type.
Discount Determination
The discount for the price is determined according to the priority mentioned in the price model using the PriceAlteredByDiscount relationship. In case the priority has the same weight for the discount, it is decided according to the relationships. The engine determines discounts for each price quantity. Unit discounts are detected for the complete quantity of the price. Discounts for child prices are applied before applying the parent price discount. Parent Price discounts are applied to the child prices as well.
Price Calculation
- If a discount has child discounts, first the parent discount is applied and then the child discount. If a discount has multiple direct children, the children are applied according to their order.
- The discount on a child price is applied first.
- If a parent price has a discount, the discount is applied both to the parent price and the child price.