chore: create legal and real user data info

This commit is contained in:
Matin
2025-02-17 15:43:12 +03:30
parent 14373bb665
commit 8b8ddb693e
18 changed files with 390 additions and 20 deletions
@@ -2,22 +2,30 @@ import { Column, Entity, JoinColumn, OneToOne, Unique } from "typeorm";
import { User } from "./user.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
import { Address } from "../../address/entities/address.entity";
@Unique(["user"])
@Entity()
export class LegalUser extends BaseEntity {
@Column({ nullable: true })
@Column({ type: "varchar", length: 50, nullable: true })
economicCode: string;
@Column({ nullable: true })
@Column({ type: "varchar", length: 50, nullable: true })
registrationId: string;
@Column({ nullable: true })
@Column({ type: "varchar", length: 100, nullable: true })
companyRegisteredName: string;
@Column({ type: "varchar", length: 20, nullable: true })
nationalId: string;
@Column({ nullable: true })
@Column({ type: "varchar", length: 20, nullable: true })
number: string;
@OneToOne(() => Address, { nullable: false, cascade: true })
@JoinColumn()
address: Address;
@OneToOne(() => User, (user) => user.legalUser, { onDelete: "CASCADE" })
@JoinColumn()
user: User;