Payroll Layered Architecture
Summary
Payroll uses recognizable layers, but application services directly depend on EF Core rather than repository ports.
Audience
Backend and frontend developers, QA and DevOps engineers, support and security engineers, and solution architects.
Overview
Payroll uses recognizable layers, but application services directly depend on EF Core rather than repository ports.
Technical Detail
Layer responsibilities
Minimal API files form presentation. Application services validate requests, orchestrate calculations and lifecycle changes, map DTOs, and generate outputs. Domain files define records and status vocabulary. Infrastructure supplies EF Core, tenant filtering, migrations, and the outbox store. Messaging is an inbound adapter.
Dependency direction
Presentation calls scoped application services. Application services reference domain types and PayrollDbContext directly. This is a pragmatic layered structure, not strict clean architecture. The composition root wires concrete implementations.
Transitional boundary
The lack of repository ports and domain-behavior methods means persistence and orchestration concerns are concentrated in application services.
Source References
microservices/src/payroll-service/Program.csmicroservices/src/payroll-service/Api/PayrollRunEndpoints.csmicroservices/src/payroll-service/Application/PayrollCalculationService.csmicroservices/src/payroll-service/Domain/PayrollEntities.csmicroservices/src/payroll-service/Infrastructure/PayrollDbContext.csmicroservices/src/payroll-service/Messaging/PayrollReadModelConsumer.cs
Related Articles
See Also
Keywords
- Payroll Service
- Payroll Layered Architecture
- Technical architecture
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly