This API manages insurance claims and covers, allowing operations such as creation, retrieval, and deletion of claim and cover entries.
- POST /claims: Create a claim.
- GET /claims: List all claims.
- GET /claims/{id}: Retrieve a specific claim.
- DELETE /claims/{id}: Delete a specific claim.
- POST /covers: Create a cover.
- GET /covers: List all covers.
- POST /covers/compute: Calculate cover details.
- GET /covers/{id}: Retrieve a specific cover.
- DELETE /covers/{id}: Delete a specific cover.
- Code is segregated into their respective projects (Followed Onion Architecture).
- Used
MediatR
pattern for loose coupling between Api and Application layer. - Used
SOLID
principles. - Documentation is added.
- Fluent validation rules are added for the request validation.
- Custom exception handling is added too for specific exceptions.
- I am not entirely clear with this task. Generally, auditing is done once the transaction (INSERT & DELETE) is completed but the task is contrary to this. I would keep the auditing out of the claims api. (Open for discussion.)
- However, I have used Task.WhenAll to make the process async and non-blocking.
- I have added a few unit tests for the Claims API. There is definitely room for more tests but due to time constraints, I have important ones. (Only postive tests.)
- Refactored the code and corrected the logic as per the requirement.