This project was created to embellish code-first principles. It uses .Net 5, EntityFramework Sqlite, and DDD.
The database context can be used for the application and testing.
There are 4 types of employees: Permanent, Part-time, Interns and Contractors.
• Permanent employees get a 10% discount. They also get an extra 5% if they have been in the company for longer than 3 years.
• Part-time employees get a 5% discount. They also get an extra 3% if they have been in the company for longer than 5 years.
• Interns get a 5% discount but only on products with a price greater than 30.
• Contractors never get a discount.
Inside the code you will find that a strategy was used to decide what to apply.
All scenarios have unit tests, made with xUnit.
Insert one employee using the AddEmployee Endpoint.
Provide your respective employeeType, and employmentDate.
Pass a value and employeeId to the ApplyDiscount Endpoint. (EmployeeIds starts at 1)