add entity org part 1
This commit is contained in:
parent
0f7edf5d15
commit
f36ff656ef
13 changed files with 1783 additions and 1 deletions
126
src/entities/ProfileAssessment.ts
Normal file
126
src/entities/ProfileAssessment.ts
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Profile } from "./Profile";
|
||||
import { ProfileAssessmentHistory } from "./ProfileAssessmentHistory";
|
||||
|
||||
@Entity("profileAssessment")
|
||||
export class ProfileAssessment 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,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันที่ได้รับ",
|
||||
default: null,
|
||||
})
|
||||
date: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "double",
|
||||
comment: "ผลประเมินส่วนที่1 (คะแนน)",
|
||||
default: null,
|
||||
})
|
||||
point1: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "double",
|
||||
comment: "ส่วนที่1 (คะแนน)",
|
||||
default: null,
|
||||
})
|
||||
point1Total: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "double",
|
||||
comment: "ผลประเมินส่วนที่2 (คะแนน)",
|
||||
default: null,
|
||||
})
|
||||
point2: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "double",
|
||||
comment: "ส่วนที่2 (คะแนน)",
|
||||
default: null,
|
||||
})
|
||||
point2Total: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "double",
|
||||
comment: "ผลประเมินรวม (คะแนน)",
|
||||
default: null,
|
||||
})
|
||||
pointSum: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "double",
|
||||
comment: "ผลรวม (คะแนน)",
|
||||
default: null,
|
||||
})
|
||||
pointSumTotal: number;
|
||||
|
||||
@OneToMany(() => ProfileAssessmentHistory, (profileAssessmentHistory) => profileAssessmentHistory.histories)
|
||||
profileAssessmentHistorys: ProfileAssessmentHistory[];
|
||||
|
||||
@ManyToOne(() => Profile, (profile) => profile.profileAssessments)
|
||||
@JoinColumn({ name: "profileId" })
|
||||
profile: Profile;
|
||||
}
|
||||
|
||||
export class CreateProfileAssessment {
|
||||
@Column("uuid")
|
||||
profileId: string | null;
|
||||
|
||||
@Column()
|
||||
isActive: boolean;
|
||||
|
||||
@Column()
|
||||
name: string | null;
|
||||
|
||||
@Column()
|
||||
date: Date | null;
|
||||
|
||||
@Column()
|
||||
point1: number | null;
|
||||
|
||||
@Column()
|
||||
point1Total: number | null;
|
||||
|
||||
@Column()
|
||||
point2: number | null;
|
||||
|
||||
@Column()
|
||||
point2Total: number | null;
|
||||
|
||||
@Column()
|
||||
pointSum: number | null;
|
||||
|
||||
@Column()
|
||||
pointSumTotal: number | null;
|
||||
}
|
||||
|
||||
export type UpdateProfileAssessment = Partial<CreateProfileAssessment>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue