Skip to main content

Payroll Detail Storage

Summary

Employee-level calculated Payroll detail persistence.

Audience

Payroll developers, QA and support engineers, solution and security architects, and implementation partners.

Reference Content

The sections below describe the confirmed logical storage contract and its implementation boundaries.

Purpose

Document the durable employee outcome within a Payroll run.

Ownership

Payroll Service owns PayrollRunDetail; it is the main employee-level calculated outcome used by lifecycle, reporting, export, and payslip paths.

Lifecycle

Calculation or compatibility logic creates/updates a detail, assigns calculation and lifecycle status, and may mark it frozen/unfrozen with its run.

Persisted fields

High-level groups are run/employee identity, display descriptors, lifecycle status, attendance and leave units, time outcomes, earning/deduction summaries, final outcome totals, and a structured breakdown.

Relationships

Run and employee references are logical only. No foreign key links the detail to PayrollRun or EmployeePayrollProfile.

Constraints

A unique tenant/run/legacy-employee index permits one detail outcome per employee per run. Required and bounded descriptors are configured; numeric result fields use fixed precision.

Indexes

The unique composite index is the only explicit detail index.

Tenant behavior

The global filter scopes normal reads; many aggregate queries bypass it and explicitly constrain tenant and run.

Audit behavior

Native calculate/freeze/unfreeze operations add run-oriented audit and timeline evidence in the same context save. Per-field history is not implemented.

Integration usage

Details feed structured payslips, PDF rendering, exports, reports, and compatibility responses. Those reads do not create database relationships.

Known limitations

No concurrency token prevents competing updates, and no database relationship guarantees that the referenced run or employee exists.

Requires confirmation

  • Versioning and correction policy after a detail has been used downstream.
  • Long-term retention of structured breakdowns.

Source References

  • microservices/src/payroll-service/Infrastructure/PayrollDbContext.cs
  • microservices/src/payroll-service/Domain/PayrollEntities.cs
  • microservices/src/payroll-service/Infrastructure/Migrations/PayrollDbContextModelSnapshot.cs
  • microservices/src/payroll-service/Application/PayrollCalculationService.cs

See Also

Keywords

  • Payroll database
  • Payroll Detail Storage
  • Payroll persistence

Revision Information

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