| Total Complexity | 1 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { InjectRepository } from '@nestjs/typeorm'; |
||
| 5 | |||
| 6 | export class InterestRateRepository implements IInterestRateRepository { |
||
| 7 | constructor( |
||
| 8 | @InjectRepository(InterestRate) |
||
| 9 | private readonly repository: Repository<InterestRate> |
||
| 10 | ) {} |
||
| 11 | |||
| 12 | public findLatestInterestRate(): Promise<InterestRate> { |
||
| 13 | return this.repository |
||
| 14 | .createQueryBuilder('interestRate') |
||
| 15 | .select(['interestRate.id']) |
||
| 16 | .limit(1) |
||
| 17 | .orderBy('interestRate.createdAt', 'DESC') |
||
| 18 | .getOne(); |
||
| 21 |