Case study

Promotional trade-management platform

Deduction clearing for a CPG manufacturer's trade-promotions program — request to production in nine weeks, live in SAP PRD.

SAPTypeScriptNode.jsReactAzure DevOps

The problem

Retailer deductions arrive by the hundreds each week — claims taken against promotional agreements that someone must match, validate, and clear in SAP. The manual process ran about 57 hours across a typical 447-invoice week, at roughly 7.5 minutes per deduction.

The system

A 13-stage matching pipeline parses retailer claim files, resolves ship-tos, matches each row to SAP agreements with confidence scoring, and allocates funds oldest-first against live balances. Approvals are role-gated with a dollar threshold. Duplicate-posting checks block staged and already-posted rows. SAP receives one all-or-nothing document per deduction, through a single whitelisted write RFC that is never auto-retried.

Every row accounted for

Parsed row counts are persisted and reconciled end to end: every row lands as cleared, excepted, or excluded, each with an auditable reason code. Nothing is silently dropped — the invariant is pinned by tests.

Verified outcomes

  • Clears a ≈$2.4–3.2M/week deduction stream, measured from 17 months of SAP clearing history.
  • Handling per deduction: ~7.5 minutes down to ~0.3.
  • Weekly clearing effort: 57 h → 4 h on the median 447-invoice week.
  • $95–135K/yr verified savings — booked floor to evidence-based estimate — with 2,000–2,700 hours/yr returned to the business (≈ 1–1.3 FTE).
  • Request to production in nine weeks: one developer, 570 hours from request through hyper-care, 1,638+ automated tests at go-live review.

Engineering under ERP constraints

Roughly 100K lines of new TypeScript across client, API, and test harnesses, built alongside a live legacy stack. The SAP query pipeline was redesigned from hundreds of per-deduction RFC calls to about 80 per batch. A cross-application end-to-end contract maps 364 UI and API controls at 87% coverage and runs against live SAP QAS, with a tag taxonomy separating irreversible SAP-write operations. 120 forward-only database migrations, feature-flag dark launches, and a copy-only artifact promotion path carried it from QAS to PRD.

Availability

Built inside an employer’s environment; identifiers, records, and internals stay private. The delivery method is documented and repeatable.

← All work