Completed
Push — master ( 927bea...d35268 )
by Mathieu
22s queued 11s
created

CooperativeRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A find 0 8 1
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