Skip to main content

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.cs
  • microservices/src/payroll-service/Api/PayrollRunEndpoints.cs
  • microservices/src/payroll-service/Application/PayrollCalculationService.cs
  • microservices/src/payroll-service/Domain/PayrollEntities.cs
  • microservices/src/payroll-service/Infrastructure/PayrollDbContext.cs
  • microservices/src/payroll-service/Messaging/PayrollReadModelConsumer.cs

See Also

Keywords

  • Payroll Service
  • Payroll Layered Architecture
  • Technical architecture

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-15
  • Review cycle: Quarterly