feat(loyalty): refactor analytics into shared template and add merchant stats API
Some checks failed
Some checks failed
Extract analytics stat cards, points activity, and location breakdown into a shared partial used by admin, merchant, and store dashboards. Add merchant stats API endpoint and client-side merchant filter on admin analytics page. Extend stats schema with new_this_month and estimated_liability_cents fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -284,11 +284,17 @@ class MerchantStatsResponse(BaseModel):
|
||||
total_points_issued: int = 0
|
||||
total_points_redeemed: int = 0
|
||||
|
||||
# Members
|
||||
new_this_month: int = 0
|
||||
|
||||
# Points - last 30 days
|
||||
points_issued_30d: int = 0
|
||||
points_redeemed_30d: int = 0
|
||||
transactions_30d: int = 0
|
||||
|
||||
# Value
|
||||
estimated_liability_cents: int = 0
|
||||
|
||||
# Program info (optional)
|
||||
program: dict | None = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user