Total Complexity | 1 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import {Inject} from '@nestjs/common'; |
||
7 | |||
8 | export class IsDailyRateAlreadyExist { |
||
9 | constructor( |
||
10 | @Inject('IDailyRateRepository') |
||
11 | private readonly dailyRateRepository: IDailyRateRepository |
||
12 | ) {} |
||
13 | |||
14 | public async isSatisfiedBy( |
||
15 | user: User, |
||
16 | task: Task, |
||
17 | customer: Customer |
||
18 | ): Promise<boolean> { |
||
19 | return ( |
||
20 | (await this.dailyRateRepository.findOneByUserCustomerAndTask( |
||
21 | user, |
||
22 | customer, |
||
23 | task |
||
24 | )) instanceof DailyRate |
||
25 | ); |
||
28 |