Leave Event Overview
Summary
Domain events are in-process aggregate facts; integration events are shared cross-service contracts created during persistence and delivered through the outbox.
Audience
Developers, QA, architects, downstream service owners, and support engineers.
Overview
LeaveRequested, approved, rejected, cancelled, balance-updated, and encashed domain types each have one shared integration contract. Mapping assigns schema version 1 and public contract context. Domain-event identity is not reused as integration-event identity; a new integration event ID is created. New aggregates can therefore map a database-generated identifier before assignment, and consumers must follow the contract’s business identity guidance.
The Leave mapping supplies numeric tenant/employee/user references in contract-specific data because the shared envelope uses different cross-service identity types. Correlation is populated; causation and some shared envelope identity fields are not populated by this mapping. Downstream processing is eventually consistent and consumer-owned.
Source References
- microservices/src/leave-service/Domain/Leave/LeaveDomainEvents.cs
- microservices/src/contracts/Events/IntegrationEvent.cs
- microservices/src/contracts/Events/LeaveLifecycleEvents.cs
- microservices/src/leave-service/Infrastructure/LeaveDbContext.cs
- microservices/src/leave-service/Messaging/OutboxRelayHostedService.cs
Related Articles
See Also
Keywords
- Domain event
- Integration event
- Event architecture
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly