The situation
Taqeef is one of the UAE's leading HVAC suppliers, selling to commercial contractors, facility managers, and government entities. B2B pricing is not simple: the same air conditioning unit might have a different price for a bronze-tier contractor buying 2 units versus a gold-tier customer with a negotiated contract buying 20 units, with a category-level discount applying on top of both. With 40+ pricing permutations across customer tiers, volume bands, product categories, and negotiated contract terms, the original approach — a long chain of if/else conditions distributed across several files — was unmaintainable. The logic was contradictory in places, and sales staff were regularly generating quotes with incorrect totals. Each incorrect quote either cost margin (if the error was in the customer's favor) or lost the deal (if the customer caught it and questioned the professionalism). We built a pricing rule engine with an explicit rule registry. Each pricing dimension — tier discount, volume band, category override, contract exception — is a discrete rule object registered in a central registry and applied in a deterministic priority order. Rules are configurable by non-technical staff through the admin panel. The engine produces a full line-item breakdown showing exactly which rules applied to each product, making quotes transparent and auditable. Versioned REST APIs were added on the warehouse integration side. When Taqeef's internal warehouse system upgrades, the API contract remains stable — the versioned endpoint continues to work until clients explicitly migrate.
What had to change
40+ pricing permutations implemented as scattered if/else conditions. Logic was inconsistent across cases, and incorrect quotes were sent to clients weekly. Each error either cost margin or damaged client trust — sometimes both. The warehouse integration was also tightly coupled with no versioning, meaning any warehouse system upgrade required synchronized changes across both systems.
What we changed
Pricing rule engine with a centralized rule registry. Each dimension is a discrete rule applied in priority order. Admin panel lets sales ops update rules without developer involvement. Full line-item breakdown on every quote — clients see exactly what rules applied. Versioned API contracts for warehouse integration — upgrades on either end are independent.
What the client gained
- 01 Rule engine — 40+ permutations with zero code duplication
- 02 Staff can update pricing rules without developer time
- 03 Full audit trail on every quote — transparent to clients
- 04 Versioned APIs stable across warehouse system upgrades