- 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>
62 lines
2.4 KiB
Python
62 lines
2.4 KiB
Python
# app/api/main.py
|
|
"""
|
|
API router configuration for multi-tenant ecommerce platform.
|
|
|
|
This module provides:
|
|
- API version 1 route aggregation
|
|
- Route organization by user type (admin, store, storefront)
|
|
- Auto-discovery of module routes
|
|
"""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from app.api.v1 import admin, merchant, platform, store, storefront, webhooks
|
|
|
|
api_router = APIRouter()
|
|
|
|
# ============================================================================
|
|
# ADMIN ROUTES (Platform-level management)
|
|
# Prefix: /api/v1/admin
|
|
# ============================================================================
|
|
|
|
api_router.include_router(admin.router, prefix="/v1/admin", tags=["admin"])
|
|
|
|
# ============================================================================
|
|
# STORE ROUTES (Store-scoped operations)
|
|
# Prefix: /api/v1/store
|
|
# ============================================================================
|
|
|
|
api_router.include_router(store.router, prefix="/v1/store", tags=["store"])
|
|
|
|
# ============================================================================
|
|
# STOREFRONT ROUTES (Public customer-facing API)
|
|
# Prefix: /api/v1/storefront
|
|
# Note: Previously /api/v1/shop, renamed as not all platforms sell items
|
|
# ============================================================================
|
|
|
|
api_router.include_router(storefront.router, prefix="/v1/storefront", tags=["storefront"])
|
|
|
|
# ============================================================================
|
|
# PLATFORM ROUTES (Unauthenticated endpoints)
|
|
# Prefix: /api/v1/platform
|
|
# Includes: /signup, /pricing, /letzshop-stores, /language
|
|
# ============================================================================
|
|
|
|
api_router.include_router(platform.router, prefix="/v1/platform", tags=["platform"])
|
|
|
|
# ============================================================================
|
|
# WEBHOOK ROUTES (External service callbacks via auto-discovery)
|
|
# Prefix: /api/v1/webhooks
|
|
# Includes: /stripe
|
|
# ============================================================================
|
|
|
|
api_router.include_router(webhooks.router, prefix="/v1/webhooks", tags=["webhooks"])
|
|
|
|
# ============================================================================
|
|
# MERCHANT ROUTES (Merchant billing portal)
|
|
# Prefix: /api/v1/merchants
|
|
# Includes: /subscriptions, /billing, /stores, /profile
|
|
# ============================================================================
|
|
|
|
api_router.include_router(merchant.router, prefix="/v1/merchants", tags=["merchants"])
|