Refactor ban management with domain models and mappers
- Add ban domain model for core business logic separation - Implement mapper pattern for DTO/domain conversions - Update ban service with new domain-driven approach - Refactor router endpoints to use new architecture - Add comprehensive mapper tests - Update documentation with architecture changes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
27
backend/app/mappers/__init__.py
Normal file
27
backend/app/mappers/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""Response mappers.
|
||||
|
||||
Convert domain models (from services) to response models (for HTTP API).
|
||||
|
||||
This is the mapping layer at the router boundary, ensuring the service layer
|
||||
remains independent of HTTP response shapes.
|
||||
"""
|
||||
|
||||
from app.mappers.ban_mappers import (
|
||||
map_domain_active_ban_list_to_response,
|
||||
map_domain_active_ban_to_response,
|
||||
map_domain_ban_trend_to_response,
|
||||
map_domain_bans_by_country_to_response,
|
||||
map_domain_bans_by_jail_to_response,
|
||||
map_domain_dashboard_ban_item_to_response,
|
||||
map_domain_dashboard_ban_list_to_response,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"map_domain_active_ban_to_response",
|
||||
"map_domain_active_ban_list_to_response",
|
||||
"map_domain_dashboard_ban_item_to_response",
|
||||
"map_domain_dashboard_ban_list_to_response",
|
||||
"map_domain_bans_by_country_to_response",
|
||||
"map_domain_ban_trend_to_response",
|
||||
"map_domain_bans_by_jail_to_response",
|
||||
]
|
||||
Reference in New Issue
Block a user