feat: add SQL query tool, platform debug, loyalty settings, and multi-module improvements
Some checks failed
Some checks failed
- Add admin SQL query tool with saved queries, schema explorer presets, and collapsible category sections (dev_tools module) - Add platform debug tool for admin diagnostics - Add loyalty settings page with owner-only access control - Fix loyalty settings owner check (use currentUser instead of window.__userData) - Replace HTTPException with AuthorizationException in loyalty routes - Expand loyalty module with PIN service, Apple Wallet, program management - Improve store login with platform detection and multi-platform support - Update billing feature gates and subscription services - Add store platform sync improvements and remove is_primary column - Add unit tests for loyalty (PIN, points, stamps, program services) - Update i18n translations across dev_tools locales Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,7 @@ def list_store_pages(
|
||||
|
||||
Returns store-specific overrides + platform defaults (store overrides take precedence).
|
||||
"""
|
||||
platform_id = content_page_service.resolve_platform_id(db, current_user.token_store_id)
|
||||
platform_id = current_user.token_platform_id or content_page_service.resolve_platform_id(db, current_user.token_store_id)
|
||||
pages = content_page_service.list_pages_for_store(
|
||||
db, platform_id=platform_id, store_id=current_user.token_store_id, include_unpublished=include_unpublished
|
||||
)
|
||||
@@ -176,7 +176,7 @@ def get_page(
|
||||
|
||||
Returns store override if exists, otherwise platform default.
|
||||
"""
|
||||
platform_id = content_page_service.resolve_platform_id(db, current_user.token_store_id)
|
||||
platform_id = current_user.token_platform_id or content_page_service.resolve_platform_id(db, current_user.token_store_id)
|
||||
page = content_page_service.get_page_for_store_or_raise(
|
||||
db,
|
||||
platform_id=platform_id,
|
||||
|
||||
@@ -47,7 +47,7 @@ class ContentPageService:
|
||||
@staticmethod
|
||||
def resolve_platform_id(db: Session, store_id: int) -> int | None:
|
||||
"""
|
||||
Resolve platform_id from store's primary StorePlatform.
|
||||
Resolve platform_id from store's first active StorePlatform.
|
||||
|
||||
Resolution order:
|
||||
1. Primary StorePlatform for the store
|
||||
@@ -62,7 +62,7 @@ class ContentPageService:
|
||||
"""
|
||||
from app.modules.tenancy.services.platform_service import platform_service
|
||||
|
||||
return platform_service.get_primary_platform_id_for_store(db, store_id)
|
||||
return platform_service.get_first_active_platform_id_for_store(db, store_id)
|
||||
|
||||
@staticmethod
|
||||
def resolve_platform_id_or_raise(db: Session, store_id: int) -> int:
|
||||
|
||||
Reference in New Issue
Block a user