Completed
Push — master ( 725f7d...ca7f33 )
by
unknown
22s queued 15s
created

UserAdministrativeFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A entity 0 13 1
1
import { Factory } from '@concepta/typeorm-seeding';
2
import { faker } from '@faker-js/faker';
3
import {
4
  UserAdministrative,
5
  ContractType,
6
  WorkingTimeType
7
} from 'src/Domain/HumanResource/User/UserAdministrative.entity';
8
9
import { DateUtilsAdapter } from 'src/Infrastructure/Adapter/DateUtilsAdapter';
10
const dateUtils: DateUtilsAdapter = new DateUtilsAdapter();
11
12
export class UserAdministrativeFactory extends Factory<UserAdministrative> {
13
  protected async entity(): Promise<UserAdministrative> {
14
    const userAdministrative = new UserAdministrative(
15
      faker.datatype.number({ min: 40, max: 53 }) * 1000 * 100,
16
      true,
17
      true,
18
      ContractType.CDI,
19
      WorkingTimeType.FULL_TIME,
20
      dateUtils.format(faker.date.past(), 'y-MM-dd'),
21
      null,
22
      700 * 100
23
    );
24
25
    return userAdministrative;
26
  }
27
}
28