fix(routing): register merchant page routes in main.py

The auto-discovery system and get_merchant_page_routes() were already
implemented but never called in main.py, so merchant portal HTML pages
at /merchants/billing/* returned 404. Add the missing import and
registration block alongside admin, store, and storefront pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-10 21:26:30 +01:00
parent d1fe3584ff
commit 1da03e41f9
3 changed files with 18 additions and 2 deletions

18
main.py
View File

@@ -64,6 +64,7 @@ from app.exceptions.handler import setup_exception_handlers
# Module route auto-discovery - all page routes now come from modules
from app.modules.routes import (
get_admin_page_routes,
get_merchant_page_routes,
get_platform_page_routes,
get_storefront_page_routes,
get_store_page_routes,
@@ -358,6 +359,23 @@ for route_info in admin_page_routes:
include_in_schema=route_info.include_in_schema,
)
# =============================================================================
# MERCHANT PAGES (Merchant billing portal)
# =============================================================================
logger.info("Auto-discovering merchant page routes...")
merchant_page_routes = get_merchant_page_routes()
logger.info(f" Found {len(merchant_page_routes)} merchant page route modules")
for route_info in merchant_page_routes:
prefix = f"/merchants{route_info.custom_prefix}" if route_info.custom_prefix else "/merchants"
logger.info(f" Registering {route_info.module_code} merchant pages at {prefix}")
app.include_router(
route_info.router,
prefix=prefix,
tags=route_info.tags,
include_in_schema=route_info.include_in_schema,
)
# =============================================================================
# STORE PAGES
# =============================================================================

View File

@@ -1,2 +0,0 @@
# tests/unit/models/database/__init__.py
"""Database model unit tests."""