Concept Flow - Business logic in services
Controller receives request
Controller calls Service method
Service executes business logic
Service calls Repository for data
Repository interacts with database
Repository returns data to Service
Service processes data and returns result
Controller sends response to client
The controller gets a request and calls the service. The service runs business rules and uses the repository to get or save data. Then the service returns results back to the controller, which sends the response.