CRM · Customer loyalty — coupon exchanges

Lists the proposal coupons a customer has taken and lets staff redeem one by recording the store and the exchange date.

AreaCRM
Routescrm.users.edit
Centre modulescms · crm
Staff levelsroot · admin · manager · crmmanager · crmoperator · weboperator
Modelscommerce · coupon · coupon-exchange
UI labelticket.coupon-exchanges
Coverage2 use cases · 1 happy · 4 failure

How it works

Redemption has its own client-side form validation (validateRedeemForm → _validateCommerce + _validateDate), including a rule that the date cannot be in the future. The API error detail is preferred over the generic copy when present (json?.errors?.[0]?.detail ? … : intl.t('coupon-exchanges.redeem.error')), which is better error plumbing than most of the surrounding code.

Use cases

Why someone opens this (2)

  • A store assistant redeeming a promotional coupon the customer shows on their phone.
  • Back-office correction of a coupon redeemed against the wrong store.

Path map

flowchart LR
    F(["Customer loyalty — coupon exchanges"]):::feat
    F --> H1["Coupon redeemed"]:::ok
    F -.-> X1["Store not selected"]:::bad
    F -.-> X2["Date missing"]:::bad
    F -.-> X3["Future date"]:::bad
    F -.-> X4["API rejects the redemption"]:::bad
    classDef feat fill:#157068,stroke:#157068,color:#ffffff,font-weight:bold
    classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e
    classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13

Happy paths

Coupon redeemed

  1. Operator opens the coupon-exchanges step and the redeem modal on a coupon.
  2. Selects the store and a date that is not in the future.
  3. validateRedeemForm passes and the redemption is posted.
  4. coupon-exchanges.redeem.success is shown and the coupon’s status changes.

Failure paths

QA checklist

Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.

  • ✅ Coupon redeemed
  • ⛔ Store not selected
  • ⛔ Date missing
  • ⛔ Future date
  • ⛔ API rejects the redemption

Implementation


Generated from doc/feature-inventory.json · id crm-customer-coupon-exchanges · commit 276788ca6