เพิ่มรอบในแบบแผน

This commit is contained in:
Kittapath 2024-04-19 17:35:36 +07:00
parent 2f50a1983b
commit 4f54040982
3 changed files with 45 additions and 3 deletions

View file

@ -1,5 +1,7 @@
import { Entity, Column } from "typeorm";
import { Entity, Column, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiPlan } from "./kpiPlan";
import { KpiRole } from "./kpiRole";
@Entity("kpiPeriod")
export class KpiPeriod extends EntityBase {
@ -37,6 +39,12 @@ export class KpiPeriod extends EntityBase {
default: true,
})
isActive: boolean;
@OneToMany(() => KpiRole, (kpiRole) => kpiRole.kpiPeriod)
kpiRoles: KpiRole[];
@OneToMany(() => KpiPlan, (kpiPlan) => kpiPlan.kpiPeriod)
kpiPlans: KpiPlan[];
}
export class createKpiPeriod {
@Column()

View file

@ -1,6 +1,7 @@
import { Entity, Column, OneToMany } from "typeorm";
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiLink } from "./kpiLink";
import { KpiPeriod } from "./kpiPeriod";
@Entity("kpiPlan")
export class KpiPlan extends EntityBase {
@ -287,6 +288,18 @@ export class KpiPlan extends EntityBase {
default: null,
})
strategyChild5: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีรอบ",
default: null,
})
kpiPeriodId: string | null;
@ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiPlans)
@JoinColumn({ name: "kpiPeriodId" })
kpiPeriod: KpiPeriod;
}
export class createKpiPlan {
@Column()
@ -327,6 +340,8 @@ export class createKpiPlan {
strategy: number;
@Column()
strategyId: string | null;
@Column()
kpiPeriodId: string | null;
}
export class updateKpiPlan {
@ -368,4 +383,6 @@ export class updateKpiPlan {
strategy: number;
@Column()
strategyId: string | null;
@Column()
kpiPeriodId: string | null;
}

View file

@ -1,6 +1,7 @@
import { Entity, Column, OneToMany } from "typeorm";
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { KpiLink } from "./kpiLink";
import { KpiPeriod } from "./kpiPeriod";
@Entity("kpiRole")
export class KpiRole extends EntityBase {
@ -219,6 +220,18 @@ export class KpiRole extends EntityBase {
default: null,
})
formula: string;
@Column({
nullable: true,
length: 40,
comment: "ไอดีรอบ",
default: null,
})
kpiPeriodId: string | null;
@ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiRoles)
@JoinColumn({ name: "kpiPeriodId" })
kpiPeriod: KpiPeriod;
}
export class createKpiRole {
@Column()
@ -257,6 +270,8 @@ export class createKpiRole {
meaning: string | null;
@Column()
formula: string | null;
@Column()
kpiPeriodId: string | null;
}
export class updateKpiRole {
@ -296,4 +311,6 @@ export class updateKpiRole {
meaning: string | null;
@Column()
formula: string | null;
@Column()
kpiPeriodId: string | null;
}