MVC Discount — Seller Discount Coupons
Backend for seller-created discount coupons at shop and product level on the merchant voucher platform, reusing an existing multi-coupon-type database design and validated for compatibility in two sprints.
- Role
- Backend Engineer (Lead / POC)
- Timeline
- 2023
- Team
- 3
- Domain
- E-Commerce / Promotions
- Stack
- 8 tech
- Status
- Live
Overview
The MVC Discount project — internally known as "Discount Coupon" — added seller-created discount coupons to the merchant voucher platform. As lead / POC, I designed and delivered the backend with junior engineers I led, letting sellers create discount coupons at both shop and product level, with percentage or nominal benefits, and released it in 2023.
Gallery
A backend has no screens, so its "UI" is the operational surface: the coupon-creation API, the seller-dashboard flow, and release dashboards.
Problem & Solution
The merchant voucher platform already offered several coupon types, but sellers had no first-class way to create their own discount coupons scoped to a whole shop or to specific products. Building a parallel system would have duplicated a lot of the existing model and validation logic, so the challenge was to extend the platform in place while proving that older coupon types kept working.
I wrote the technical design (TRD), the interaction flow, and the database storage plan for the seller-dashboard side, then reused the existing multi-coupon-type schema to avoid schema drift. On top of that I added new API contracts for shop- and product-level discount coupons, extended enums for benefit types (percentage and nominal), and integrated with the seller dashboard so sellers could manage the coupons end-to-end. Two sprints were spent on compatibility testing before release.
Workflow
Three actors interact with the service; the diagrams are written in English to stay consistent across both languages.
Architecture
The merchant voucher service exposes RPC and HTTP endpoints for coupon creation, listing, and lifecycle changes, persists into a managed RDS with the shared multi-coupon-type schema, and warms a Redis cache for hot coupon lookups. A promotion aggregator service reads active coupons for consumer-facing surfaces, and Prometheus/Grafana provide release-health and adoption signals.
Features
- Create a discount coupon at shop level
- Create a discount coupon at product level
- Combine benefit types (percentage or nominal discount)
- Seller dashboard integration for coupon management
- Compatibility testing across existing coupon types
- Reused an existing multi-coupon-type database design
- New API contracts for shop- and product-level coupons
- Backwards-compatible enum extensions for benefit types
Tech Stack
Engineering Challenges
The merchant voucher platform already supported several coupon types on a shared schema, so a naive extension could break existing flows. Fix: I mapped the new shop- and product-level discount coupons onto the existing model and spent two sprints on structured compatibility testing to keep older coupon types safe.
As lead / POC, I had to design the tech, then split the work among junior engineers I led while keeping the design coherent. Fix: I owned the TRD and interaction/DB design up front, then reviewed and paired on the trickier compatibility and dashboard-integration slices so the team could ship confidently.
Shop-level and product-level coupons had different validation and dashboard needs, and each had to work with both percentage and nominal benefits. Fix: I unified the create/validate path behind a single API contract with scope- and benefit-aware validation, so both levels shared one lifecycle and one operational surface.
Outcomes
Lessons Learned
Reusing an existing schema is cheap only if you invest in compatibility testing — the two sprints spent on it were the reason release day was uneventful. Leading junior engineers also worked best when I owned the design and the risky slices explicitly, and left well-scoped implementation slices for the team to grow on.
Interested in working together?
Order, payment, or high-traffic event pipelines — let's talk architecture and trade-offs.