Skip to main content

Leave Request Storage

Summary

LeaveRequests stores the LeaveRequest aggregate, its tenant/employee reference, calculated units, lifecycle state, decision metadata, timestamps, and optional Workflow correlation.

Audience

Backend developers, QA engineers, architects, and support engineers.

Reference Content

Storage areaConfirmed fields or behaviorEnforcementSource
Identity/scopeInteger identity, tenant identifier, labor referencePrimary key and tenant filtermicroservices/src/leave-service/Infrastructure/LeaveDbContext.cs
Request termsType, calculated days, date range, optional reasonRequired/length/precision mapping; calculation is application/domain behaviormicroservices/src/leave-service/Domain/Leave/LeaveRequest.cs
LifecycleStatus, rejection reason, approver, approval timeState transitions are domain-enforced, not database checksmicroservices/src/leave-service/Domain/Leave/LeaveRequest.cs
Creation/changeCreator, created time, updated timePersisted columnsmicroservices/src/leave-service/Infrastructure/Migrations/LeaveDbContextModelSnapshot.cs
WorkflowOptional workflow instance identifierNon-unique index; no Workflow FKmicroservices/src/leave-service/Infrastructure/LeaveDbContext.cs

The diagram shows logical relationships only: the current migration snapshot defines no foreign keys. Indexes support tenant/employee/from-date, tenant/status, and Workflow lookup. There is no database uniqueness constraint preventing overlapping requests; approved-overlap detection is an application query. Cancellation changes status rather than deleting through the extracted command, and approval/cancellation balance effects are saved in a later unit-of-work call, so request state and balance state are not one atomic database transaction.

Source References

  • microservices/src/leave-service/Domain/Leave/LeaveRequest.cs
  • microservices/src/leave-service/Infrastructure/LeaveDbContext.cs
  • microservices/src/leave-service/Infrastructure/Migrations/LeaveDbContextModelSnapshot.cs
  • microservices/src/leave-service/Application/LeaveWorkflows.cs

See Also

Keywords

  • LeaveRequest
  • Workflow correlation
  • Lifecycle persistence

Revision Information

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