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
..
2025-10-28 21:07:26 +01:00
2025-12-01 21:51:07 +01:00
2026-01-28 23:04:00 +01:00
2026-01-13 20:35:46 +01:00
2026-01-11 17:52:28 +01:00
2025-12-02 19:39:08 +01:00
2026-01-11 17:35:16 +01:00
2025-12-03 22:30:31 +01:00
2025-12-20 20:33:48 +01:00
2025-11-28 19:30:17 +01:00
2025-12-12 23:04:41 +01:00
2025-12-13 13:33:03 +01:00
2025-12-27 10:25:36 +01:00
2025-12-13 12:19:54 +01:00
2025-12-19 21:18:31 +01:00
2026-01-11 17:52:28 +01:00
2025-11-28 19:30:17 +01:00
2026-01-11 17:52:28 +01:00
2025-12-01 21:50:09 +01:00
2026-01-11 17:52:28 +01:00
2025-12-18 21:04:33 +01:00
2025-11-28 19:30:17 +01:00
2025-12-11 17:28:54 +01:00
2025-12-13 13:36:56 +01:00
2026-01-11 17:52:28 +01:00
2025-12-19 21:18:06 +01:00
2025-12-20 21:17:41 +01:00
2025-12-20 20:33:48 +01:00
2025-12-18 21:04:33 +01:00
2025-12-20 13:11:47 +01:00
2026-01-11 17:52:28 +01:00
2025-12-01 21:51:07 +01:00
2026-01-11 17:52:28 +01:00
2026-01-11 17:52:28 +01:00
2025-12-20 20:33:48 +01:00
2025-12-21 14:08:31 +01:00
2025-12-11 17:28:54 +01:00
2025-12-21 20:57:47 +01:00
2025-11-28 19:30:17 +01:00
2025-11-28 19:30:17 +01:00
2025-12-13 22:36:09 +01:00
2025-11-28 19:30:17 +01:00
2026-01-11 17:52:28 +01:00
2025-12-24 18:15:27 +01:00
2025-12-24 18:15:27 +01:00
2025-12-24 23:41:20 +01:00
2026-01-11 17:52:28 +01:00
2025-12-26 20:51:13 +01:00
2026-01-11 17:52:28 +01:00
2026-01-11 17:52:28 +01:00
2026-01-01 18:12:09 +01:00
2026-01-11 17:52:28 +01:00
2026-01-02 20:31:48 +01:00
2026-01-11 17:52:28 +01:00
2026-01-02 21:26:12 +01:00
2026-01-03 17:16:27 +01:00
2026-01-03 18:29:26 +01:00
2026-01-05 22:23:47 +01:00
2026-01-06 21:32:59 +01:00
2026-01-08 01:11:00 +01:00
2026-01-08 01:11:00 +01:00
2026-01-23 14:31:23 +01:00
2026-01-19 16:46:15 +01:00
2026-01-19 18:25:56 +01:00
2026-01-23 14:08:02 +01:00
2026-01-23 14:31:23 +01:00
2026-01-24 18:44:49 +01:00
2026-01-27 20:34:58 +01:00
2026-01-27 20:34:58 +01:00
2026-01-26 18:19:00 +01:00
2026-01-27 22:08:01 +01:00
2026-01-27 22:08:01 +01:00