feat(loyalty): implement Phase 2 - company-wide points system
Complete implementation of loyalty module Phase 2 features: Database & Models: - Add company_id to LoyaltyProgram for chain-wide loyalty - Add company_id to LoyaltyCard for multi-location support - Add CompanyLoyaltySettings model for admin-controlled settings - Add points expiration, welcome bonus, and minimum redemption fields - Add POINTS_EXPIRED, WELCOME_BONUS transaction types Services: - Update program_service for company-based queries - Update card_service with enrollment and welcome bonus - Update points_service with void_points for returns - Update stamp_service for company context - Update pin_service for company-wide operations API Endpoints: - Admin: Program listing with stats, company detail views - Vendor: Terminal operations, card management, settings - Storefront: Customer card/transactions, self-enrollment UI Templates: - Admin: Programs dashboard, company detail, settings - Vendor: Terminal, cards list, card detail, settings, stats, enrollment - Storefront: Dashboard, history, enrollment, success pages Background Tasks: - Point expiration task (daily, based on inactivity) - Wallet sync task (hourly) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,8 +12,10 @@ Usage:
|
||||
LoyaltyTransaction,
|
||||
StaffPin,
|
||||
AppleDeviceRegistration,
|
||||
CompanyLoyaltySettings,
|
||||
LoyaltyType,
|
||||
TransactionType,
|
||||
StaffPinPolicy,
|
||||
)
|
||||
"""
|
||||
|
||||
@@ -41,15 +43,23 @@ from app.modules.loyalty.models.apple_device import (
|
||||
# Model
|
||||
AppleDeviceRegistration,
|
||||
)
|
||||
from app.modules.loyalty.models.company_settings import (
|
||||
# Enums
|
||||
StaffPinPolicy,
|
||||
# Model
|
||||
CompanyLoyaltySettings,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# Enums
|
||||
"LoyaltyType",
|
||||
"TransactionType",
|
||||
"StaffPinPolicy",
|
||||
# Models
|
||||
"LoyaltyProgram",
|
||||
"LoyaltyCard",
|
||||
"LoyaltyTransaction",
|
||||
"StaffPin",
|
||||
"AppleDeviceRegistration",
|
||||
"CompanyLoyaltySettings",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user