This document will outline a proposal for a service platform (API) and a repository pattern as a business layer for IC.
- Have a data layer that is independent of models and controllers.
- Have repo methods that can be consumed from other parts of the web application and from the command line.
- Reduce logic in controllers and models, allowing controllers to focus on HTTP level work (request data, cookies, responses) and models to focus on creating relationships, casting columns, mutators, etc. The controllers should instead delegate work to the repos.
- Repository methods can be reused by different parts of the web application and to perform work for an API request coming from outside (i.e. if we use a mobile platform like React Native it can call the API endpoints which in turn consume the repositories)
- Have repo methods be easily unit tested as they will not be accessing session data, request data or external constants. They only