This project is a technical assessment demonstrating skills in .NET 9.0 Web API, Entity Framework Core (EF Core), and clean, modular system architecture following the Clean/Layered Architecture principles.
The Workflow Tracking System (WTS) allows an organization to define multi-step workflows (templates). It then enables users to execute processes based on those workflows, tracking the progress, assigning tasks, and enforcing validation rules at specific steps.
The system is structured into four main layers, ensuring separation of concerns, scalability, and testability.
| Project | Layer | Responsibility | Key Components |
|---|---|---|---|
Workflow.Api |
Presentation | API Endpoints (Controllers), Configuration, and Dependency Injection (DI) setup. | WorkflowsController, ProcessesController |
Workflow.Application |
Application | Defines business contracts (Interfaces), Request/Response DTOs, service implementations and business exceptions. | IWorkflowService, IProcessService, CreateWorkflowDto, ProcessDto |
Workflow.Infrastructure |
Infrastructure | EF Core persistence, external validation simulation. | WorkflowDbContext, ProcessRepository |
Workflow.Core |
Core | Core business entities and logic. | Workflow, Process, Enums (ActionType, ProcessStatus) |
Workflow.Tests.Unit |
Testing | Unit tests for Api Controllers. | ProcessesControllerTests, WorkflowsControllerTests |
-
.NET 9.0 SDK installed
-
SQL Server instance (
(localdb)\mssqllocaldbused by default) -
Entity Framework CLI tool installed:
dotnet tool install --global dotnet-ef
-
Update
DefaultConnectioninsrc/Workflow.Api/appsettings.json. -
Apply migrations:
dotnet ef database update --project src/Workflow.Infrastructure --startup-project src/Workflow.Api
dotnet run --project src/Workflow.ApiSwagger UI will be available at:
👉 http://localhost:5055/swagger/index.html
| Method | Endpoint | Description |
|---|---|---|
POST |
/v1/workflows |
Create a workflow template |
get |
/v1/workflows/{id} |
get a workflow template |
POST |
/v1/processes/start |
Start a new process from a workflow |
POST |
/v1/processes/execute |
Execute the active step in a process (with validation) |
GET |
/v1/processes |
Query processes (filter by workflow, status, user) |
GET |
/v1/processes/{id} |
Retrieve full process instance with history |
The custom validation mechanism is implemented in ProcessService using SimulatedExternalValidationService.
-
Step-Level Control: Each
WorkflowStephas aRequiresValidationflag. -
Simulation Logic: If the step name contains "Finance" and the payload amount is over 10,000, validation fails.
-
Behavior:
- If validation passes → process advances.
- If validation fails → process is blocked, a
400 Bad Requestis returned, and failure details are logged intoProcessStep.ValidationLog.
Run unit tests:
dotnet test