Closed sam-goodwin closed 3 years ago
Closes #35 Closes #34
This change consolidates the definition of Shapes and DomainEvents.
export class FlightSchedule extends Shape("ScheduledFlightAdded", { flightNo: string(), aircraftType: string(), origin: string(), destination: string(), days: map(string(), object({ scheduledDeparture: date(), scheduledArrival: date() })), }) {} export class ScheduledFlightAdded extends DomainEvent("ScheduledFlightAdded", { flightNo: string(), add: object({ day: string(), scheduledDeparture: date(), scheduledArrival: date(), }), }) {}
Except that DomainEvent has kind: "DomainEvent" and is a first-class Component.
DomainEvent
kind: "DomainEvent"
DomainEventEnvelope
const flightCreated = new DomainEventEnvelope({ id: "1sC26Tx3VUi42mghcNopBYsRxD9", time: new Date("2021-05-07T04:34:35.302Z"), source: "FlightScheduleAggregate", source_id: "PA576", payload: new FlightCreatedEvent({ flightNo: "PA576", aircraftType: "B787-9", origin: "SFO", destination: "MIA", }), });
Closes #35 Closes #34
This change consolidates the definition of Shapes and DomainEvents.
Except that
DomainEvent
haskind: "DomainEvent"
and is a first-class Component.DomainEventEnvelope
from theDomainEvent
itself.