Samir Boulahtit
b5a803cde8
feat(loyalty): implement complete loyalty module MVP
Add stamp-based and points-based loyalty programs for vendors with:
Database Models (5 tables):
- loyalty_programs: Vendor program configuration
- loyalty_cards: Customer cards with stamp/point balances
- loyalty_transactions: Immutable audit log
- staff_pins: Fraud prevention PINs (bcrypt hashed)
- apple_device_registrations: Apple Wallet push tokens
Services:
- program_service: Program CRUD and statistics
- card_service: Customer enrollment and card lookup
- stamp_service: Stamp operations with anti-fraud checks
- points_service: Points earning and redemption
- pin_service: Staff PIN management with lockout
- wallet_service: Unified wallet abstraction
- google_wallet_service: Google Wallet API integration
- apple_wallet_service: Apple Wallet .pkpass generation
API Routes:
- Admin: /api/v1/admin/loyalty/* (programs list, stats)
- Vendor: /api/v1/vendor/loyalty/* (stamp, points, cards, PINs)
- Public: /api/v1/loyalty/* (enrollment, Apple Web Service)
Anti-Fraud Features:
- Staff PIN verification (configurable per program)
- Cooldown period between stamps (default 15 min)
- Daily stamp limits (default 5/day)
- PIN lockout after failed attempts
Wallet Integration:
- Google Wallet: LoyaltyClass and LoyaltyObject management
- Apple Wallet: .pkpass generation with PKCS#7 signing
- Apple Web Service endpoints for device registration/updates
Also includes:
- Alembic migration for all tables with indexes
- Localization files (en, fr, de, lu)
- Module documentation
- Phase 2 interface and user journey plan
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 23:04:00 +01:00
..
2026-01-26 22:42:46 +01:00
2026-01-27 20:34:58 +01:00
2026-01-24 18:44:49 +01:00
2025-12-01 21:51:07 +01:00
2026-01-28 22:22:18 +01:00
2025-11-28 19:30:17 +01:00
2025-11-28 19:30:17 +01:00
2025-11-28 20:03:45 +01:00
2025-12-20 20:33:48 +01:00
2025-12-01 21:50:09 +01:00
2025-11-28 19:30:17 +01:00
2026-01-02 19:16:35 +01:00
2026-01-03 18:29:26 +01:00
2026-01-18 19:49:44 +01:00
2026-01-01 18:12:09 +01:00
2025-12-25 12:27:12 +01:00
2025-12-24 18:15:27 +01:00
2026-01-28 22:22:18 +01:00
2026-01-28 22:22:18 +01:00
2026-01-28 22:22:18 +01:00
2026-01-28 22:22:18 +01:00
2025-11-28 19:30:17 +01:00
2026-01-06 21:32:59 +01:00
2026-01-13 20:37:41 +01:00
2025-11-28 19:30:17 +01:00
2025-11-28 19:30:17 +01:00
2025-12-27 21:46:26 +01:00
2025-12-20 13:11:47 +01:00
2026-01-02 20:31:48 +01:00
2026-01-03 17:16:27 +01:00
2025-11-28 19:30:17 +01:00
2026-01-26 18:19:00 +01:00
2026-01-26 18:19:00 +01:00
2025-12-24 23:41:20 +01:00
2026-01-08 01:11:00 +01:00
2025-11-28 19:30:17 +01:00
2026-01-28 22:22:18 +01:00
2025-11-28 19:30:17 +01:00
2026-01-28 22:22:18 +01:00
2026-01-27 20:34:58 +01:00
2025-12-25 22:21:14 +01:00
2026-01-05 22:23:47 +01:00
2026-01-03 18:29:26 +01:00
2026-01-18 19:49:44 +01:00
2025-11-28 19:37:38 +01:00
2026-01-28 23:04:00 +01:00