feat: add self-contained structure to remaining modules
Add exceptions, models, schemas, services directories to modules: customers: - exceptions.py, models/, schemas/, services/ inventory: - exceptions.py, models/, schemas/, services/ messaging: - exceptions.py, models/, schemas/, services/ monitoring: - exceptions.py, models/, schemas/, services/ orders: - exceptions.py, models/, schemas/, services/ payments: - Updated __init__.py All modules now have the standard self-contained directory structure ready for future migration of business logic. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,22 +2,35 @@
|
||||
"""
|
||||
Orders Module - Order processing and fulfillment.
|
||||
|
||||
This module provides:
|
||||
This is a self-contained module providing:
|
||||
- Order management and tracking
|
||||
- Order fulfillment workflow
|
||||
- Order item exceptions handling
|
||||
- Bulk order operations
|
||||
- Order export and reporting
|
||||
- Invoice generation
|
||||
- Customer checkout
|
||||
|
||||
Routes:
|
||||
- Admin: /api/v1/admin/orders/*, /api/v1/admin/order-item-exceptions/*
|
||||
- Vendor: /api/v1/vendor/orders/*, /api/v1/vendor/order-item-exceptions/*
|
||||
|
||||
Menu Items:
|
||||
- Admin: orders
|
||||
- Vendor: orders
|
||||
Module Structure:
|
||||
- models/ - Database models (Order, OrderItem, Invoice, etc.)
|
||||
- services/ - Business logic (OrderService, InvoiceService)
|
||||
- schemas/ - Pydantic DTOs
|
||||
- routes/ - API routes
|
||||
- exceptions.py - Module-specific exceptions
|
||||
"""
|
||||
|
||||
from app.modules.orders.definition import orders_module
|
||||
# Use lazy imports to avoid circular import issues
|
||||
|
||||
__all__ = ["orders_module"]
|
||||
|
||||
def __getattr__(name: str):
|
||||
"""Lazy import module components to avoid circular imports."""
|
||||
if name == "orders_module":
|
||||
from app.modules.orders.definition import orders_module
|
||||
|
||||
return orders_module
|
||||
elif name == "get_orders_module_with_routers":
|
||||
from app.modules.orders.definition import get_orders_module_with_routers
|
||||
|
||||
return get_orders_module_with_routers
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||
|
||||
|
||||
__all__ = ["orders_module", "get_orders_module_with_routers"]
|
||||
|
||||
Reference in New Issue
Block a user