Skip to main content

Attendance Projection Storage

Summary

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

Ownership

Payroll owns the projection; Attendance remains the upstream source of attendance facts.

Lifecycle

Inbound events or backfill create/update one tenant/employee/period snapshot. Last-event identity and occurrence time support duplicate/stale update handling.

Persisted fields

The projection contains tenant/employee/period identity, day and hour outcome summaries, a structured breakdown, event-version markers, and update time.

Relationships

It logically supplies PayrollRunDetail calculation inputs but has no foreign key to an employee, period, run, or detail.

Constraints

A unique tenant/employee/year/month index enforces one projection record per period.

Indexes

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

Tenant behavior

The global filter applies to normal reads. Consumer and backfill logic use explicit tenant scope when filters are bypassed.

Audit behavior

Inbound synchronization and backfill completion create Payroll audit evidence; field-level projection history is not retained.

Integration usage

The consumer commits a synced projection, its processed-event marker, and audit evidence in one SaveChanges call. Broker acknowledgement follows that commit.

Known limitations

Freshness depends on event/backfill processing. The snapshot does not preserve a full source history.

Requires confirmation

  • Reconciliation SLA and response to missing or late attendance events.
  • Retention of superseded attendance evidence in the upstream system.

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/AttendanceSnapshotBackfill.cs

See Also

Keywords

  • Payroll database
  • Attendance Projection Storage
  • Payroll persistence

Revision Information

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