# azamovsiyovush/kppsystem_test architecture

> Architecture diagram of the GitHub repository azamovsiyovush/kppsystem_test, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azamovsiyovush/kppsystem_test
- Repository: https://github.com/azamovsiyovush/kppsystem_test

## Overview

KPP is an employee and shift-management API: requests enter through Web API controllers, are handled by application commands or queries, and access persisted employee/shift data through repository interfaces. Its reporting workflow retrieves monthly shifts and calculates violations by employee position. The tree and source index support the main API, application, domain, and persistence layers; the README is empty, and not all handlers or wiring were excerpted, so some relationships are omitted.

Main entry points: [`KPP.Application/Features/KPP/Handlers/GetMonthlyViolationsQueryHandler.cs`](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Features/KPP/Handlers/GetMonthlyViolationsQueryHandler.cs) (Violation report), [`KPP.Application/Features/Employees/Handlers`](https://github.com/azamovsiyovush/kppsystem_test/tree/master/KPP.Application/Features/Employees/Handlers) (Employee operations), [`KPP.Application/Features/KPP/Handlers`](https://github.com/azamovsiyovush/kppsystem_test/tree/master/KPP.Application/Features/KPP/Handlers) (Shift operations), [`KPP.Application/Interfaces/Repositories/IEmployeeRepository.cs`](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Interfaces/Repositories/IEmployeeRepository.cs) (Employee contracts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Web API"]
  node_employee_api["Employee API"]
  node_shift_api["Shift API<br/>[KppController.cs]"]
  node_stats_api["Statistics API"]
end

subgraph group_app["Application"]
  node_employee_ops["Employee operations<br/>[Handlers]"]
  node_shift_ops["Shift operations<br/>[Handlers]"]
  node_violation_report["Violation report"]
  node_employee_contracts["Employee contracts"]
  node_shift_contracts["Shift contracts"]
  node_command_contract["Command handling<br/>[ICommandHandler.cs]"]
  node_query_contract["Query handling<br/>[IQueryHandler.cs]"]
  node_result["Result envelope<br/>[Result.cs]"]
end

subgraph group_domain["Domain"]
  node_employee["Employee<br/>[Employee.cs]"]
  node_shift["Shift<br/>[Shift.cs]"]
  node_position["Job positions<br/>[Position.cs]"]
end

subgraph group_infra["Persistence"]
  node_employee_repo["Employee repository"]
  node_shift_repo["Shift repository<br/>[ShiftRepository.cs]"]
  node_unit_of_work["Unit of work<br/>[UnitOfWork.cs]"]
  node_db_context[("Application database")]
end

node_client(("API Client"))

node_client -->|"requests"| node_employee_api
node_client -->|"requests"| node_shift_api
node_client -->|"requests"| node_stats_api
node_employee_api -->|"dispatches"| node_employee_ops
node_shift_api -->|"dispatches"| node_shift_ops
node_stats_api -->|"dispatches"| node_violation_report
node_employee_ops -->|"uses"| node_employee_contracts
node_shift_ops -->|"uses"| node_employee_contracts
node_shift_ops -->|"uses"| node_shift_contracts
node_violation_report -->|"loads shifts"| node_shift_contracts
node_violation_report -->|"checks position"| node_position
node_employee_repo -->|"queries"| node_db_context
node_shift_repo -->|"queries"| node_db_context
node_unit_of_work -->|"saves changes"| node_db_context
node_employee_repo -->|"implements"| node_employee_contracts
node_shift_repo -->|"implements"| node_shift_contracts
node_employee_ops -->|"implements"| node_command_contract
node_violation_report -->|"implements"| node_query_contract
node_employee -->|"has role"| node_position
node_shift -->|"references employee"| node_employee

click node_employee_api "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.WebApi/Controllers/EmployeeController.cs"
click node_shift_api "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.WebApi/Controllers/KppController.cs"
click node_stats_api "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.WebApi/Controllers/StatisticsController.cs"
click node_employee_ops "https://github.com/azamovsiyovush/kppsystem_test/tree/master/KPP.Application/Features/Employees/Handlers"
click node_shift_ops "https://github.com/azamovsiyovush/kppsystem_test/tree/master/KPP.Application/Features/KPP/Handlers"
click node_violation_report "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Features/KPP/Handlers/GetMonthlyViolationsQueryHandler.cs"
click node_employee_contracts "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Interfaces/Repositories/IEmployeeRepository.cs"
click node_shift_contracts "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Interfaces/Repositories/IShiftRepository.cs"
click node_command_contract "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Interfaces/Commands/ICommandHandler.cs"
click node_query_contract "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Interfaces/Queries/IQueryHandler.cs"
click node_result "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Common/Results/Result.cs"
click node_employee "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Domain/Entities/Employee.cs"
click node_shift "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Domain/Entities/Shift.cs"
click node_position "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Domain/Enums/Position.cs"
click node_employee_repo "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Infrastructure/Persistence/Repositories/EmployeeRepository.cs"
click node_shift_repo "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Infrastructure/Persistence/Repositories/ShiftRepository.cs"
click node_unit_of_work "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Infrastructure/Persistence/Repositories/UnitOfWork.cs"
click node_db_context "https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Infrastructure/ApplicationDbContext.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_employee_api,node_shift_api,node_stats_api,node_client toneBlue
class node_employee_ops,node_shift_ops,node_violation_report,node_employee_contracts,node_shift_contracts,node_command_contract,node_query_contract,node_result toneAmber
class node_employee,node_shift,node_position toneMint
class node_employee_repo,node_shift_repo,node_unit_of_work,node_db_context toneRose
```

## Components

### Web API

- [Employee API](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.WebApi/Controllers/EmployeeController.cs): `KPP.WebApi/Controllers/EmployeeController.cs`
- [Shift API](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.WebApi/Controllers/KppController.cs): `KPP.WebApi/Controllers/KppController.cs`
- [Statistics API](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.WebApi/Controllers/StatisticsController.cs): `KPP.WebApi/Controllers/StatisticsController.cs`

### Application

- [Employee operations](https://github.com/azamovsiyovush/kppsystem_test/tree/master/KPP.Application/Features/Employees/Handlers): `KPP.Application/Features/Employees/Handlers`
- [Shift operations](https://github.com/azamovsiyovush/kppsystem_test/tree/master/KPP.Application/Features/KPP/Handlers): `KPP.Application/Features/KPP/Handlers`
- [Violation report](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Features/KPP/Handlers/GetMonthlyViolationsQueryHandler.cs): `KPP.Application/Features/KPP/Handlers/GetMonthlyViolationsQueryHandler.cs`
- [Employee contracts](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Interfaces/Repositories/IEmployeeRepository.cs): `KPP.Application/Interfaces/Repositories/IEmployeeRepository.cs`
- [Shift contracts](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Interfaces/Repositories/IShiftRepository.cs): `KPP.Application/Interfaces/Repositories/IShiftRepository.cs`
- [Command handling](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Interfaces/Commands/ICommandHandler.cs): `KPP.Application/Interfaces/Commands/ICommandHandler.cs`
- [Query handling](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Interfaces/Queries/IQueryHandler.cs): `KPP.Application/Interfaces/Queries/IQueryHandler.cs`
- [Result envelope](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Application/Common/Results/Result.cs): `KPP.Application/Common/Results/Result.cs`

### Domain

- [Employee](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Domain/Entities/Employee.cs): `KPP.Domain/Entities/Employee.cs`
- [Shift](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Domain/Entities/Shift.cs): `KPP.Domain/Entities/Shift.cs`
- [Job positions](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Domain/Enums/Position.cs): `KPP.Domain/Enums/Position.cs`

### Persistence

- [Employee repository](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Infrastructure/Persistence/Repositories/EmployeeRepository.cs): `KPP.Infrastructure/Persistence/Repositories/EmployeeRepository.cs`
- [Shift repository](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Infrastructure/Persistence/Repositories/ShiftRepository.cs): `KPP.Infrastructure/Persistence/Repositories/ShiftRepository.cs`
- [Unit of work](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Infrastructure/Persistence/Repositories/UnitOfWork.cs): `KPP.Infrastructure/Persistence/Repositories/UnitOfWork.cs`
- [Application database](https://github.com/azamovsiyovush/kppsystem_test/blob/master/KPP.Infrastructure/ApplicationDbContext.cs): `KPP.Infrastructure/ApplicationDbContext.cs`

### Other components

- **API Client**

## Connections

- API Client → Employee API: requests (evidence: `KPP.WebApi/Controllers/EmployeeController.cs`)
- API Client → Shift API: requests (evidence: `KPP.WebApi/Controllers/KppController.cs`)
- API Client → Statistics API: requests (evidence: `KPP.WebApi/Controllers/StatisticsController.cs`)
- Employee API → Employee operations: dispatches (evidence: `KPP.WebApi/Controllers/EmployeeController.cs`)
- Shift API → Shift operations: dispatches (evidence: `KPP.WebApi/Controllers/KppController.cs`)
- Statistics API → Violation report: dispatches (evidence: `KPP.WebApi/Controllers/StatisticsController.cs`)
- Employee operations → Employee contracts: uses (evidence: `KPP.Application/Features/Employees/Handlers/UpdateEmployeeCommandHandler.cs`)
- Shift operations → Employee contracts: uses (evidence: `KPP.Application/Features/KPP/Handlers/StartShiftCommandHandler.cs`)
- Shift operations → Shift contracts: uses (evidence: `KPP.Application/Features/KPP/Handlers/StartShiftCommandHandler.cs`)
- Violation report → Shift contracts: loads shifts (evidence: `KPP.Application/Features/KPP/Handlers/GetMonthlyViolationsQueryHandler.cs`)
- Violation report → Job positions: checks position (evidence: `KPP.Application/Features/KPP/Handlers/GetMonthlyViolationsQueryHandler.cs`)
- Employee repository → Application database: queries (evidence: `KPP.Infrastructure/Persistence/Repositories/EmployeeRepository.cs`)
- Shift repository → Application database: queries (evidence: `KPP.Infrastructure/Persistence/Repositories/ShiftRepository.cs`)
- Unit of work → Application database: saves changes (evidence: `KPP.Infrastructure/Persistence/Repositories/UnitOfWork.cs`)
- Employee repository → Employee contracts: implements (evidence: `KPP.Infrastructure/Persistence/Repositories/EmployeeRepository.cs`)
- Shift repository → Shift contracts: implements (evidence: `KPP.Infrastructure/Persistence/Repositories/ShiftRepository.cs`)
- Employee operations → Command handling: implements (evidence: `KPP.Application/Features/Employees/Handlers/UpdateEmployeeCommandHandler.cs`)
- Violation report → Query handling: implements (evidence: `KPP.Application/Features/KPP/Handlers/GetMonthlyViolationsQueryHandler.cs`)
- Employee → Job positions: has role (evidence: `KPP.Domain/Entities/Employee.cs`)
- Shift → Employee: references employee (evidence: `KPP.Domain/Entities/Shift.cs`)
