# app/api/v1/platform/__init__.py
"""
Platform API endpoints (no authentication required).

Includes:
- signup: /signup/* (multi-step signup flow - cross-cutting)

Auto-discovers and aggregates platform routes from self-contained modules:
- billing: /pricing/* (subscription tiers and add-ons)
- marketplace: /letzshop-stores/* (store lookup for signup)
- core: /language/* (language preferences)

These endpoints serve the marketing homepage, pricing pages, and signup flows.
"""

from fastapi import APIRouter

from app.api.v1.platform import signup
from app.modules.routes import get_platform_api_routes

router = APIRouter()

# Cross-cutting signup flow (spans auth, stores, billing, payments)
router.include_router(signup.router, tags=["platform-signup"])

# Auto-discover platform routes from modules
for route_info in get_platform_api_routes():
    if route_info.custom_prefix:
        router.include_router(
            route_info.router,
            prefix=route_info.custom_prefix,
            tags=route_info.tags,
        )
    else:
        router.include_router(
            route_info.router,
            tags=route_info.tags,
        )
