Class AggregateRoot<Projection>Abstract

Base class to provide Aggregate functionality

Type Parameters

  • Projection = Record<string, unknown>

Hierarchy

  • AggregateRoot

Constructors

Properties

_cacheController: ICache
_commitFn: ((events: IEvent<unknown>[]) => Promise<IEvent<unknown>[]>)

Type declaration

    • (events: IEvent<unknown>[]): Promise<IEvent<unknown>[]>
    • Parameters

      Returns Promise<IEvent<unknown>[]>

_eventHistory: IEvent<unknown>[]

History of all events applied to this aggregate in order

_lastCommittedIndex: number
deleted: boolean

Mark the instance as deleted

streamId: string
updatedAt: Date

Timestamp of the last applied event

Accessors

Methods

  • Release a value previously reserved

    Type Parameters

    • T = unknown

    Parameters

    • propertyName: string
    • value: T

    Returns Promise<boolean>

  • Reserve a value to ensure uniqueness

    Type Parameters

    • T = unknown

    Parameters

    • propertyName: string
    • value: T

    Returns Promise<boolean>

Generated using TypeDoc