chore: create legal and real user data info
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user