-
Development:
- ASP.NET Web API
- EF Core
- MySQL
-
Testing:
- NUnit
- EF Core
-
Container:
- Docker
The application consists of 6 API methods:
-
Get Orders:
- Retrieves all orders along with their corresponding items.
-
Get Order By Status:
- Fetches orders filtered by a specified status.
-
Get Profit Of All Completed Order:
- Returns profit data for orders with status "Completed" for all months of a specified year. If no year is provided, records default to the current year.
-
Get Total Profit Of Each Month:
- Calculates total profit for orders with status "Completed" for all months of a specified year. If no year is provided, records default to the current year.
-
Update Order Status:
- Updates the status of a specified order.
-
Create Order:
- Accepts an
OrderDetailobject as input to create a new order.
- Accepts an
The changes in the structure of the application compared to the original version:
-
OrderStatusEnum:
- Order statuses are implemented as an enumeration (
OrderStatusEnum), mapped to the database, aligning with standard practices for management systems.
- Order statuses are implemented as an enumeration (
-
Interface:
- All interfaces are consolidated into the same files as their implementation methods for streamlined development and maintenance.
-
Api client:
- Swagger is configured as the API client for testing. The Swagger setup is ready to use.
-
Docker:
- Docker is configured to support Swagger. To test, run
docker-compose upand access the Swagger UI athttp://localhost:8000/swagger.
- Docker is configured to support Swagger. To test, run
-
Test Units:
- Unit tests are implemented for each API method, covering expected standard behaviors.
-
Exception Handling:
- Implement enhanced exception handling to prevent exposing raw errors to users, improving security and user experience.
-
Pagination Enhancement:
- The current dataset includes approximately 100 order records, suitable for retrieving all at once. In production environments with potentially thousands of records, implementing pagination for
GetOrdersandGetOrderByStatusis recommended to reduce performance load.
- The current dataset includes approximately 100 order records, suitable for retrieving all at once. In production environments with potentially thousands of records, implementing pagination for
-
Unit Testing:
- Expand unit test coverage to include edge cases and additional scenarios for comprehensive validation.
-
MySql and Docker studies:
- As MySQL and Docker were newly adopted for this project, further optimization of database queries and container configurations could enhance application performance with additional time investment.