refactor: migrate vendor billing, invoices, payments to module auto-discovery
Billing module: - Create vendor_checkout.py (checkout, portal, cancel, reactivate, change-tier) - Create vendor_addons.py (addon management routes) - Update vendor.py to aggregate new routers Orders module: - Create vendor_invoices.py (invoice settings, CRUD, PDF generation) - Update vendor.py to aggregate invoices router Payments module: - Restructure routes from routes/ to routes/api/ - Add require_module_access dependency - Set is_self_contained=True for auto-discovery Remove legacy files: - app/api/v1/vendor/billing.py - app/api/v1/vendor/invoices.py - app/api/v1/vendor/payments.py Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,14 +21,14 @@ from models.database.admin_menu_config import FrontendType
|
||||
|
||||
def _get_admin_router():
|
||||
"""Lazy import of admin router to avoid circular imports."""
|
||||
from app.modules.payments.routes.admin import admin_router
|
||||
from app.modules.payments.routes.api.admin import admin_router
|
||||
|
||||
return admin_router
|
||||
|
||||
|
||||
def _get_vendor_router():
|
||||
"""Lazy import of vendor router to avoid circular imports."""
|
||||
from app.modules.payments.routes.vendor import vendor_router
|
||||
from app.modules.payments.routes.api.vendor import vendor_router
|
||||
|
||||
return vendor_router
|
||||
|
||||
@@ -61,6 +61,7 @@ payments_module = ModuleDefinition(
|
||||
},
|
||||
is_core=False,
|
||||
is_internal=False,
|
||||
is_self_contained=True, # Enable auto-discovery from routes/api/
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user