Skip to main content

Expense Domain Events

Summary

The Expense aggregate raises exactly three domain-event types, all on terminal lifecycle transitions. Claim creation, receipt operations, workflow start, and deletion do not raise domain events.

Audience

Expense and integration developers, QA engineers, architects, and maintainers reviewing aggregate behavior.

Reference Content

Confirmed domain events

Domain eventRaised by aggregate transitionImmediate purpose
ExpenseApprovedDomainEventPending to ApprovedCarries the approved outcome to infrastructure mapping
ExpenseRejectedDomainEventPending to RejectedCarries the rejected outcome to infrastructure mapping
ExpensePaidDomainEventApproved to PaidCarries the paid outcome to infrastructure mapping

The shared Expense domain-event base assigns a domain event identity and occurrence time. Aggregate methods enforce lifecycle validation before raising an event. Events remain attached to the aggregate until SaveChanges dispatches them to integration mapping and clears them.

Not implemented

  • ExpenseClaimCreatedDomainEvent
  • ExpenseClaimDeletedDomainEvent
  • ReceiptAddedDomainEvent or ReceiptRemovedDomainEvent
  • WorkflowStartedDomainEvent
  • Domain-event handlers independent of the SaveChanges mapping path

Requires confirmation

Future non-terminal domain events, handler extensibility, and domain-event observability require confirmation.

Source References

  • microservices/src/expense-service/Domain/Expense/ExpenseDomainEvents.cs
  • microservices/src/expense-service/Domain/Expense/ExpenseClaim.cs

See Also

Keywords

  • Expense events
  • Domain Events
  • Integration contracts

Revision Information

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