A backend technical task developed as part of a recruitment challenge.
This project provides a flexible and extensible Salary Management Web API that supports multiple input formats and dynamic overtime calculation policies.
The solution consists of:
- 🌐 ASP.NET Core Web API
- 📚 OvertimePolicies Class Library
- 🗄 SQL Server Database
- 🐳 Dockerized Deployment
SalaryManagementSolution
│
├── OvertimePolicies # Class Library
│ ├── CalculatorA
│ ├── CalculatorB
│ └── CalculatorC
│
└── Salary Web API # Main API Project
Contains different overtime calculation strategies:
CalculatorACalculatorBCalculatorC
Designed for easy extensibility (Open/Closed Principle).
Responsible for:
- Receiving salary data
- Parsing different formats
- Mapping to domain models
- Calculating net salary
- Persisting data
- ✅ EF Core → Add / Update / Delete
- ✅ Dapper → Read operations (Get / GetRange)
Request (JSON / XML / Custom)
↓
Parser (based on datatype)
↓
SalaryRawDto (Unified DTO)
↓
Mapper
↓
SalaryInput (Domain Model)
↓
Service Layer
↓
Database
The architecture is:
- Clean
- Maintainable
- Testable
- Extensible
POST /json/salary/add
POST /xml/salary/add
POST /custom/salary/add
FirstName/LastName/BasicSalary/Allowance/Transportation/Date
Ali/Ahmadi/1200000/400000/350000/14010801
{
"data": "...",
"overTimeCalculator": "CalculatorB"
}NetSalary =
BasicSalary
+ Allowance
+ Transportation
+ OverTimeCalculator(BasicSalary + Allowance)
- Tax
POST /{datatype}/salary/add
PUT /{datatype}/salary/update
DELETE /{datatype}/salary/delete/{id}
GET /salary/get/{id}
GET /salary/getrange
- ASP.NET Core Web API
- Entity Framework Core
- Dapper
- SQL Server
- Swagger
- Docker
This project includes a Dockerfile for containerization.
⚠️ Docker Compose was intentionally not used.
SQL Server must be available on the host machine.
Connection string uses:
host.docker.internal
docker build -t salary-api .
docker run -p 5178:8080 salary-api- Update the connection string in
appsettings.json - Apply migrations:
dotnet ef database update- Run the API
- Open Swagger:
http://localhost:5178/swagger
Swagger UI is available for testing all endpoints and supported input formats.
A short video explaining:
- Architecture decisions
- Design choices
- Trade-offs and assumptions
🔗
https://drive.google.com/file/d/1Dl57u1FfSD48m-mbBB8Ft0MmCf-lNh3x/view?usp=drive_link
- Due to time constraints, full unit test coverage was not implemented.
- The architecture is designed to be extensible and testable.
- Overtime calculation strategies can be expanded without modifying existing logic.
Zeynab Nadi
- GitHub: https://github.com/ZeynabNadiDev
- Email: znadi05@gmail.com