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:
@@ -11,6 +11,7 @@ Platform endpoints for:
|
||||
import logging
|
||||
|
||||
from fastapi import APIRouter, Depends, Header, Path, Response
|
||||
from pydantic import BaseModel, Field
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.core.database import get_db
|
||||
@@ -92,8 +93,14 @@ def download_apple_pass(
|
||||
# =============================================================================
|
||||
|
||||
|
||||
class AppleRegisterDeviceRequest(BaseModel):
|
||||
"""Request body for Apple device registration."""
|
||||
push_token: str = Field(..., alias="pushToken")
|
||||
|
||||
|
||||
@platform_router.post("/apple/v1/devices/{device_id}/registrations/{pass_type_id}/{serial_number}")
|
||||
def register_device(
|
||||
body: AppleRegisterDeviceRequest,
|
||||
device_id: str = Path(...),
|
||||
pass_type_id: str = Path(...),
|
||||
serial_number: str = Path(...),
|
||||
@@ -111,10 +118,7 @@ def register_device(
|
||||
# Verify auth token (raises InvalidAppleAuthTokenException if invalid)
|
||||
apple_wallet_service.verify_auth_token(card, authorization)
|
||||
|
||||
# Get push token from request body
|
||||
# Note: In real implementation, parse the JSON body for pushToken
|
||||
# For now, use device_id as a placeholder
|
||||
apple_wallet_service.register_device_safe(db, card, device_id, device_id)
|
||||
apple_wallet_service.register_device_safe(db, card, device_id, body.pushToken)
|
||||
return Response(status_code=201)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user