refactor: rename public routes and templates to platform
Complete the public -> platform naming migration across the codebase. This aligns with the naming convention where "platform" refers to the marketing/public-facing pages of the platform itself. Changes: - Update all imports from public to platform modules - Update template references from public/ to platform/ - Update route registrations to use platform prefix - Update documentation to reflect new naming - Update test files for platform API endpoints Files affected: - app/api/main.py - router imports - app/modules/*/routes/*/platform.py - route definitions - app/modules/*/templates/*/platform/ - template files - app/modules/routes.py - route discovery - docs/* - documentation updates - tests/integration/api/v1/platform/ - test files Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# app/modules/loyalty/routes/api/public.py
|
||||
# app/modules/loyalty/routes/api/platform.py
|
||||
"""
|
||||
Loyalty module public routes.
|
||||
Loyalty module platform routes.
|
||||
|
||||
Public endpoints for:
|
||||
Platform endpoints for:
|
||||
- Customer enrollment (by vendor code)
|
||||
- Apple Wallet pass download
|
||||
- Apple Web Service endpoints for device registration/updates
|
||||
@@ -29,8 +29,8 @@ from app.modules.loyalty.services import (
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Public router (no auth required for some endpoints)
|
||||
public_router = APIRouter(prefix="/loyalty")
|
||||
# Platform router (no auth required for some endpoints)
|
||||
platform_router = APIRouter(prefix="/loyalty")
|
||||
|
||||
|
||||
# =============================================================================
|
||||
@@ -38,7 +38,7 @@ public_router = APIRouter(prefix="/loyalty")
|
||||
# =============================================================================
|
||||
|
||||
|
||||
@public_router.get("/programs/{vendor_code}")
|
||||
@platform_router.get("/programs/{vendor_code}")
|
||||
def get_program_by_vendor_code(
|
||||
vendor_code: str = Path(..., min_length=1, max_length=50),
|
||||
db: Session = Depends(get_db),
|
||||
@@ -85,7 +85,7 @@ def get_program_by_vendor_code(
|
||||
# =============================================================================
|
||||
|
||||
|
||||
@public_router.get("/passes/apple/{serial_number}.pkpass")
|
||||
@platform_router.get("/passes/apple/{serial_number}.pkpass")
|
||||
def download_apple_pass(
|
||||
serial_number: str = Path(...),
|
||||
db: Session = Depends(get_db),
|
||||
@@ -122,7 +122,7 @@ def download_apple_pass(
|
||||
# =============================================================================
|
||||
|
||||
|
||||
@public_router.post("/apple/v1/devices/{device_id}/registrations/{pass_type_id}/{serial_number}")
|
||||
@platform_router.post("/apple/v1/devices/{device_id}/registrations/{pass_type_id}/{serial_number}")
|
||||
def register_device(
|
||||
device_id: str = Path(...),
|
||||
pass_type_id: str = Path(...),
|
||||
@@ -165,7 +165,7 @@ def register_device(
|
||||
raise HTTPException(status_code=500)
|
||||
|
||||
|
||||
@public_router.delete("/apple/v1/devices/{device_id}/registrations/{pass_type_id}/{serial_number}")
|
||||
@platform_router.delete("/apple/v1/devices/{device_id}/registrations/{pass_type_id}/{serial_number}")
|
||||
def unregister_device(
|
||||
device_id: str = Path(...),
|
||||
pass_type_id: str = Path(...),
|
||||
@@ -205,7 +205,7 @@ def unregister_device(
|
||||
raise HTTPException(status_code=500)
|
||||
|
||||
|
||||
@public_router.get("/apple/v1/devices/{device_id}/registrations/{pass_type_id}")
|
||||
@platform_router.get("/apple/v1/devices/{device_id}/registrations/{pass_type_id}")
|
||||
def get_serial_numbers(
|
||||
device_id: str = Path(...),
|
||||
pass_type_id: str = Path(...),
|
||||
@@ -256,7 +256,7 @@ def get_serial_numbers(
|
||||
}
|
||||
|
||||
|
||||
@public_router.get("/apple/v1/passes/{pass_type_id}/{serial_number}")
|
||||
@platform_router.get("/apple/v1/passes/{pass_type_id}/{serial_number}")
|
||||
def get_latest_pass(
|
||||
pass_type_id: str = Path(...),
|
||||
serial_number: str = Path(...),
|
||||
@@ -302,7 +302,7 @@ def get_latest_pass(
|
||||
)
|
||||
|
||||
|
||||
@public_router.post("/apple/v1/log")
|
||||
@platform_router.post("/apple/v1/log")
|
||||
def log_errors():
|
||||
"""
|
||||
Receive error logs from Apple.
|
||||
|
||||
Reference in New Issue
Block a user