Payroll Persistence Object Reference
Summary
Public-safe reference for all objects mapped by PayrollDbContext.
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
Provide a complete logical object inventory without physical schema definitions, SQL, or sensitive data.
Ownership
One PayrollDbContext exposes 19 DbSets.
Lifecycle
The object inventory reflects the current model snapshot after all four migrations.
Persisted fields
| Object | High-level purpose | Primary key | Explicit index profile |
|---|---|---|---|
| PayrollPeriod | Tenant payroll period lifecycle | Id | Unique tenant/period |
| PayrollRun | Period calculation aggregate | Id | Tenant/period/status |
| PayrollRunDetail | Employee outcome per run | Id | Unique tenant/run/employee |
| SalaryCalculation | Calculation evidence/payload | Id | Tenant/run/employee |
| Payslip | Structured employee payslip | Id | Unique tenant/run/employee |
| PayrollAdjustment | Period employee adjustment | Id | Tenant/employee/period |
| AdvanceSummary | Current employee advance summary | Id | Unique tenant/employee |
| AdvanceTransaction | Advance/recovery ledger entry | Id | Tenant/employee/date; tenant/run/type |
| OvertimeEntry | Dated employee overtime input | Id | Tenant/employee/date |
| SalaryComponent | Tenant/employee calculation component | Id | Tenant/name/employee |
| StatutorySetting | Tenant statutory component setting | Id | Unique tenant/component |
| PayrollAuditLog | Operation evidence | Id | Tenant/occurrence time |
| PayrollTimeline | Employee/run chronology | Id | Tenant/employee/occurrence time |
| EmployeePayrollProfile | Payroll workforce projection | Id | Unique tenant/legacy employee; tenant/employee |
| AttendancePayrollSnapshot | Employee-period attendance projection | Id | Unique tenant/employee/period |
| LeavePayrollSnapshot | Employee-period leave projection | Id | Unique tenant/employee/period |
| ApprovedExpenseSnapshot | Approved-expense projection | Id | Unique tenant/claim; tenant/employee/period |
| ProcessedIntegrationEvent | Inbound idempotency marker | EventId | Tenant/event type/occurrence time |
| OutboxMessage | Outbound publication intent | Id | Unique event identity; status/occurrence time |
Relationships
Logical references exist among period, run, detail, calculation, payslip, employee, timeline, advance reversal, and projection records. EF defines zero relationships and zero foreign keys.
Constraints
There are 19 primary keys and 10 unique indexes. Required strings, maximum lengths, structured payload mappings, and fixed-precision numeric mappings are selectively configured.
Indexes
There are 23 explicit secondary indexes: 10 unique and 13 non-unique. No foreign-key index exists.
Tenant behavior
Seventeen objects use the global filter. ProcessedIntegrationEvent and OutboxMessage carry tenant metadata without that filter.
Audit behavior
PayrollAuditLog, PayrollTimeline, ProcessedIntegrationEvent, and OutboxMessage have distinct evidence/integration roles.
Integration usage
Workforce, attendance, leave, and expense objects are local projections. Processed-event and outbox objects support inbound/outbound integration reliability.
Known limitations
This is a logical reference, not a DDL contract. No owned type, persisted value object, delete behavior, or concurrency token is configured.
Requires confirmation
- Data classification, retention, archival, and purge policy for every object.
- Whether referential constraints will be introduced in a future model.
Source References
microservices/src/payroll-service/Infrastructure/PayrollDbContext.csmicroservices/src/payroll-service/Domain/PayrollEntities.csmicroservices/src/payroll-service/Infrastructure/Migrations/PayrollDbContextModelSnapshot.cs
Related Articles
See Also
Keywords
- Payroll database
- Payroll Persistence Object Reference
- Payroll persistence
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly