changeName [notTest]

This commit is contained in:
AdisakKanthawilang 2024-03-19 17:52:36 +07:00
parent 9c7072c128
commit 25734e3f2d
3 changed files with 371 additions and 0 deletions

View file

@ -0,0 +1,99 @@
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileChangeNameHistory } from "./ProfileChangeNameHistory";
// import { ProfileChangeNameHistory } from "./ProfileChangeNameHistory";
@Entity("profileChangeName")
export class ProfileChangeName extends EntityBase {
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง Profile",
default: null,
})
profileId: string;
@Column({
comment: "สถานะการใช้งาน",
default: false,
})
isActive: boolean;
@Column({
nullable: true,
length: 40,
comment: "Id คำนำหน้า",
default: null,
})
prefixId: string;
@Column({
nullable: true,
length: 40,
comment: "คำนำหน้า",
default: null,
})
prefix: string;
@Column({
nullable: true,
length: 100,
comment: "ชื่อ",
default: null,
})
firstName: string;
@Column({
nullable: true,
length: 100,
comment: "นามสกุล",
default: null,
})
lastName: string;
@Column({
nullable: true,
length: 100,
comment: "สถานะ",
default: null,
})
status: string;
@Column({
nullable: true,
length: 40,
comment: "",
default: null,
})
documentId: string;
@OneToMany(() => ProfileChangeNameHistory, (profileChangeNameHistory) => profileChangeNameHistory.histories)
profileChangeNameHistories: ProfileChangeNameHistory[];
// @ManyToOne(() => Profile, (profile) => profile.profileChangeName)
// @JoinColumn({ name: "profileId" })
// profile: Profile;
}
export class CreateProfileChangeName {
profileId: string | null;
isActive: boolean;
prefixId: string | null;
prefix: string | null;
firstName: string | null;
lastName: string | null;
status: string | null;
documentId: string | null;
}
export type UpdateProfileChangeName = {
profileId?: string | null;
isActive?: boolean;
prefixId?: string | null;
prefix?: string | null;
firstName?: string | null;
lastName?: string | null;
status?: string | null;
documentId?: string | null;
};