Phase 1 - Vendor Router Integration: - Wire up vendor module routers in app/api/v1/vendor/__init__.py - Use lazy imports via __getattr__ to avoid circular dependencies Phase 2 - Extract Remaining Modules: - Create 6 new module directories: customers, cms, analytics, messaging, dev_tools, monitoring - Each module has definition.py and route wrappers - Update registry to import from extracted modules Phase 3 - Database Table Migration: - Add PlatformModule junction table for auditable module tracking - Add migration zc2m3n4o5p6q7_add_platform_modules_table.py - Add modules relationship to Platform model - Update ModuleService with JSON-to-junction-table migration Phase 4 - Module-Specific Configuration UI: - Add /api/v1/admin/module-config/* endpoints - Add module-config.html template and JS Phase 5 - Integration Tests: - Add tests/fixtures/module_fixtures.py - Add tests/integration/api/v1/admin/test_modules.py - Add tests/integration/api/v1/modules/test_module_access.py Architecture fixes: - Fix JS-003 errors: use ...data() directly in Alpine components - Fix JS-005 warnings: add init() guards to prevent duplicate init - Fix API-001 errors: add MenuActionResponse Pydantic model - Add FE-008 noqa for dynamic number input in template Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
# app/modules/marketplace/routes/vendor.py
|
|
"""
|
|
Marketplace module vendor routes.
|
|
|
|
This module wraps the existing vendor marketplace routes and adds
|
|
module-based access control. Routes are re-exported from the
|
|
original location with the module access dependency.
|
|
|
|
Includes:
|
|
- /marketplace/* - Marketplace settings
|
|
- /letzshop/* - Letzshop integration
|
|
"""
|
|
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from app.api.deps import require_module_access
|
|
|
|
# Import original routers (direct import to avoid circular dependency)
|
|
from app.api.v1.vendor.marketplace import router as marketplace_original_router
|
|
from app.api.v1.vendor.letzshop import router as letzshop_original_router
|
|
|
|
# Create module-aware router for marketplace
|
|
vendor_router = APIRouter(
|
|
prefix="/marketplace",
|
|
dependencies=[Depends(require_module_access("marketplace"))],
|
|
)
|
|
|
|
# Re-export all routes from the original marketplace module
|
|
for route in marketplace_original_router.routes:
|
|
vendor_router.routes.append(route)
|
|
|
|
# Create separate router for letzshop integration
|
|
vendor_letzshop_router = APIRouter(
|
|
prefix="/letzshop",
|
|
dependencies=[Depends(require_module_access("marketplace"))],
|
|
)
|
|
|
|
for route in letzshop_original_router.routes:
|
|
vendor_letzshop_router.routes.append(route)
|