Loyalty & Rewards Engine · Documentation

Architecture

Loyalty & Rewards Engine's pipeline, its owned data, the events it emits/consumes, and what is out of scope.

Loyalty & Rewards Engine
accruespend/100×ratetierlifetime ptsredeemdeducthistoryledgermetered · LLMdeterministic · $0
Live diagram — accrual, tiering and redemption are exact arithmetic at $0 in both modes; redemption discounts are simulated and labelled.

Owned data + the invariant

The app owns `demo_eco_loyalty_account` and `demo_eco_loyalty_txn`; the history is rebuilt newest-first from the txn ledger. The data invariant is explicit here: owner reads/writes the canonical account (`credential_id` NULL); a viewer gets a clone-on-write overlay that is ephemeral and reset-clearing and never mutates the canonical row.

Deterministic, $0 — and out of scope

Accrual, tiering and redemption are exact arithmetic with no metered stage (the honest AI-assist design; the inspector shows $0 model cost for this app). Simulated + labelled: redemption discounts are applied in-demo with no real settlement. No real imagery, no PII; earn rate + tier thresholds are owner-tunable and ship with the defaults above.

Architecture · Loyalty & Rewards Engine · Abhishek Saxena