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>
This commit is contained in:
72
app/modules/loyalty/locales/en.json
Normal file
72
app/modules/loyalty/locales/en.json
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"loyalty": {
|
||||
"module": {
|
||||
"name": "Loyalty Programs",
|
||||
"description": "Stamp-based and points-based loyalty programs with wallet integration"
|
||||
},
|
||||
"program": {
|
||||
"title": "Loyalty Program",
|
||||
"create": "Create Program",
|
||||
"edit": "Edit Program",
|
||||
"activate": "Activate",
|
||||
"deactivate": "Deactivate",
|
||||
"type": {
|
||||
"stamps": "Stamps",
|
||||
"points": "Points",
|
||||
"hybrid": "Hybrid"
|
||||
}
|
||||
},
|
||||
"card": {
|
||||
"title": "Loyalty Card",
|
||||
"number": "Card Number",
|
||||
"qr_code": "QR Code",
|
||||
"enroll": "Enroll Customer",
|
||||
"deactivate": "Deactivate Card"
|
||||
},
|
||||
"stamp": {
|
||||
"title": "Stamps",
|
||||
"add": "Add Stamp",
|
||||
"redeem": "Redeem Reward",
|
||||
"count": "{current} of {target}",
|
||||
"until_reward": "{count} until reward"
|
||||
},
|
||||
"points": {
|
||||
"title": "Points",
|
||||
"earn": "Earn Points",
|
||||
"redeem": "Redeem Points",
|
||||
"balance": "{count} points",
|
||||
"per_euro": "{points} points per euro"
|
||||
},
|
||||
"pin": {
|
||||
"title": "Staff PINs",
|
||||
"create": "Create PIN",
|
||||
"edit": "Edit PIN",
|
||||
"unlock": "Unlock PIN",
|
||||
"locked": "PIN locked until {time}"
|
||||
},
|
||||
"wallet": {
|
||||
"google": "Add to Google Wallet",
|
||||
"apple": "Add to Apple Wallet"
|
||||
},
|
||||
"stats": {
|
||||
"title": "Statistics",
|
||||
"total_cards": "Total Cards",
|
||||
"active_cards": "Active Cards",
|
||||
"stamps_issued": "Stamps Issued",
|
||||
"rewards_redeemed": "Rewards Redeemed"
|
||||
},
|
||||
"errors": {
|
||||
"program_not_found": "Loyalty program not found",
|
||||
"program_inactive": "Loyalty program is not active",
|
||||
"card_not_found": "Loyalty card not found",
|
||||
"card_inactive": "Loyalty card is not active",
|
||||
"cooldown": "Please wait {minutes} minutes before next stamp",
|
||||
"daily_limit": "Daily stamp limit of {limit} reached",
|
||||
"insufficient_stamps": "Need {required} stamps, have {current}",
|
||||
"insufficient_points": "Need {required} points, have {current}",
|
||||
"pin_required": "Staff PIN is required",
|
||||
"pin_invalid": "Invalid staff PIN",
|
||||
"pin_locked": "PIN locked due to too many failed attempts"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user