Payroll Application Layer
Summary
The application layer is implemented as scoped services called directly from minimal APIs, with DTO records and mapping helpers colocated in service files.
Audience
Backend and frontend developers, QA and DevOps engineers, support and security engineers, and solution architects.
Overview
The application layer is implemented as scoped services called directly from minimal APIs, with DTO records and mapping helpers colocated in service files.
Technical Detail
Services and flows
The calculation service orchestrates run calculation and lifecycle. The outputs service builds reports, payslips, PDFs, and exports. The compatibility service preserves monolith-shaped behavior during cutover.
Commands and queries
There are no separate command/query handler classes. Minimal API delegates invoke service methods directly. DTO records and private mapping methods form the request/response boundary; no mapping library is confirmed.
Validation and errors
Validation is imperative inside endpoints and services. Common argument, invalid-operation, and not-found failures are translated by endpoint code. FluentValidation and a shared Result abstraction are absent.
Transactions and events
Application services add domain records, audit/timeline evidence, and outbox messages to one DbContext and save. Multi-save output/report operations may persist audit separately from the read or file generation.
Source References
microservices/src/payroll-service/Application/PayrollCalculationService.csmicroservices/src/payroll-service/Application/PayrollOutputsService.csmicroservices/src/payroll-service/Application/PayrollCompatService.csmicroservices/src/payroll-service/Api/PayrollRunEndpoints.csmicroservices/src/payroll-service/Api/PayrollOutputEndpoints.cs
Related Articles
See Also
Keywords
- Payroll Service
- Payroll Application Layer
- Technical architecture
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly