Usage example
Uuid Value Object
import { Uuid } from '@nestjstools/domain-driven-starter';
const id = Uuid.generate();
const fromString = Uuid.fromString('f47ac10b-58cc-4372-a567-0e02b2c3d479');
console.log(id.toString());Why use Uuid as a Value Object?
const id: string = '...';2οΈβ£ DomainEvent Interface
Why Domain Events?
3οΈβ£ AggregateRoot<T extends DomainEvent>
Constructor Pattern
Methods
recordEvent(event: T): void
popRecordedEvents(): T[]
π§© Example: Order Aggregate
π Typical Usage Flow
π Where This Library Fits
π§ͺ Testing
Last updated
Was this helpful?