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:
@@ -103,9 +103,12 @@ class RequireFeature:
|
||||
) -> None:
|
||||
"""Check if store's merchant has access to any of the required features."""
|
||||
store_id = current_user.token_store_id
|
||||
platform_id = current_user.token_platform_id
|
||||
|
||||
for feature_code in self.feature_codes:
|
||||
if feature_service.has_feature_for_store(db, store_id, feature_code):
|
||||
if feature_service.has_feature_for_store(
|
||||
db, store_id, feature_code, platform_id=platform_id
|
||||
):
|
||||
return
|
||||
|
||||
# None of the features are available
|
||||
@@ -136,7 +139,8 @@ class RequireWithinLimit:
|
||||
store_id = current_user.token_store_id
|
||||
|
||||
allowed, message = feature_service.check_resource_limit(
|
||||
db, self.feature_code, store_id=store_id
|
||||
db, self.feature_code, store_id=store_id,
|
||||
platform_id=current_user.token_platform_id,
|
||||
)
|
||||
|
||||
if not allowed:
|
||||
@@ -176,9 +180,12 @@ def require_feature(*feature_codes: str) -> Callable:
|
||||
)
|
||||
|
||||
store_id = current_user.token_store_id
|
||||
platform_id = current_user.token_platform_id
|
||||
|
||||
for feature_code in feature_codes:
|
||||
if feature_service.has_feature_for_store(db, store_id, feature_code):
|
||||
if feature_service.has_feature_for_store(
|
||||
db, store_id, feature_code, platform_id=platform_id
|
||||
):
|
||||
return await func(*args, **kwargs)
|
||||
|
||||
raise FeatureNotAvailableError(feature_code=feature_codes[0])
|
||||
@@ -195,9 +202,12 @@ def require_feature(*feature_codes: str) -> Callable:
|
||||
)
|
||||
|
||||
store_id = current_user.token_store_id
|
||||
platform_id = current_user.token_platform_id
|
||||
|
||||
for feature_code in feature_codes:
|
||||
if feature_service.has_feature_for_store(db, store_id, feature_code):
|
||||
if feature_service.has_feature_for_store(
|
||||
db, store_id, feature_code, platform_id=platform_id
|
||||
):
|
||||
return func(*args, **kwargs)
|
||||
|
||||
raise FeatureNotAvailableError(feature_code=feature_codes[0])
|
||||
|
||||
Reference in New Issue
Block a user