edit entity

This commit is contained in:
AdisakKanthawilang 2024-05-03 16:44:44 +07:00
parent 3ce3bed13a
commit 94039ac694
4 changed files with 82 additions and 17 deletions

View file

@ -2,6 +2,7 @@ import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiPeriod } from "./kpiPeriod";
import { KpiUserRole } from "./kpiUserRole";
import { KpiRoleHistory } from "./kpiRoleHistory";
@Entity("kpiRole")
export class KpiRole extends EntityBase {
@ -14,7 +15,7 @@ export class KpiRole extends EntityBase {
@Column({
nullable: true,
comment: "รหัสตัวชี้วัด",
comment: "ลำดับ/รหัสตัวชี้วัด",
default: null,
})
including: string;
@ -38,7 +39,7 @@ export class KpiRole extends EntityBase {
comment: "หน่วยนับ",
default: null,
})
unit: number;
unit: string;
@Column({
nullable: true,
@ -216,24 +217,35 @@ export class KpiRole extends EntityBase {
})
kpiPeriodId: string | null;
@Column({
nullable: true,
comment: "ข้อมูลเอกสารหลักฐาน",
default: null,
})
documentInfoEvidence: string;
@ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiRoles)
@JoinColumn({ name: "kpiPeriodId" })
kpiPeriod: KpiPeriod;
@OneToMany(() => KpiUserRole, (kpiUserRole) => kpiUserRole.kpiRole)
kpiUserRoles: KpiUserRole[];
@OneToMany(() => KpiRoleHistory, (kpiRoleHistory) => kpiRoleHistory.kpiRole)
kpiRoleHistories: KpiRoleHistory[];
}
export class createKpiRole {
@Column()
position: string | null;
@Column()
including: string | null;
// @Column()
// including: string | null;
@Column()
includingName: string | null;
@Column()
target: string | null;
@Column()
unit: number | null;
unit: string | null;
@Column()
weight: number | null;
@Column()
@ -258,19 +270,21 @@ export class createKpiRole {
formula: string | null;
@Column()
kpiPeriodId: string | null;
@Column()
documentInfoEvidence: string | null;
}
export class updateKpiRole {
@Column()
position: string | null;
@Column()
including: string | null;
// @Column()
// including: string | null;
@Column()
includingName: string | null;
@Column()
target: string | null;
@Column()
unit: number | null;
unit: string | null;
@Column()
weight: number | null;
@Column()
@ -295,4 +309,6 @@ export class updateKpiRole {
formula: string | null;
@Column()
kpiPeriodId: string | null;
@Column()
documentInfoEvidence: string | null;
}