Skip to main content

Leave Decision Events

Summary

Valid approval, rejection, and cancellation transitions raise exact decision events; direct and Workflow callback paths converge on the same aggregate methods.

Audience

Developers, QA, architects, Payroll/Notification/Workflow owners, and support.

Concept

Payroll consumes all three decision contracts. Notification consumes approval and rejection only. Approval rechecks Attendance before mutation. Workflow-managed direct approve/reject is blocked; a valid callback raises the ordinary decision event. Duplicate callbacks against a terminal request are acknowledged without reapplying a domain decision event.

Request decision state, audit/timeline, and its decision outbox message share one save. Balance application/reversal and LeaveBalanceUpdated use a later save, so cross-event atomicity and ordering are not guaranteed. Invalid states, missing rejection reason, conflict checks, and Workflow verification mismatch raise no decision event.

Source References

  • microservices/src/leave-service/Domain/Leave/LeaveRequest.cs
  • microservices/src/leave-service/Application/LeaveWorkflows.cs
  • microservices/src/leave-service/Infrastructure/LeaveDbContext.cs
  • microservices/src/payroll-service/Messaging/PayrollReadModelConsumer.cs
  • microservices/src/notification-service/Application/EventNotificationResolver.cs

See Also

Keywords

  • LeaveApproved
  • LeaveRejected
  • LeaveCancelled

Revision Information

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