Files

24 lines
457 B
TypeScript
Raw Permalink 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,
headers?: object & {
message_id?: string
},
occurredOn?: Date,
}
export interface DomainEventSubscriber<T extends DomainEvent> {
subscribedTo(): DomainEventType[];
getEventNames(): string[];
on(domainEvent: T): Promise<void>;
}