import { QueryHandler } from '@nestjs/cqrs'; import { UsersRepository } from '../../adapters/secondaries/users.repository'; import { FindUserByUuidQuery } from '../../queries/find-user-by-uuid.query'; import { User } from '../entities/user'; @QueryHandler(FindUserByUuidQuery) export class FindUserByUuidUseCase { constructor(private readonly _usersRepository: UsersRepository) {} async execute(findUserByUuid: FindUserByUuidQuery): Promise { return this._usersRepository.findOneByUuid(findUserByUuid.uuid); } }