Type alias Aggregate<S, C, E>

Aggregate<S, C, E>: Streamable & Reducible<S, E> & {
    given?: {
        [K in keyof C]?: Invariant<S>[]
    };
    on: {
        [K in keyof C]: CommandHandler<S, C, E, K>
    };
    schemas: AggregateSchemas<S, C, E>;
}

Aggregates handle commands and produce committed events while holding an internal reducible state. Aggregates enforce a consistency boundaries around business models.

  • schemas for message validation and documentation
  • given? array of invariant handlers
  • on command handlers

Type Parameters

Type declaration

Generated using TypeDoc