-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome-loan.entity.ts
86 lines (66 loc) · 1.75 KB
/
home-loan.entity.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { Customer } from 'src/modules/customer/entities/customer.entity';
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
ManyToOne,
} from 'typeorm';
import { StatusHomeLoan } from '../enums/home-loan.enum';
@Entity()
export class HomeLoan {
@PrimaryGeneratedColumn('uuid')
id: string;
@ManyToOne(() => Customer, (customer) => customer.homeLoans)
customer: Customer;
@Column({ nullable: true })
propertyUsage: string;
@Column({ nullable: true })
typeHome: string;
@Column({ nullable: true })
address: string;
@Column({ nullable: true })
state: string;
@Column({ nullable: true })
city: string;
@Column({ nullable: true })
town: string;
@Column({ type: 'numeric', nullable: true })
priceHome: number;
@Column({ nullable: true })
paymentInitial: string;
@Column({ type: 'numeric', nullable: true })
monthlyIncome: number;
@Column({ type: 'numeric', nullable: true })
monthlyDebt: number;
@Column('text', { array: true, nullable: true })
assets: string[];
@Column({ type: 'numeric', nullable: true })
assetsAmount: number;
@Column({ type: 'boolean', nullable: true })
tc: boolean;
@Column({
type: 'enum',
enum: StatusHomeLoan,
default: StatusHomeLoan.PROPERTY_USAGE,
nullable: true,
})
status: StatusHomeLoan;
@Column({ type: 'boolean', default: true, nullable: true })
isActive: boolean;
@Column({ type: 'boolean', default: false, nullable: true })
isDeleted: boolean;
@CreateDateColumn({
type: 'timestamptz',
default: () => 'CURRENT_TIMESTAMP',
nullable: true,
})
createdAt?: Date;
@UpdateDateColumn({
type: 'timestamptz',
default: () => 'CURRENT_TIMESTAMP',
nullable: true,
})
updatedAt?: Date;
}