Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workflow Tracking System (WTS)

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.


📌 1. Concept

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.


🏛 2. Solution Architecture

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

⚙️ 3. Setup and Configuration

Prerequisites

  1. .NET 9.0 SDK installed

  2. SQL Server instance ((localdb)\mssqllocaldb used by default)

  3. Entity Framework CLI tool installed:

    dotnet tool install --global dotnet-ef

Database Setup

  1. Update DefaultConnection in src/Workflow.Api/appsettings.json.

  2. Apply migrations:

    dotnet ef database update --project src/Workflow.Infrastructure --startup-project src/Workflow.Api

Running the Application

dotnet run --project src/Workflow.Api

Swagger UI will be available at: 👉 http://localhost:5055/swagger/index.html


🔗 4. API Endpoints

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

✅ 5. Validation Mechanism

The custom validation mechanism is implemented in ProcessService using SimulatedExternalValidationService.

  • Step-Level Control: Each WorkflowStep has a RequiresValidation flag.

  • 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 Request is returned, and failure details are logged into ProcessStep.ValidationLog.

🧪 6. Testing

Run unit tests:

dotnet test 

The project includes unit tests that verify both the controller endpoints and the core business logic.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages