MIGRATION:
- Move app/api/v1/vendor/info.py to app/modules/tenancy/routes/api/vendor.py
- Change endpoint path from GET /{vendor_code} to GET /info/{vendor_code}
- Remove catch-all route ordering dependency
TENANCY MODULE SETUP:
- Mark tenancy module as is_self_contained=True
- Add routes/api/vendor.py with vendor_router
- Add exceptions.py with TenancyException hierarchy
- Add placeholder __init__.py files for services, models, schemas
FRONTEND UPDATES:
- Update static/vendor/js/login.js to use new /vendor/info/{vendor_code} path
- Update static/vendor/js/init-alpine.js to use new /vendor/info/{vendor_code} path
The new path is more explicit and eliminates the need for catch-all route
ordering in the vendor router aggregation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
# app/modules/tenancy/definition.py
|
|
"""
|
|
Tenancy Management module definition.
|
|
|
|
Platform, company, vendor, and admin user management.
|
|
Required for multi-tenant operation - cannot be disabled.
|
|
"""
|
|
|
|
from app.modules.base import ModuleDefinition
|
|
from models.database.admin_menu_config import FrontendType
|
|
|
|
tenancy_module = ModuleDefinition(
|
|
code="tenancy",
|
|
name="Tenancy Management",
|
|
description="Platform, company, vendor, and admin user management. Required for multi-tenant operation.",
|
|
version="1.0.0",
|
|
is_core=True,
|
|
is_self_contained=True,
|
|
features=[
|
|
"platform_management",
|
|
"company_management",
|
|
"vendor_management",
|
|
"admin_user_management",
|
|
],
|
|
menu_items={
|
|
FrontendType.ADMIN: [
|
|
"platforms",
|
|
"companies",
|
|
"vendors",
|
|
"admin-users",
|
|
],
|
|
FrontendType.VENDOR: [
|
|
"team",
|
|
],
|
|
},
|
|
services_path="app.modules.tenancy.services",
|
|
models_path="app.modules.tenancy.models",
|
|
schemas_path="app.modules.tenancy.schemas",
|
|
exceptions_path="app.modules.tenancy.exceptions",
|
|
)
|
|
|
|
__all__ = ["tenancy_module"]
|