checkpoint
This commit is contained in:
parent
0c8abe053f
commit
8b2c20ec57
3 changed files with 211 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import { ProfileInsignia } from "./ProfileInsignia";
|
||||||
import { ProfileHonor } from "./ProfileHonor";
|
import { ProfileHonor } from "./ProfileHonor";
|
||||||
import { ProfileAssessment } from "./ProfileAssessment";
|
import { ProfileAssessment } from "./ProfileAssessment";
|
||||||
import { ProfileLeave } from "./ProfileLeave";
|
import { ProfileLeave } from "./ProfileLeave";
|
||||||
|
import { ProfileAbility } from "./ProfileAbility";
|
||||||
|
|
||||||
@Entity("profile")
|
@Entity("profile")
|
||||||
export class Profile extends EntityBase {
|
export class Profile extends EntityBase {
|
||||||
|
|
@ -165,6 +166,9 @@ export class Profile extends EntityBase {
|
||||||
@OneToMany(() => ProfileLeave, (profileLeave) => profileLeave.profile)
|
@OneToMany(() => ProfileLeave, (profileLeave) => profileLeave.profile)
|
||||||
profileLeaves: ProfileLeave[];
|
profileLeaves: ProfileLeave[];
|
||||||
|
|
||||||
|
@OneToMany(() => ProfileAbility, (profileAbility) => profileAbility.profile)
|
||||||
|
profileAbilities: ProfileAbility[];
|
||||||
|
|
||||||
@ManyToOne(() => PosLevel, (posLevel) => posLevel.posLevels)
|
@ManyToOne(() => PosLevel, (posLevel) => posLevel.posLevels)
|
||||||
@JoinColumn({ name: "posLevelId" })
|
@JoinColumn({ name: "posLevelId" })
|
||||||
posLevel: PosLevel;
|
posLevel: PosLevel;
|
||||||
|
|
|
||||||
104
src/entities/ProfileAbility.ts
Normal file
104
src/entities/ProfileAbility.ts
Normal file
|
|
@ -0,0 +1,104 @@
|
||||||
|
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||||
|
import { EntityBase } from "./base/Base";
|
||||||
|
import { Profile } from "./Profile";
|
||||||
|
import { ProfileAbilityHistory } from "./ProfileAbilityHistory";
|
||||||
|
|
||||||
|
@Entity("profileAbility")
|
||||||
|
export class ProfileAbility 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,
|
||||||
|
})
|
||||||
|
remark: string;
|
||||||
|
|
||||||
|
@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,
|
||||||
|
})
|
||||||
|
dateStart: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันที่สิ้นสุด",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
dateEnd: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ด้าน",
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
field: string;
|
||||||
|
|
||||||
|
@OneToMany(() => ProfileAbilityHistory, (profileAbilityHistory) => profileAbilityHistory.histories)
|
||||||
|
profileAbilityHistorys: ProfileAbilityHistory[];
|
||||||
|
|
||||||
|
@ManyToOne(() => Profile, (profile) => profile.profileAbilities)
|
||||||
|
@JoinColumn({ name: "profileId" })
|
||||||
|
profile: Profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CreateProfileAbility {
|
||||||
|
@Column("uuid")
|
||||||
|
profileId: string | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
isActive: boolean;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
remark: string | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
detail: string | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
reference: string | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
dateStart: Date | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
dateEnd: Date | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
field: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdateProfileAbility = Partial<CreateProfileAbility>;
|
||||||
103
src/entities/ProfileAbilityHistory.ts
Normal file
103
src/entities/ProfileAbilityHistory.ts
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||||
|
import { EntityBase } from "./base/Base";
|
||||||
|
import { Profile } from "./Profile";
|
||||||
|
import { ProfileAbility } from "./ProfileAbility";
|
||||||
|
|
||||||
|
@Entity("profileAbilityHistory")
|
||||||
|
export class ProfileAbilityHistory extends EntityBase {
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "สถานะการใช้งาน",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isActive: boolean;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "หมายเหตุ",
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
remark: string;
|
||||||
|
|
||||||
|
@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,
|
||||||
|
})
|
||||||
|
dateStart: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันที่สิ้นสุด",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
dateEnd: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ด้าน",
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
field: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 40,
|
||||||
|
comment: "คีย์นอก(FK)ของตาราง ProfileAbility",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
profileAbilityId: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => ProfileAbility, (profileAbility) => profileAbility.profileAbilityHistorys)
|
||||||
|
@JoinColumn({ name: "profileAbilityId" })
|
||||||
|
histories: ProfileAbility;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CreateProfileAbilityHistory {
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
isActive: boolean;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
remark: string | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
detail: string | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
reference: string | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
dateStart: Date | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
dateEnd: Date | null;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
field: string | null;
|
||||||
|
|
||||||
|
@Column("uuid")
|
||||||
|
ProfileAbilityId: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdateProfileAbilityHistory = Partial<CreateProfileAbilityHistory>;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue