import { EventsHandler , IEventHandler } from '@nestjs/cqrs' ; import { LoggerService } from '@fc/logger' ; import { ServiceProviderUpdateEvent } from '../events/service-provider-update.event' ; import { ServiceProviderAdapterMongoService } from '../service-provider-adapter-mongo.service' ; @ EventsHandler ( ServiceProviderUpdateEvent ) export class ServiceProviderUpdateHandler implements IEventHandler < ServiceProviderUpdateEvent > { constructor ( private readonly logger , private readonly providerService ) { this . logger . setContext ( this . constructor . name ) ; } public async handle ( ) { this . logger . trace ( { action : 'handled' } ) ; this . providerService . getList ( true ) ; } }