MCPcopy Create free account
hub / github.com/argentinaluiz/eda / onModuleInit

Method onModuleInit

apps/orders/src/orders/orders.module.ts:43–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 ) {}
42
43 onModuleInit() {
44 this.domainEventManager.register(
45 InvoicePayedEvent.name,
46 async (event: InvoicePayedEvent) => {
47 const handler: ApproveOrderHandler = await this.moduleRef.resolve(
48 ApproveOrderHandler,
49 );
50 await handler.handle(event);
51 },
52 );
53 this.domainEventManager.registerForIntegrationEvent(
54 OrderApprovedEvent.name,
55 async (event) => {
56 console.log('integration events');
57 const integrationEvent = new OrderApprovedIntegrationEvent(event);
58 await this.integrationEventsQueue.addToQueue(integrationEvent);
59 },
60 );
61 }
62}

Callers

nothing calls this directly

Calls 4

registerMethod · 0.80
addToQueueMethod · 0.80
handleMethod · 0.65

Tested by

no test coverage detected