Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_coupon-promotion-engine

Coupon & Promotion Engine (Rule Eval, Budget Caps & Stacking)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Coupon & Promotion Engine (Rule Eval, Budget Caps & Stacking) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_coupon-promotion-engine/opengraph-image)](https://archos.sageideas.dev/d/dgm_coupon-promotion-engine)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_coupon-promotion-engine)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_coupon-promotion-engine" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Coupon & Promotion Engine (Rule Eval, Budget Caps & Stacking) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Checkout & Cart API"]
  n1_1["Promo Eval API"]
  n2a_2["Rule & Stacking Engine"]
  n2b_3[("Budget Cap Guard")]
  n3_4[("Redemption Ledger")]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Eval cart · gRPC"| n1_1
  n1_1 -->|"2a. Match · In-Proc"| n2a_2
  n1_1 -.->|"2b. Check cap · Redis"| n2b_3
  n2a_2 -->|"3a. Reserve/Us · SQL"| n3_4
  n2b_3 -->|"3b. Apply · Async"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Checkout & Cart APISTATELESS
    Apply promo at checkout
  • Promo Eval APISTATELESS
    Low-latency cart pricing
  • Rule & Stacking EngineSTATELESS
    Eligibility DAG + precedence
  • Budget Cap GuardSTATEFUL
    Redis fast gate + DB atomic tx
  • Redemption LedgerSTATEFUL
    Unique `` + state
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Checkout & Cart API → Promo Eval API (Eval cart)[gRPC]
  2. Promo Eval API → Rule & Stacking Engine (Match)[In-Proc]
  3. Promo Eval API → Budget Cap Guard (Check cap)[Redis]
  4. Rule & Stacking Engine → Redemption Ledger (Reserve/Us)[SQL]
  5. Budget Cap Guard → Redemption Ledger (Apply)[Async]
  6. Redemption Ledger → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →