import { NotificationService } from '../../notification.service' ; import { NotificationsMarkAllAsReadCommand } from '../notifications-make-all-as-read.command' ; import { CommandHandler , ICommandHandler } from '@nestjs/cqrs' ; @ CommandHandler ( NotificationsMarkAllAsReadCommand ) export class NotificationsMarkAsReadHandler implements ICommandHandler < NotificationsMarkAllAsReadCommand > { constructor ( private readonly notificationService ) { } public async execute ( command ) { console . log ( 'command:NotificationsMarkAllAsReadCommand' , command ) ; await this . notificationService . onMarkAllAsRead ( command ) ; } }