Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 24 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Injectable } from '@nestjs/common'; |
||
2 | import { InjectRepository } from '@nestjs/typeorm'; |
||
3 | import { Repository } from 'typeorm'; |
||
4 | import { ICooperativeRepository } from 'src/Domain/Settings/Repository/ICooperativeRepository'; |
||
5 | import { Cooperative } from 'src/Domain/Settings/Cooperative.entity'; |
||
6 | |||
7 | @Injectable() |
||
8 | export class CooperativeRepository implements ICooperativeRepository { |
||
9 | constructor( |
||
10 | @InjectRepository(Cooperative) |
||
11 | private readonly repository: Repository<Cooperative> |
||
12 | ) {} |
||
13 | |||
14 | public find(): Promise<Cooperative> { |
||
15 | return this.repository |
||
16 | .createQueryBuilder('cooperative') |
||
17 | .select([ |
||
18 | 'cooperative.dayDuration' |
||
19 | ]) |
||
20 | .limit(1) |
||
21 | .getOne(); |
||
22 | } |
||
23 | } |
||
24 |