import { Inject } from '@nestjs/common' ; import { IProjectRepository } from 'src/Domain/Project/Repository/IProjectRepository' ; import { Project } from 'src/Domain/Project/Project.entity' ; export class IsProjectAlreadyExist { constructor ( @ Inject ( 'IProjectRepository' ) private readonly projectRepository ) { } public async isSatisfiedBy ( name ) { return ( ( await this . projectRepository . findOneByName ( name ) ) instanceof Project ) ; } }