# app/modules/orders/routes/api/__init__.py
"""
Orders module API routes.

Provides REST API endpoints for order management:
- Admin API: Platform-wide order management (includes exceptions)
- Store API: Store-specific order operations (includes exceptions)
- Storefront API: Customer-facing order endpoints

Note: router and router now aggregate their respective
exception routers, so only these two routers need to be registered.
"""

from app.modules.orders.routes.api.storefront import router as storefront_router

# Tag for OpenAPI documentation
STOREFRONT_TAG = "Orders (Storefront)"

__all__ = [
    "storefront_router",
    "STOREFRONT_TAG",
    "admin_router",
    "store_router",
]


def __getattr__(name: str):
    """Lazy import routers to avoid circular dependencies."""
    if name == "router":
        from app.modules.orders.routes.api.admin import router as admin_router
        return router
    if name == "router":
        from app.modules.orders.routes.api.store import router as store_router
        return router
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
