import { IQueryHandler , QueryHandler } from '@nestjs/cqrs' ; import { InjectRepository } from '@nestjs/typeorm' ; import { Repository } from 'typeorm' ; import { CertificationRequest } from '../certification-request.entity' ; import { GetCertificationRequestQuery } from '../queries' ; import { CertificationRequestDTO } from '../certification-request.dto' ; @ QueryHandler ( GetCertificationRequestQuery ) export class GetCertificationRequestHandler implements IQueryHandler < GetCertificationRequestQuery > { constructor ( @ InjectRepository ( CertificationRequest ) readonly repository ) { } async execute ( { id } ) { return this . repository . findOne ( id ) ; } }