Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 37 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {Entity, Column, PrimaryGeneratedColumn, ManyToOne} from 'typeorm'; |
||
2 | import {Customer} from '../Customer/Customer.entity'; |
||
3 | import {User} from '../User/User.entity'; |
||
4 | import {Task} from '../Task/Task.entity'; |
||
5 | |||
6 | @Entity() |
||
7 | export class DailyRate { |
||
8 | @PrimaryGeneratedColumn('uuid') |
||
9 | private id: string; |
||
10 | |||
11 | @Column({type: 'integer', nullable: false}) |
||
12 | private amount: number; |
||
13 | |||
14 | @Column({type: 'timestamp', default: () => 'CURRENT_TIMESTAMP'}) |
||
15 | private createdAt: Date; |
||
16 | |||
17 | @ManyToOne(type => User, {nullable: false}) |
||
18 | private user: User; |
||
19 | |||
20 | @ManyToOne(type => Customer, {nullable: false}) |
||
21 | private customer: Customer; |
||
22 | |||
23 | @ManyToOne(type => Task, {nullable: false}) |
||
24 | private task: Task; |
||
25 | |||
26 | constructor(amount: number, user: User, customer: Customer, task: Task) { |
||
27 | this.amount = amount; |
||
28 | this.user = user; |
||
29 | this.customer = customer; |
||
30 | this.task = task; |
||
31 | } |
||
32 | |||
33 | public getId(): string { |
||
34 | return this.id; |
||
35 | } |
||
36 | } |
||
37 |