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.

MutableOptions

Defined in: packages/ddd-core/domain/decorators/mutable.decorator.ts:8

Registration options for a mutable aggregate field.

TValue = unknown

The value type stored in the backing property.

readonly optional as?: string

Defined in: packages/ddd-core/domain/decorators/mutable.decorator.ts:14

Public patch key a domain method uses for this field. Defaults to the decorated property name with a single leading underscore removed (_username becomes username).


readonly optional normalize?: (value) => TValue

Defined in: packages/ddd-core/domain/decorators/mutable.decorator.ts:22

Invariant check and coercion applied before the value reaches the backing property. Throw a domain exception here to reject the mutation; the aggregate is then left untouched, no version is advanced and no event is recorded.

TValue

TValue