Details
Description
Service changes that involve both an upgrade/downgrade and a coupon change simultaneously are calculated incorrectly by the pricing presenter because it applies the old coupon to both the old service state and the new service state. The presenter should be updated to apply the old coupon to the old service state and the new coupon to the new service state.
- Items with differing coupons cannot be merged because they will result in inaccurate pricing calculations since we cannot infer a single unit price and apply multiple coupons (i.e. the old coupon and the new coupon) to that price
- Items with coupons where one of the coupons is of the 'amount' type cannot be merged because an amount discount is not distributive like a percentage discount and would not arrive at the same price when merged
Example:
Old Service
Price $100
Discount 10%
New Service
Price $150
Discount 20%
Assuming the service change occurs for the entire term, the entire old service cost should be removed and the entire new service cost should be added, i.e.:
Remove $90 ($100 * (1 - 0.1))
Add $120 ($150 * (1 - 0.2))
Cost is $30
Line items:
Item | Price |
---|---|
Remove Old Service | -$100 |
Add New Service | $150 |
Remove Old Discount 10% | $10 |
Add New Discount 20% | -$30 |
Total: $30