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?