This is the repo for completed synetec assessment. I have made a few changes to the project.
- Added "SynetecAssessmentApi.Core" & "SynetecAssessmentApi.Services" projects
- SynetecAssessmentApi.Core project contains service contracts and models
- SynetecAssessmentApi.Services project contains the service implementations
- I have abstracted out the Bonus Calculator from Employee Service (formerly BonusPoolService), so that I can unit test the bonus calculations seperately.
- Used dependency injection to inject Employee Service into the controller and Bonus Calcuator to employee service.
- Used AutoMapper for Domain to Model(Dto) mappings.
- Renamed BonusPoolController to EmployeesController, as I think Employees controller should be responsible for getting all employees and calculating bonus for an employee.
- Removed EmployeeId from "CalculateBonusDto" class, to make the api uri follow the recommended practice ('api/employees/{id}/bonus').
- The bonus api endpoint, return 404 not found when the employee id is not found.
- Unit test project "SynetecAssessmentApi.Tests" contains unit tests for the bonus calculator and employees controller.