import {IQueryHandler, QueryHandler} from "@nestjs/cqrs";
import {GetGuestQuery} from "../getguest.query";
import {GuestsService} from "../../guests.service";

@QueryHandler(GetGuestQuery)
export class GetGuestQueryHandler implements IQueryHandler<GetGuestQuery> {
  constructor(private guestService: GuestsService) {
  }
  execute(query: GetGuestQuery): Promise<any> {
    return this.guestService.findById(query.user);
  }

}