add entity org part 1
This commit is contained in:
parent
0f7edf5d15
commit
f36ff656ef
13 changed files with 1783 additions and 1 deletions
103
src/entities/ProfileHonor.ts
Normal file
103
src/entities/ProfileHonor.ts
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Profile } from "./Profile";
|
||||
import { ProfileHonorHistory } from "./ProfileHonorHistory";
|
||||
|
||||
@Entity("profileHonor")
|
||||
export class ProfileHonor extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง Profile",
|
||||
default: null,
|
||||
})
|
||||
profileId: string;
|
||||
|
||||
@Column({
|
||||
comment: "สถานะการใช้งาน",
|
||||
default: false,
|
||||
})
|
||||
isActive: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 2000,
|
||||
comment: "รายละเอียด",
|
||||
default: null,
|
||||
})
|
||||
detail: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันที่ได้รับ",
|
||||
default: null,
|
||||
})
|
||||
issueDate: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 200,
|
||||
comment: "หน่วยงานที่ออก",
|
||||
default: null,
|
||||
})
|
||||
issuer: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "เอกสารอ้างอิง (ลงวันที่)",
|
||||
default: null,
|
||||
})
|
||||
refCommandDate: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
|
||||
type: "text",
|
||||
default: null,
|
||||
})
|
||||
refCommandNo: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเภทช่วงเวลาการศึกษา",
|
||||
default: null,
|
||||
})
|
||||
isDate: boolean;
|
||||
|
||||
@OneToMany(() => ProfileHonorHistory, (profileHonorHistory) => profileHonorHistory.histories)
|
||||
profileHonorHistories: ProfileHonorHistory[];
|
||||
|
||||
@ManyToOne(() => Profile, (profile) => profile.profileHonors)
|
||||
@JoinColumn({ name: "profileId" })
|
||||
profile: Profile;
|
||||
}
|
||||
|
||||
export class CreateProfileHonor {
|
||||
@Column("uuid")
|
||||
profileId: string | null;
|
||||
|
||||
@Column()
|
||||
isActive: boolean;
|
||||
|
||||
@Column()
|
||||
detail: string | null;
|
||||
|
||||
@Column()
|
||||
issueDate: Date | null;
|
||||
|
||||
@Column()
|
||||
issuer: string | null;
|
||||
|
||||
@Column()
|
||||
refCommandDate: Date | null;
|
||||
|
||||
@Column()
|
||||
refCommandNo: string | null;
|
||||
|
||||
@Column()
|
||||
isDate: boolean | null;
|
||||
}
|
||||
|
||||
export type UpdateProfileHonor = Partial<CreateProfileHonor>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue