import DomainEvent from "../DomainEvent"; import DomainProjection from "../DomainProjection"; export type UpdateDefinition = { id: string; newVersion: string; }; export default class ApplicationUpdates implements DomainProjection { private readonly pendingUpdates: UpdateDefinition[] = []; handle(event: DomainEvent): void { if (event.type === "ApplicationUpdateStarted") { this.pendingUpdates.push(event.payload); } } getPendingUpdates(): UpdateDefinition[] { return this.pendingUpdates; } }