import {CommandHandler, ICommandHandler} from "@nestjs/cqrs";
import {BeginVersusCommand} from "../commands/begin-versus.command";
import {VersusService} from "../versus/versus.service";

@CommandHandler(BeginVersusCommand)
export class BeginVersusCommandHandler implements ICommandHandler<BeginVersusCommand> {
  constructor(private versusService:VersusService) {
  }
    execute(command: BeginVersusCommand): Promise<any> {
        return this.versusService.beginVersus(command.sourceId,command.destinationId);
    }

}