Files
sf-sim/packages/shared/domain/DomainEvent.ts

22 lines
423 B
TypeScript
Raw Normal View History

/**
* Los eventos de dominion estan orientados a la cola AMQ
*
*/
// Completar con los tipos de evento
export type DomainEventType = string
export type DomainEvent = {
key: string,
payload: Object,
options: Object,
occurredOn: Date,
}
export interface DomainEventSubscriber<T extends DomainEvent> {
subscribedTo(): DomainEventType[];
getEventNames(): string[];
on(domainEvent: T): Promise<void>;
}