You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
We need to have a design for communicating and testing database inserts
Solution
We use existing separation principles into a service layer that communicates with a repository layer. The service layer is injected into the api controller. The repository layer is injected into the service layer. The repository layer is concerned with all database communication. The service layer can only communicate with the database through the repository. This abstraction makes it easy to either mock or replace the repository implementation
Create two layers: service and repository
Repository class for database transactions. Will for now only support insert
Domain model class to represent a log entry
Service to communicate with repository class from controller
Create unit tests for service
Create integration tests for repository
The text was updated successfully, but these errors were encountered:
eskebab
changed the title
Create log service
Create log service and repository layers
Feb 12, 2025
Problem
We need to have a design for communicating and testing database inserts
Solution
We use existing separation principles into a service layer that communicates with a repository layer. The service layer is injected into the api controller. The repository layer is injected into the service layer. The repository layer is concerned with all database communication. The service layer can only communicate with the database through the repository. This abstraction makes it easy to either mock or replace the repository implementation
The text was updated successfully, but these errors were encountered: