refactor: update registry and main.py for module auto-discovery
- app/modules/registry.py: Use auto-discovery from discovery.py - main.py: Integrate module route auto-discovery - app/routes/vendor_pages.py: Remove routes now handled by modules The registry now dynamically discovers modules from definition.py files instead of hardcoded imports. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -673,25 +673,10 @@ async def vendor_notifications_page(
|
||||
# ============================================================================
|
||||
# ANALYTICS
|
||||
# ============================================================================
|
||||
|
||||
|
||||
@router.get(
|
||||
"/{vendor_code}/analytics", response_class=HTMLResponse, include_in_schema=False
|
||||
)
|
||||
async def vendor_analytics_page(
|
||||
request: Request,
|
||||
vendor_code: str = Path(..., description="Vendor code"),
|
||||
current_user: User = Depends(get_current_vendor_from_cookie_or_header),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""
|
||||
Render analytics and reports page.
|
||||
JavaScript loads analytics data via API.
|
||||
"""
|
||||
return templates.TemplateResponse(
|
||||
"vendor/analytics.html",
|
||||
get_vendor_context(request, db, current_user, vendor_code),
|
||||
)
|
||||
# NOTE: Analytics routes moved to self-contained module: app.modules.analytics.routes.pages.vendor
|
||||
# Routes are registered directly in main.py from the Analytics module
|
||||
# This includes:
|
||||
# - /{vendor_code}/analytics (dashboard)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user