Files
orion/app/api/v1/admin/__init__.py
Samir Boulahtit fb3aa89086 feat: add CMS service layer and API endpoints
Implement complete CMS business logic and REST API:

Service Layer (content_page_service.py):
- get_page_for_vendor() - Two-tier lookup with fallback
- list_pages_for_vendor() - Merge vendor + platform pages
- create_page(), update_page(), delete_page() - CRUD operations
- Support for published/draft workflow
- Footer/header navigation filtering

API Endpoints:

Admin API (/api/v1/admin/content-pages):
- POST /platform - Create platform defaults
- GET /platform - List platform defaults
- GET / - List all pages with vendor filtering
- PUT /{id} - Update any page
- DELETE /{id} - Delete any page

Vendor API (/api/v1/vendor/{code}/content-pages):
- GET / - List available pages (vendor + platform merged)
- GET /overrides - List only vendor overrides
- POST / - Create vendor override
- PUT /{id} - Update vendor page
- DELETE /{id} - Delete vendor page

Shop API (/api/v1/shop/content-pages):
- GET /navigation - Get footer/header navigation pages
- GET /{slug} - Get specific page (public, with fallback)

All endpoints include proper authentication, authorization,
and validation using Pydantic schemas.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 15:54:48 +01:00

112 lines
3.4 KiB
Python

# app/api/v1/admin/__init__.py
"""
Admin API router aggregation.
This module combines all admin-related JSON API endpoints:
- Authentication (login/logout)
- Vendor management (CRUD, bulk operations)
- Vendor domains management (custom domains, DNS verification)
- Vendor themes management (theme editor, presets)
- User management (status, roles)
- Dashboard and statistics
- Marketplace monitoring
- Audit logging
- Platform settings
- Notifications and alerts
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 admin routers
from . import (
auth,
vendors,
vendor_domains,
vendor_themes,
users,
dashboard,
marketplace,
monitoring,
audit,
settings,
notifications,
content_pages
)
# Create admin router
router = APIRouter()
# ============================================================================
# Authentication & Authorization
# ============================================================================
# Include authentication endpoints
router.include_router(auth.router, tags=["admin-auth"])
# ============================================================================
# Vendor Management
# ============================================================================
# Include vendor management endpoints
router.include_router(vendors.router, tags=["admin-vendors"])
# Include vendor domains management endpoints
router.include_router(vendor_domains.router, tags=["admin-vendor-domains"])
# Include vendor themes management endpoints
router.include_router(vendor_themes.router, tags=["admin-vendor-themes"])
# Include content pages management endpoints
router.include_router(content_pages.router, prefix="/content-pages", tags=["admin-content-pages"])
# ============================================================================
# User Management
# ============================================================================
# Include user management endpoints
router.include_router(users.router, tags=["admin-users"])
# ============================================================================
# Dashboard & Statistics
# ============================================================================
# Include dashboard and statistics endpoints
router.include_router(dashboard.router, tags=["admin-dashboard"])
# ============================================================================
# Marketplace & Imports
# ============================================================================
# Include marketplace monitoring endpoints
router.include_router(marketplace.router, tags=["admin-marketplace"])
# ============================================================================
# Platform Administration
# ============================================================================
# Include monitoring endpoints (placeholder for future implementation)
# router.include_router(monitoring.router, tags=["admin-monitoring"])
# Include audit logging endpoints
router.include_router(audit.router, tags=["admin-audit"])
# Include platform settings endpoints
router.include_router(settings.router, tags=["admin-settings"])
# Include notifications and alerts endpoints
router.include_router(notifications.router, tags=["admin-notifications"])
# Export the router
__all__ = ["router"]