Payroll Period Storage
Summary
Persistence and constraints for Payroll periods.
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
Describe the service-owned record that identifies a tenant payroll month and its lifecycle status.
Ownership
Payroll Service owns PayrollPeriod.
Lifecycle
Period records are created on demand by native calculation/freeze paths and can also be supplied by development seeding. Status and closure time represent period lifecycle state.
Persisted fields
The record contains its identity, tenant, month/year coordinates, status, creation time, and optional closure time.
Relationships
PayrollRun stores a logical period identifier, but no EF foreign key connects it to PayrollPeriod.
Constraints
One period is permitted for each tenant/year/month combination through a unique index. Status is required and length-bounded.
Indexes
The unique tenant/year/month index supports period lookup and enforces the business identity.
Tenant behavior
A global filter scopes normal queries; filter-bypassing queries must supply the tenant predicate explicitly.
Audit behavior
Period creation does not constitute universal audit coverage. Lifecycle operations may emit run-focused audit/timeline records.
Integration usage
The period is used by native Payroll lifecycle processing. Compatibility paths may derive period state from Payroll run records.
Known limitations
The logical run reference is not database enforced, and no concurrency token protects competing period updates.
Requires confirmation
- Formal close/reopen ownership outside confirmed run freeze behavior.
- Period archival and correction policy.
Source References
microservices/src/payroll-service/Infrastructure/PayrollDbContext.csmicroservices/src/payroll-service/Domain/PayrollEntities.csmicroservices/src/payroll-service/Infrastructure/Migrations/PayrollDbContextModelSnapshot.csmicroservices/src/payroll-service/Application/PayrollCalculationService.cs
Related Articles
See Also
Keywords
- Payroll database
- Payroll Period Storage
- Payroll persistence
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly