migrating vendor frontend to new architecture
This commit is contained in:
38
app/api/v1/vendor/__init__.py
vendored
38
app/api/v1/vendor/__init__.py
vendored
@@ -2,12 +2,19 @@
|
||||
"""
|
||||
Vendor API endpoints.
|
||||
|
||||
This module aggregates all vendor-related endpoints with proper prefixes.
|
||||
This module aggregates all vendor-related JSON API endpoints.
|
||||
|
||||
IMPORTANT:
|
||||
- This router is for JSON API endpoints only
|
||||
- HTML page routes are mounted separately in main.py at /vendor/*
|
||||
- Do NOT include pages.router here - it causes route conflicts
|
||||
"""
|
||||
|
||||
from fastapi import APIRouter
|
||||
# Import all sub-routers
|
||||
|
||||
# Import all sub-routers (JSON API only)
|
||||
from . import (
|
||||
info, # NEW: Vendor info endpoint
|
||||
auth,
|
||||
dashboard,
|
||||
profile,
|
||||
@@ -22,28 +29,51 @@ from . import (
|
||||
media,
|
||||
notifications,
|
||||
analytics,
|
||||
# NOTE: pages is NOT imported here - it's mounted separately in main.py
|
||||
)
|
||||
|
||||
|
||||
# Create vendor router
|
||||
router = APIRouter()
|
||||
|
||||
# Include all vendor sub-routers with their prefixes and tags
|
||||
# Note: prefixes are already defined in each router file
|
||||
# ============================================================================
|
||||
# JSON API ROUTES ONLY
|
||||
# ============================================================================
|
||||
# These routes return JSON and are mounted at /api/v1/vendor/*
|
||||
|
||||
# Vendor info endpoint - must be first to handle GET /{vendor_code}
|
||||
router.include_router(info.router, tags=["vendor-info"])
|
||||
|
||||
# Authentication
|
||||
router.include_router(auth.router, tags=["vendor-auth"])
|
||||
|
||||
# Vendor management
|
||||
router.include_router(dashboard.router, tags=["vendor-dashboard"])
|
||||
router.include_router(profile.router, tags=["vendor-profile"])
|
||||
router.include_router(settings.router, tags=["vendor-settings"])
|
||||
|
||||
# Business operations
|
||||
router.include_router(products.router, tags=["vendor-products"])
|
||||
router.include_router(orders.router, tags=["vendor-orders"])
|
||||
router.include_router(customers.router, tags=["vendor-customers"])
|
||||
router.include_router(teams.router, tags=["vendor-teams"])
|
||||
router.include_router(inventory.router, tags=["vendor-inventory"])
|
||||
router.include_router(marketplace.router, tags=["vendor-marketplace"])
|
||||
|
||||
# Services
|
||||
router.include_router(payments.router, tags=["vendor-payments"])
|
||||
router.include_router(media.router, tags=["vendor-media"])
|
||||
router.include_router(notifications.router, tags=["vendor-notifications"])
|
||||
router.include_router(analytics.router, tags=["vendor-analytics"])
|
||||
|
||||
# ============================================================================
|
||||
# NOTE: HTML Page Routes
|
||||
# ============================================================================
|
||||
# HTML page routes (pages.router) are NOT included here.
|
||||
# They are mounted separately in main.py at /vendor/* to avoid conflicts.
|
||||
#
|
||||
# This separation ensures:
|
||||
# - JSON API: /api/v1/vendor/* (this router)
|
||||
# - HTML Pages: /vendor/* (mounted in main.py)
|
||||
|
||||
__all__ = ["router"]
|
||||
|
||||
Reference in New Issue
Block a user