57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
|
|
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||
|
|
import { EntityBase } from "./base/Base";
|
||
|
|
import { ProfileOther } from "./ProfileOther";
|
||
|
|
|
||
|
|
@Entity("profileOtherHistory")
|
||
|
|
export class ProfileOtherHistory extends EntityBase {
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
length: 40,
|
||
|
|
comment: "คีย์นอก(FK)ของตาราง Profile",
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
profileId: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
comment: "สถานะการใช้งาน",
|
||
|
|
default: false,
|
||
|
|
})
|
||
|
|
isActive: boolean;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "รายละเอียด",
|
||
|
|
type: "text",
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
detail: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
type: "datetime",
|
||
|
|
comment: "วันที่",
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
date: Date;
|
||
|
|
|
||
|
|
@ManyToOne(() => ProfileOther, (profileOther) => profileOther.profileOtherHistories)
|
||
|
|
@JoinColumn({ name: "profileId" })
|
||
|
|
histories: ProfileOther;
|
||
|
|
}
|
||
|
|
|
||
|
|
export class CreateProfileOtherHistory {
|
||
|
|
@Column("uuid")
|
||
|
|
profileId: string | null;
|
||
|
|
|
||
|
|
@Column()
|
||
|
|
isActive: boolean;
|
||
|
|
|
||
|
|
@Column()
|
||
|
|
detail: string | null;
|
||
|
|
|
||
|
|
@Column()
|
||
|
|
date: Date | null;
|
||
|
|
}
|
||
|
|
|
||
|
|
export type UpdateProfileOtherHistory = Partial<CreateProfileOtherHistory>;
|