Skip to content
From 0.5.0 the packages continue as @cqrs-ddd, documented at aristoteliss.github.io/ddd-cqrs; NestJS applications add @cqrs-ddd/nestjs. This site documents the 0.4.x line.

ApplyMutationOptions

Defined in: packages/ddd-core/domain/decorators/apply-mutation.decorator.ts:28

Configuration for a declarative aggregate mutation and domain event application.

TEntity

The aggregate the decorated method belongs to.

readonly event: (entity) => NonEmptyEventArray | SingleEvent

Defined in: packages/ddd-core/domain/decorators/apply-mutation.decorator.ts:37

Factory for the domain event(s) recorded once the mutation has completed. It receives the aggregate after the patch, onUpdate() and the version/timestamp advance, ensuring event payload and metadata snapshot the post-mutation version and updatedAt.

Must return a single domain event object or a non-empty array of domain events.

TEntity

NonEmptyEventArray | SingleEvent