3.6. Application Flow
This document describes the request and response flow in the application, ensuring a clear separation of concerns and proper layer responsibilities.
3.6.1. Request Flow
Runner (entrypoint) → Instantiates the application layers.
Presentation → Receives user input, converts it into DTO + Filters.
Mapper (Application) → Converts DTO to Domain Model.
Service (Application) → Applies business rules, working with Domain Model.
Repository (Application) → Sends Domain Model or Filters to a Adapter.
Adapter (Infrastructure) → Interacts with the database and returns the Infrastructure Model.
3.6.2. Response Flow
Adapter (Infrastructure) → Returns the Infrastructure Model.
Mapper (Infrastructure) → Converts Infrastructure Model to Domain Model.
Repository (Application) → Returns the Domain Model.
Service (Application) → Applies business rules, returning the Domain Model.
Mapper (Application) → Converts Domain Model to DTO.
Presentation → Prepares the API response.
This architecture ensures full decoupling between layers, making the system more maintainable and testable.