22 lines
423 B
TypeScript
22 lines
423 B
TypeScript
|
|
/**
|
||
|
|
* 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>;
|
||
|
|
}
|
||
|
|
|
||
|
|
|