Case study 06
Loyalty coupons. From the serial number to approval.
An internal system for the life of a loyalty coupon: issue, print, delivery, receipt, and approval. The company sells building materials and issues redemption coupons as an incentive.
- Sector
- Building materials distribution
- Type
- Internal loyalty-coupon operations
- Role
- End-to-end owner: operating cycle, domain model, rules, interface, permissions, and file generation
The business problem
- Serial numbers were issued by hand, so a duplicate or a gap was easy to miss.
- It was unclear which merchant and distributor received which number range, in which governorate and district.
- Handover, customer receipt, and approval were separate, with no record of who did each step.
- The same coupon could be scanned more than once.
- Permissions were not split by department, so people could reach steps outside their job.
What the system changes
Issue time and reconciliation time are not listed.
A state for every coupon
Created, then Pending, then Preapproved, then Approved. The dashboard counts them by product type and state.
Duplicates are refused
The serial, the exchange permission, and the receipt number are unique. A repeat scan is rejected.
Tied to the field
Merchant, distributor, governorate, and district. A technician is linked to their merchants.
Delivery can be proved
The merchant’s receipt is recorded with the receipt image and the permission number. The image is not shown here.
Work by department
More than 14 roles across sales, marketing, stores, accounts, operations, and information. Separate permissions for customers, users, QR, permissions, delivery, receipt, and approval.
Coupon flow
- 01Issue a QR batch: Created
- 02Exchange permission: Pending. Reprinting is locked
- 03Rep delivers to the merchant, with a receipt image
- 04Customer receipt, then a first scan: Preapproved
- 05Approval scan: Approved. A repeat scan is refused
- 06Dashboard by type and state
Information
- Issue and follow-up
Marketing and sales
- Permissions and exchange
Stores
- Delivery
Accounts
- Approval
Technicians, merchants, and distributors are linked to the coupon. They are not all system users.
Technical architecture
No names, national IDs, phones, or receipt numbers.
| Presentation | ASP.NET Core 9 MVC, Razor, Bootstrap, jQuery |
|---|---|
| Business | Validation, QR, PDF, Excel, and Word |
| Data | EF Core 9 on SQL Server |
| Identity | ASP.NET Identity plus custom permissions on the role and the user |
| QR | QRCoder and ZXing.Net |
| Language | ar-EG and en-US |