Business requirement
An online store has several promotions, but only one may be applied. First-order eligibility has highest priority, followed by Gold membership, high order value, and bulk quantity.
- Give 20% off for a first order of at least ₹500.
- Otherwise give Gold members 15% off when the amount is at least ₹2,000.
- Otherwise give 12% off when the order is at least ₹5,000.
- Otherwise give 8% off when the order contains at least five items.
- Apply only the first matching rule and display the selected promotion, discount, and final total.
- Validate that amount and item count are positive.