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.
| Area | CRM |
| Routes | crm.users.edit |
| Centre modules | cms · crm |
| Staff levels | root · admin · manager · crmmanager · crmoperator · weboperator |
| Models | commerce · coupon · coupon-exchange |
| UI label | ticket.coupon-exchanges |
| Coverage | 2 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
- Operator opens the coupon-exchanges step and the redeem modal on a coupon.
- Selects the store and a date that is not in the future.
validateRedeemFormpasses and the redemption is posted.coupon-exchanges.redeem.successis shown and the coupon’s status changes.
Failure paths
Store not selected
Cause —
couponSelectedCommerceempty.What happens —
coupon-exchanges.redeem.validation.commerce.
Date missing
Cause — No exchange date chosen.
What happens —
coupon-exchanges.redeem.validation.date.
Future date
Cause — Exchange date after today.
What happens —
coupon-exchanges.redeem.validation.future.date.
API rejects the redemption
Cause — Usage limit reached, coupon expired, or exchange limit per user exceeded.
What happens — The API’s
errors[0].detailis shown if provided, otherwisecoupon-exchanges.redeem.errorunder thecoupon-exchanges.error.titleheading.
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
app/components/form-user/loyalty/coupon-exchanges.jsapp/models/coupon-exchange.jsapp/abilities/coupon.js
Translation keys (11)
Key English ticket.coupon-exchangesExchanged coupons coupon-exchanges.couponCoupon coupon-exchanges.shopShop coupon-exchanges.date-coupon-has-exchangedExchanged date coupon-exchanges.redeemRedeem coupon-exchanges.redeem.successThe coupon has been successfully redeemed. coupon-exchanges.redeem.errorAn error occurred while redeeming the coupon. Please try again later. coupon-exchanges.error.titleAn error ocurred coupon-exchanges.redeem.validation.commerceThe store is required. coupon-exchanges.redeem.validation.dateThe date is required. coupon-exchanges.redeem.validation.future.dateThe redemption date cannot be later than today’s date.
Related
- Same area — Customer list & filtering · Customer create & edit · Customer deletion with unsubscribe notice · Customer CSV export with column picker · Customer CSV import · Children CSV import · AI natural-language customer filter · Save current filters as a segment · Segment list, refresh & export · Segment builder with automatic tag actions · Segment categories · User tags (user types) · Customer receipts tab & ticket-stamp generation · Customer loyalty — raffle tickets · Customer loyalty — cards & stamps · Customer loyalty — rewards · Customer children (dependants) · Receipt verification queue · Store list, filters & exports · Store create & edit · Store CSV import · Store labels (store types) · Customer action log (dormant)
- Shares data with — Proposal editor (content, coupon, push, AI images) · Activity editor (loyalty mechanics, rules & targeting) · Multicentre proposals · Store sales declaration & month closing · Sales status overview & Yardi export · Annual sales statement · Intranet communications (threads, confirmations, authorisations) · Files management
Generated from doc/feature-inventory.json · id crm-customer-coupon-exchanges · commit 276788ca6