This commit is contained in:
AdisakKanthawilang 2024-08-07 17:34:44 +07:00
parent 8a36a6c977
commit 6fc0c04a9b
4 changed files with 202 additions and 6 deletions

View file

@ -0,0 +1,59 @@
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Development } from "./Development";
import { Province } from "./Province";
@Entity("developmentRisk")
export class DevelopmentRisk extends EntityBase {
@Column({
nullable: true,
comment: "ประเด็นความเสี่ยง",
default: null,
})
issues: string;
@Column({
nullable: true,
comment: "โอกาสที่จะเกิด",
default: null,
})
chance: number;
@Column({
nullable: true,
comment: "ผลกระทบจากการเกิด",
default: null,
})
effects: number;
@Column({
nullable: true,
comment: "ระดับความเสี่ยง",
default: null,
})
riskLevel: string;
@Column({
nullable: true,
comment: "เเนวทางการบริหารความเสี่ยง",
default: null,
})
riskManagement: string;
@Column({
nullable: true,
comment: "คีย์นอก(FK)ของตาราง development",
default: null,
})
developmentId: string;
@ManyToOne(() => Development, (development: Development) => development.developmentRisks)
@JoinColumn({ name: "developmentId" })
development: Development;
}
export class CreateDevelopmentRisk {
@Column()
address: string | null;
@Column()
provinceId: string;
}