import { Inject } from '@nestjs/common' ; import { User } from 'src/Domain/HumanResource/User/User.entity' ; import { IMealTicketRemovalRepository } from '../Repository/IMealTicketRemovalRepository' ; import { MealTicketRemoval } from '../MealTicketRemoval.entity' ; export class IsMealTicketRemovalAlreadyExist { constructor ( @ Inject ( 'IMealTicketRemovalRepository' ) private readonly mealTicketRemovalRepository ) { } public async isSatisfiedBy ( user , date ) { return ( ( await this . mealTicketRemovalRepository . findOneByUserAndDate ( user , date ) ) instanceof MealTicketRemoval ) ; } }