Welcome to the coding exercise!
This application is a Purchase Order Management System built with .NET 9 (Web API), Angular, and SQL Database (Code First).
It allows procurement staff to manage purchase orders (POs) with features like listing, filtering, sorting, pagination, add/edit/delete.
A full‑stack Purchase Order Management application built to demonstrate real‑world engineering practices using .NET Core (backend), Angular (frontend), and SQL (relational database). The project emphasizes a clean, modular architecture, SOLID principles, testability, and maintainability.
This README explains the project purpose, how to run it locally, the architecture and design decisions, and How to evaluate the work.
- Clean Architecture: Separation of concerns into layers (API, Application / Use Cases, Domain, Infrastructure) to keep core domain independent of frameworks
- SOLID Principles:
- Single Responsibility: Controllers are small, services-focused
- Dependency Inversion: Use interfaces and DI
- Open/Closed: Services are extendable without modifying existing code
- Liskov Substitution & Interface Segregation applied where relevant
- Repository & Unit of Work: Abstractions for data access for easier testing and flexibility
- DTOs: Used for API surface and mapping to domain entities to decouple internal models
- Validation: Centralized request validation using Data Annotations
- Error Handling: Global exception middleware to return consistent error responses
GET /api/purchase-orders— list purchase ordersGET /api/purchase-orders/{id}— get single orderPOST /api/purchase-orders— create order (payload: supplier, date, lines)PUT /api/purchase-orders/{id}— update orderDELETE /api/purchase-orders/{id}— delete order
Request/response shapes are described in the DTOs file.
- Display purchase orders in a tabular view.
- Support filtering (by supplier, status, or date range).
- Support sorting (by PO number, order date, total amount).
- Support pagination for large datasets.
- Display reports with lazy loading
- Create new purchase orders.
- Update existing purchase orders.
- Delete purchase orders.
- PO Number (unique identifier)
- Description
- Supplier Name
- Order Date
- Delivery Date
- Total Amount
- Status (Draft / Approved / Shipped / Completed / Cancelled)
- PO Number must always be unique.
- Status can only be one of: Draft, Approved, Shipped, Completed, or Cancelled.
- Total Amount is always stored and displayed with two decimal places.
- Supplier filtering uses an exact match (case-insensitive).
- Status filtering uses the predefined
POStatusenum values. - Date range filtering uses inclusive range (
>= startDateand<= endDate).
- PO Number, Order Date, or Total Amount can apply sorting.
- Sorting defaults to ascending order unless explicitly requested as descending.
- Columns can be sorted at a time.
- Default page size is 10.
- The client can change the page size.
- Filtering, sorting, and pagination are implemented to handle large datasets.
- Backend: .NET 9 Web API
- Frontend: Angular 20+
- Database: MySQL Server (EF Core Code First)
- ORM: Entity Framework Core
- Download and install .NET 9 SDK from the official site:
https://dotnet.microsoft.com/en-us/download/dotnet/9.0 - Verify installation:
dotnet --version-
Install Node.js (which includes npm)
- Go to https://nodejs.org
- Download the LTS version (recommended) or Node 20+ for Angular 20
- Run the installer and follow the prompts
-
Verify Node.js installation:
node -v
npm -v
npm install -g @angular/cligit clone https://github.com/your-username/purchase-order-management.git
cd Purchase-Order-Management-FullStack- Install XAMPP (if not already installed).
- Start Apache and MySQL services.
- Make sure your MySQL connection string in
appsettings.jsonmatches your local credentials.
Example:
"ConnectionStrings": {
"DefaultConnection": "server=localhost;database=PurchaseOrderDB;user=root;password=;"
}- Navigate to the backend folder and build the project:
cd backend
dotnet build- Run initial Entity Framework migrations to create the database schema
cd PurchaseOrderManagement.WebApi
dotnet ef migrations add InitialCreate --project ../PurchaseOrderManagement.Infrastructure --startup-project .
dotnet ef database update --project ../PurchaseOrderManagement.Infrastructure --startup-project .- Run Backend Web Api
dotnet run- Navigate to the frontend folder and build the project (got to the root):
cd frontend
cd purchase-order- Install dependencies and start the application:
npm i
npm start- Author: Chethiya Bandara Herath
- Email: chethiyabandaraherath@gmail.com
- Mobile: +94757120896


