chore: user financial
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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.userFinancials)
|
||||
user: User;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { Exclude } from "class-transformer";
|
||||
import { Column, Entity, ManyToMany, ManyToOne, OneToMany, OneToOne } from "typeorm";
|
||||
|
||||
import { Role } from "./role.entity";
|
||||
import { UserFinancial } from "./user-financial.entity";
|
||||
import { UserGroup } from "./user-group.entity";
|
||||
import { BaseEntity } from "../../../common/entities/base.entity";
|
||||
import { UserAnnouncement } from "../../announcements/entities/user-announcement.entity";
|
||||
@@ -82,6 +83,9 @@ export class User extends BaseEntity {
|
||||
|
||||
@OneToMany(() => LearningProgress, (learningProgress) => learningProgress.learning)
|
||||
learningProgress: LearningProgress[];
|
||||
|
||||
@OneToMany(() => UserFinancial, (userFinancial) => userFinancial.user)
|
||||
userFinancials: UserFinancial[];
|
||||
}
|
||||
|
||||
// @ManyToMany(() => DanakService, (danakService) => danakService.users)
|
||||
|
||||
Reference in New Issue
Block a user