add entity org part 2

This commit is contained in:
AdisakKanthawilang 2024-03-13 10:43:50 +07:00
parent 8717494690
commit d5e79acb82
11 changed files with 1442 additions and 1 deletions

View file

@ -0,0 +1,94 @@
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileNopaid } from "./ProfileNopaid";
@Entity("profileNopaidHistory")
export class ProfileNopaidHistory extends EntityBase {
@Column({
comment: "สถานะการใช้งาน",
default: false,
})
isActive: boolean;
@Column({
nullable: true,
type: "datetime",
comment: "วัน เดือน ปี",
default: null,
})
date: Date;
@Column({
nullable: true,
comment: "รายละเอียด",
type: "text",
default: null,
})
detail: string;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง",
type: "text",
default: null,
})
reference: string;
@Column({
nullable: true,
type: "datetime",
comment: "เอกสารอ้างอิง (ลงวันที่)",
default: null,
})
refCommandDate: Date;
@Column({
nullable: true,
comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)",
type: "text",
default: null,
})
refCommandNo: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง ProfileNopaid",
default: null,
})
profileNopaidId: string;
@ManyToOne(() => ProfileNopaid, (profileNopaid) => profileNopaid.profileNopaidHistories)
@JoinColumn({ name: "profileNopaidId" })
histories: ProfileNopaid;
}
export class CreateProfileNopaidHistory {
@Column()
isActive: boolean;
@Column()
date: Date | null;
@Column()
detail: string | null;
@Column()
reference: string | null;
@Column()
refCommandDate: Date | null;
@Column()
refCommandNo: string | null;
@Column("uuid")
profileNopaidId: string | null;
}
export type UpdateProfileNopaidHistory = Partial<CreateProfileNopaidHistory>;