Files
orion/app/api/v1/merchant/__init__.py
Samir Boulahtit f20266167d
Some checks failed
CI / ruff (push) Failing after 7s
CI / pytest (push) Failing after 1s
CI / architecture (push) Failing after 9s
CI / dependency-scanning (push) Successful in 27s
CI / audit (push) Successful in 8s
CI / docs (push) Has been skipped
fix(lint): auto-fix ruff violations and tune lint rules
- Auto-fixed 4,496 lint issues (import sorting, modern syntax, etc.)
- Added ignore rules for patterns intentional in this codebase:
  E402 (late imports), E712 (SQLAlchemy filters), B904 (raise from),
  SIM108/SIM105/SIM117 (readability preferences)
- Added per-file ignores for tests and scripts
- Excluded broken scripts/rename_terminology.py (has curly quotes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 23:10:42 +01:00

47 lines
1.4 KiB
Python

# app/api/v1/merchant/__init__.py
"""
Merchant API router aggregation.
This module combines auto-discovered module routes for the merchant API.
Merchant routes provide the billing portal for business owners:
- billing: subscriptions, invoices, tier management, checkout
- tenancy: stores list, merchant profile
IMPORTANT:
- This router is for JSON API endpoints only
- HTML page routes are mounted separately in main.py
- Module routes are auto-discovered from app/modules/{module}/routes/api/merchant.py
"""
from fastapi import APIRouter
# Create merchant router
router = APIRouter()
# ============================================================================
# Auto-discovered Module Routes
# ============================================================================
# All routes from self-contained modules are auto-discovered and registered.
# Modules provide merchant routes at: routes/api/merchant.py
from app.modules.routes import get_merchant_api_routes
for route_info in get_merchant_api_routes():
# Only pass prefix if custom_prefix is set (router already has internal prefix)
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,
)
# Export the router
__all__ = ["router"]