refactor: migrate messaging and media routes to modules

Messaging module (communication):
- vendor_messages.py: Conversation and message management
- vendor_notifications.py: Vendor notifications
- vendor_email_settings.py: SMTP and provider configuration
- vendor_email_templates.py: Email template customization

CMS module (content management):
- vendor_media.py: Media library management
- vendor_content_pages.py: Content page overrides

All routes auto-discovered via is_self_contained=True.
Deleted 5 legacy files from app/api/v1/vendor/.
app/api/v1/vendor/ now empty except for __init__.py (auto-discovery only).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 15:21:25 +01:00
parent da3f28849e
commit 7639ca602b
12 changed files with 385 additions and 410 deletions

View File

@@ -2,38 +2,15 @@
"""
CMS module vendor routes.
This module wraps the existing vendor content pages and media routes
and adds module-based access control. Routes are re-exported from the
original location with the module access dependency.
Re-exports routes from the API routes for backwards compatibility
with the lazy router attachment pattern.
Includes:
- /content-pages/* - Content page management
- /media/* - Media library
"""
from fastapi import APIRouter, Depends
# Re-export vendor_router from API routes
from app.modules.cms.routes.api.vendor import vendor_router
from app.api.deps import require_module_access
# Import original routers (direct import to avoid circular dependency)
from app.api.v1.vendor.content_pages import router as content_original_router
from app.api.v1.vendor.media import router as media_original_router
# Create module-aware router for content pages
vendor_router = APIRouter(
prefix="/content-pages",
dependencies=[Depends(require_module_access("cms"))],
)
# Re-export all routes from the original content pages module
for route in content_original_router.routes:
vendor_router.routes.append(route)
# Create separate router for media library
vendor_media_router = APIRouter(
prefix="/media",
dependencies=[Depends(require_module_access("cms"))],
)
for route in media_original_router.routes:
vendor_media_router.routes.append(route)
__all__ = ["vendor_router"]