Skip to main content

Leave Projection Storage

Summary

Payroll-local leave projection persistence and freshness controls.

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 local LeavePayrollSnapshot consumed by Payroll calculation.

Ownership

Payroll owns the projection; Leave remains authoritative for leave facts.

Lifecycle

Inbound leave events or backfill upsert one tenant/employee/period record with last-event markers used for duplicate/stale handling.

Persisted fields

The record stores tenant/employee/period identity, categorized leave-day summaries, a structured breakdown, event markers, and update time.

Relationships

The projection logically contributes to Payroll details but has no configured foreign key.

Constraints

A unique tenant/employee/year/month index enforces the local projection identity.

Indexes

The unique projection identity is the only explicit leave-snapshot index.

Tenant behavior

Normal reads are globally filtered; controlled synchronization/backfill uses explicit tenant predicates when bypassing filters.

Audit behavior

Synchronization/backfill records operation evidence, not a complete leave history.

Integration usage

Successful event application, processed-event marking, and audit evidence share one EF SaveChanges call; broker acknowledgement is later.

Known limitations

The projection is a current period summary and depends on upstream delivery.

Requires confirmation

  • Late-change reconciliation and historical correction policy.
  • Freshness monitoring ownership.

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/Messaging/PayrollReadModelConsumer.cs
  • microservices/src/payroll-service/Backfill/LeaveSnapshotBackfill.cs

See Also

Keywords

  • Payroll database
  • Leave Projection Storage
  • Payroll persistence

Revision Information

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