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,21 +2,34 @@
|
||||
"""
|
||||
Customers Module - Customer database and management.
|
||||
|
||||
This module provides:
|
||||
This is a self-contained core module providing:
|
||||
- Customer registration and authentication
|
||||
- Customer profiles and contact information
|
||||
- Customer address management
|
||||
- Customer segmentation and tags
|
||||
- Purchase history tracking
|
||||
- Customer exports
|
||||
|
||||
Routes:
|
||||
- Admin: /api/v1/admin/customers/*
|
||||
- Vendor: /api/v1/vendor/customers/*
|
||||
|
||||
Menu Items:
|
||||
- Admin: customers
|
||||
- Vendor: customers
|
||||
Module Structure:
|
||||
- models/ - Database models (Customer, CustomerAddress, etc.)
|
||||
- services/ - Business logic (CustomerService, CustomerAddressService)
|
||||
- schemas/ - Pydantic DTOs
|
||||
- routes/ - API routes
|
||||
- exceptions.py - Module-specific exceptions
|
||||
"""
|
||||
|
||||
from app.modules.customers.definition import customers_module
|
||||
# Use lazy imports to avoid circular import issues
|
||||
|
||||
__all__ = ["customers_module"]
|
||||
|
||||
def __getattr__(name: str):
|
||||
"""Lazy import module components to avoid circular imports."""
|
||||
if name == "customers_module":
|
||||
from app.modules.customers.definition import customers_module
|
||||
|
||||
return customers_module
|
||||
elif name == "get_customers_module_with_routers":
|
||||
from app.modules.customers.definition import get_customers_module_with_routers
|
||||
|
||||
return get_customers_module_with_routers
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||
|
||||
|
||||
__all__ = ["customers_module", "get_customers_module_with_routers"]
|
||||
|
||||
Reference in New Issue
Block a user