Bug fix in init files
This commit is contained in:
@@ -1,17 +1,68 @@
|
|||||||
|
# app/api/v1/admin/__init__.py
|
||||||
"""
|
"""
|
||||||
Admin API endpoints.
|
Admin API router aggregation.
|
||||||
|
|
||||||
|
This module combines all admin-related API endpoints:
|
||||||
|
- Authentication (login/logout)
|
||||||
|
- Vendor management (CRUD, bulk operations)
|
||||||
|
- User management (status, roles)
|
||||||
|
- Dashboard and statistics
|
||||||
|
- Marketplace monitoring
|
||||||
|
- Audit logging (NEW)
|
||||||
|
- Platform settings (NEW)
|
||||||
|
- Notifications and alerts (NEW)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
from . import auth, vendors, dashboard, users
|
|
||||||
|
# Import all admin routers
|
||||||
|
from . import (
|
||||||
|
auth,
|
||||||
|
vendors,
|
||||||
|
users,
|
||||||
|
dashboard,
|
||||||
|
marketplace,
|
||||||
|
monitoring,
|
||||||
|
audit,
|
||||||
|
settings,
|
||||||
|
notifications
|
||||||
|
)
|
||||||
|
|
||||||
# Create admin router
|
# Create admin router
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
# Include all admin sub-routers
|
|
||||||
|
# Include authentication endpoints
|
||||||
router.include_router(auth.router, tags=["admin-auth"])
|
router.include_router(auth.router, tags=["admin-auth"])
|
||||||
|
|
||||||
|
# Include vendor management endpoints
|
||||||
router.include_router(vendors.router, tags=["admin-vendors"])
|
router.include_router(vendors.router, tags=["admin-vendors"])
|
||||||
router.include_router(dashboard.router, tags=["admin-dashboard"])
|
|
||||||
|
# Include user management endpoints
|
||||||
router.include_router(users.router, tags=["admin-users"])
|
router.include_router(users.router, tags=["admin-users"])
|
||||||
|
|
||||||
__all__ = ["router"]
|
# Include dashboard and statistics endpoints
|
||||||
|
router.include_router(dashboard.router, tags=["admin-dashboard"])
|
||||||
|
|
||||||
|
# Include marketplace monitoring endpoints
|
||||||
|
router.include_router(marketplace.router, tags=["admin-marketplace"])
|
||||||
|
|
||||||
|
# Include monitoring endpoints (placeholder)
|
||||||
|
# router.include_router(monitoring.router, tags=["admin-monitoring"])
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# NEW: Admin Models Integration
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
# 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"]
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ Public API endpoints (customer-facing).
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
from .vendors import auth, products, cart, orders
|
from .vendors import auth, products, cart, orders, vendors
|
||||||
|
|
||||||
# Create public router
|
# Create public router
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
# Include all public sub-routers
|
# Include all public sub-routers
|
||||||
|
router.include_router(vendors.router, prefix="/vendors", tags=["public-vendors"])
|
||||||
router.include_router(auth.router, prefix="/vendors", tags=["public-auth"])
|
router.include_router(auth.router, prefix="/vendors", tags=["public-auth"])
|
||||||
router.include_router(products.router, prefix="/vendors", tags=["public-products"])
|
router.include_router(products.router, prefix="/vendors", tags=["public-products"])
|
||||||
router.include_router(cart.router, prefix="/vendors", tags=["public-cart"])
|
router.include_router(cart.router, prefix="/vendors", tags=["public-cart"])
|
||||||
|
|||||||
2
app/api/v1/public/vendors/auth.py
vendored
2
app/api/v1/public/vendors/auth.py
vendored
@@ -19,7 +19,7 @@ from models.schema.auth import LoginResponse, UserLogin
|
|||||||
from models.schema.customer import CustomerRegister, CustomerResponse
|
from models.schema.customer import CustomerRegister, CustomerResponse
|
||||||
from models.database.vendor import Vendor
|
from models.database.vendor import Vendor
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter(prefix="/auth")
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
36
app/api/v1/vendor/__init__.py
vendored
36
app/api/v1/vendor/__init__.py
vendored
@@ -1,21 +1,49 @@
|
|||||||
# app/api/v1/vendor/__init__.py
|
# app/api/v1/vendor/__init__.py
|
||||||
"""
|
"""
|
||||||
Vendor API endpoints.
|
Vendor API endpoints.
|
||||||
|
|
||||||
|
This module aggregates all vendor-related endpoints with proper prefixes.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
from . import auth, dashboard, products, orders, marketplace, inventory, vendor
|
# Import all sub-routers
|
||||||
|
from . import (
|
||||||
|
auth,
|
||||||
|
dashboard,
|
||||||
|
profile,
|
||||||
|
settings,
|
||||||
|
products,
|
||||||
|
orders,
|
||||||
|
customers,
|
||||||
|
teams,
|
||||||
|
inventory,
|
||||||
|
marketplace,
|
||||||
|
payments,
|
||||||
|
media,
|
||||||
|
notifications,
|
||||||
|
analytics,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Create vendor router
|
# Create vendor router
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
# Include all vendor sub-routers
|
# Include all vendor sub-routers with their prefixes and tags
|
||||||
|
# Note: prefixes are already defined in each router file
|
||||||
|
|
||||||
router.include_router(auth.router, tags=["vendor-auth"])
|
router.include_router(auth.router, tags=["vendor-auth"])
|
||||||
router.include_router(dashboard.router, tags=["vendor-dashboard"])
|
router.include_router(dashboard.router, tags=["vendor-dashboard"])
|
||||||
|
router.include_router(profile.router, tags=["vendor-profile"])
|
||||||
|
router.include_router(settings.router, tags=["vendor-settings"])
|
||||||
router.include_router(products.router, tags=["vendor-products"])
|
router.include_router(products.router, tags=["vendor-products"])
|
||||||
router.include_router(orders.router, tags=["vendor-orders"])
|
router.include_router(orders.router, tags=["vendor-orders"])
|
||||||
router.include_router(marketplace.router, tags=["vendor-marketplace"])
|
router.include_router(customers.router, tags=["vendor-customers"])
|
||||||
|
router.include_router(teams.router, tags=["vendor-teams"])
|
||||||
router.include_router(inventory.router, tags=["vendor-inventory"])
|
router.include_router(inventory.router, tags=["vendor-inventory"])
|
||||||
router.include_router(vendor.router, tags=["vendor-management"])
|
router.include_router(marketplace.router, tags=["vendor-marketplace"])
|
||||||
|
router.include_router(payments.router, tags=["vendor-payments"])
|
||||||
|
router.include_router(media.router, tags=["vendor-media"])
|
||||||
|
router.include_router(notifications.router, tags=["vendor-notifications"])
|
||||||
|
router.include_router(analytics.router, tags=["vendor-analytics"])
|
||||||
|
|
||||||
__all__ = ["router"]
|
__all__ = ["router"]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
ECHO is off.
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ __all__ = [
|
|||||||
"base",
|
"base",
|
||||||
"auth",
|
"auth",
|
||||||
"marketplace_product",
|
"marketplace_product",
|
||||||
"inventory.py",
|
"inventory",
|
||||||
"vendor",
|
"vendor",
|
||||||
"marketplace_import_job",
|
"marketplace_import_job",
|
||||||
"stats",
|
"stats",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
ECHO is off.
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
ECHO is off.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user