feat(loyalty): cross-persona page alignment with shared components
Align loyalty pages across admin, merchant, and store personas so each sees the same page set scoped to their access level. Admin acts as a superset of merchant with "on behalf" capabilities. New pages: - Store: Staff PINs management (CRUD) - Merchant: Cards, Card Detail, Transactions, Staff PINs (CRUD), Settings (read-only) - Admin: Merchant Cards, Card Detail, Transactions, PINs (read-only) Architecture: - 4 shared Jinja2 partials (cards-list, card-detail, transactions, pins) - 4 shared JS factory modules parameterized by apiPrefix/scope - Persona templates are thin wrappers including shared partials - PinDetailResponse schema for cross-store PIN listings API: 17 new endpoints (11 merchant, 6 admin on-behalf) Tests: 38 new integration tests, arch-check green i18n: ~130 new keys across en/fr/de/lb Docs: pages-and-navigation.md with full page matrix Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,8 @@ from app.modules.loyalty.schemas.card import (
|
||||
from app.modules.loyalty.schemas.pin import (
|
||||
# Staff PIN
|
||||
PinCreate,
|
||||
PinDetailListResponse,
|
||||
PinDetailResponse,
|
||||
PinListResponse,
|
||||
PinResponse,
|
||||
PinUpdate,
|
||||
@@ -122,7 +124,9 @@ __all__ = [
|
||||
"PinCreate",
|
||||
"PinUpdate",
|
||||
"PinResponse",
|
||||
"PinDetailResponse",
|
||||
"PinListResponse",
|
||||
"PinDetailListResponse",
|
||||
"PinVerifyRequest",
|
||||
"PinVerifyResponse",
|
||||
]
|
||||
|
||||
@@ -77,6 +77,20 @@ class PinListResponse(BaseModel):
|
||||
total: int
|
||||
|
||||
|
||||
class PinDetailResponse(PinResponse):
|
||||
"""Extended PIN response including store context for cross-store listings."""
|
||||
|
||||
store_id: int | None = None
|
||||
store_name: str | None = None
|
||||
|
||||
|
||||
class PinDetailListResponse(BaseModel):
|
||||
"""Schema for listing staff PINs with store context."""
|
||||
|
||||
pins: list[PinDetailResponse]
|
||||
total: int
|
||||
|
||||
|
||||
class PinVerifyRequest(BaseModel):
|
||||
"""Schema for verifying a staff PIN."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user