28 lines
671 B
TypeScript
Executable File
28 lines
671 B
TypeScript
Executable File
import { Column, Entity, ManyToOne, Unique } from "typeorm";
|
|
|
|
import { User } from "./user.entity";
|
|
import { BaseEntity } from "../../../common/entities/base.entity";
|
|
import { FinancialType } from "../enums/financial-type.enum";
|
|
|
|
@Unique(["user", "type"])
|
|
@Entity()
|
|
export class UserFinancial extends BaseEntity {
|
|
@Column({ type: "enum", enum: FinancialType, default: FinancialType.REAL })
|
|
type: FinancialType;
|
|
|
|
@Column({ nullable: true })
|
|
economicCode: string;
|
|
|
|
@Column({ nullable: true })
|
|
registrationId: string;
|
|
|
|
@Column({ nullable: true })
|
|
nationalId: string;
|
|
|
|
@Column({ nullable: true })
|
|
number: string;
|
|
|
|
@ManyToOne(() => User)
|
|
user: User;
|
|
}
|