import { CommandHandler , ICommandHandler } from '@nestjs/cqrs' ; import { NotificationService } from '../../notification.service' ; import { NotificationsDeleteCommand } from '../notifications-delete.command' ; @ CommandHandler ( NotificationsDeleteCommand ) export class NotificationsDeleteHandler implements ICommandHandler < NotificationsDeleteCommand > { constructor ( private readonly notificationService ) { } public async execute ( command ) { console . log ( 'command:DeleteNotificationCommand' , command ) ; await this . notificationService . onDeleteNotification ( command ) ; } }