Skip to main content

Employee Lifecycle Events

Summary

Four contracts describe core Employee lifecycle or projection changes. Their existence and mappings are confirmed, but publication depends on the unresolved Employee relay invocation.

Audience

  • Developers, QA engineers, architects, and product owners

Reference Content

Employee created

Employee.Create assigns initial state, records an initial timeline entry, and raises EmployeeCreatedDomainEvent. On save, it maps to EmployeeCreated with a version-one employee projection. Platform, Leave, Payroll, Document, Notification, and Integration code reference this event type.

Employee updated

Core-detail updates raise EmployeeUpdatedDomainEvent. A status change also raises this event after the dedicated status event. Manager-only and department-only changes do not directly raise it. Platform, Leave, Payroll, Document, and Integration code reference the integration event.

Employment status changed

ChangeStatus does nothing when the value is unchanged. Otherwise it updates status and active state, appends a timeline entry, and raises EmploymentStatusChangedDomainEvent followed by EmployeeUpdatedDomainEvent. Leave, Payroll, and Document consumers subscribe to the status event.

Employee deleted

MarkDeleted implements a soft-delete transition, appends a termination timeline entry, and raises EmployeeDeletedDomainEvent. The mapping exists, but no public Employee operation calling MarkDeleted and no downstream consumer were confirmed. Runtime availability is Requires confirmation.

Lifecycle sequence implications

Multiple events from one status operation are added to the outbox in aggregate event-list order. No globally enforced cross-message transaction at consumers is shown. Consumers must treat the dedicated status event and projection update as independent deliveries.

Source References

  • microservices/src/employee-service/Domain/Employees/Employee.cs
  • microservices/src/employee-service/Infrastructure/EmployeeDbContext.cs
  • microservices/src/platform-service/Messaging/PlatformEventConsumer.cs
  • microservices/src/leave-service/Messaging/EmployeeProfileConsumer.cs
  • microservices/src/payroll-service/Messaging/PayrollReadModelConsumer.cs
  • microservices/src/document-service/Messaging/DocumentReadModelConsumer.cs
  • microservices/src/notification-service/Application/EventNotificationResolver.cs
  • microservices/src/integration-service/Domain/IntegrationEntities.cs

See Also

Keywords

  • Employee lifecycle
  • Status event
  • Projection update

Revision Information

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