import { CommandHandler , ICommandHandler } from '@nestjs/cqrs' ; import { CancelOrderCommand } from '../../order/commands/cancel-order.command' ; import { MatchingEngineService } from '../matching-engine.service' ; @ CommandHandler ( CancelOrderCommand ) export class CancelOrderHandler < TProduct , TProductFilter > implements ICommandHandler < CancelOrderCommand > { constructor ( private readonly matchingEngineService ) { } async execute ( command ) { this . matchingEngineService . cancel ( command . orderId ) ; } }