mitai-jinkendo/backend/routers
Lars ae9743d6ed
All checks were successful
Deploy Development / deploy (push) Successful in 56s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 12s
feat: add coupon management and redemption
New router: routers/coupons.py

Admin endpoints:
- GET /api/coupons - List all coupons with stats
- POST /api/coupons - Create new coupon
- PUT /api/coupons/{id} - Update coupon
- DELETE /api/coupons/{id} - Soft-delete (set active=false)
- GET /api/coupons/{id}/redemptions - Redemption history

User endpoints:
- POST /api/coupons/redeem - Redeem coupon code

Features:
- Three coupon types: single_use, period, wellpass
- Wellpass logic: Pauses existing personal grants, resumes after expiry
- Max redemptions limit (NULL = unlimited)
- Validity period checks
- Activity logging
- Duplicate redemption prevention

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 13:07:09 +01:00
..
__init__.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
activity.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
admin.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
auth.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
caliper.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
circumference.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
coupons.py feat: add coupon management and redemption 2026-03-19 13:07:09 +01:00
exportdata.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
importdata.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
insights.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
nutrition.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
photos.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
profiles.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
prompts.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
stats.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
subscription.py feat: add user subscription info endpoints 2026-03-19 13:05:55 +01:00
weight.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00