Files
dsc-api/src/modules/users/entities/user-financial.entity.ts
T
2025-02-26 20:15:16 +03:30

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;
}