update province

This commit is contained in:
kittapath 2025-01-17 17:52:13 +07:00
parent 668b05a511
commit 19598f1f81
9 changed files with 64 additions and 67 deletions

View file

@ -1,6 +1,5 @@
import { Entity, Column, ManyToOne, JoinColumn, OneToMany, Double } from "typeorm";
import { EntityBase } from "./base/Base";
import { Province } from "./Province";
import { ActualPeople, CreateActualPeople } from "./ActualPeople";
import { CreatePlannedPeople, PlannedPeople } from "./PlannedPeople";
import { ActualGoal, CreateActualGoal } from "./ActualGoal";
@ -566,10 +565,6 @@ export class Development extends EntityBase {
})
provinceActualId: string;
@ManyToOne(() => Province, (province: Province) => province.developmentActuals)
@JoinColumn({ name: "provinceActualId" })
provinceActual: Province;
@Column({
nullable: true,
type: "datetime",

View file

@ -1,7 +1,6 @@
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Development } from "./Development";
import { Province } from "./Province";
@Entity("developmentAddress")
export class DevelopmentAddress extends EntityBase {
@ -19,9 +18,12 @@ export class DevelopmentAddress extends EntityBase {
})
provinceId: string;
@ManyToOne(() => Province, (province: Province) => province.developmentAddresss)
@JoinColumn({ name: "provinceId" })
province: Province;
@Column({
nullable: true,
comment: "โครงการ/หลักสูตรการฝึกอบรม",
default: null,
})
provinceName: string;
@Column({
nullable: true,

View file

@ -1,7 +1,6 @@
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Development } from "./Development";
import { Province } from "./Province";
@Entity("developmentOther")
export class DevelopmentOther extends EntityBase {
@ -26,6 +25,13 @@ export class DevelopmentOther extends EntityBase {
})
provinceActualId: string;
@Column({
nullable: true,
comment: "จังหวัด(ข้อมูลวิชาการ)",
default: null,
})
provinceActualName: string;
@Column({
nullable: true,
comment: "คีย์นอก(FK)ของตาราง development",
@ -36,10 +42,6 @@ export class DevelopmentOther extends EntityBase {
@ManyToOne(() => Development, (development: Development) => development.developmentOthers)
@JoinColumn({ name: "developmentId" })
development: Development;
@ManyToOne(() => Province, (province: Province) => province.developmentOthers)
@JoinColumn({ name: "provinceActualId" })
province: Province;
}
export class UpdateDevelopmentOther {

View file

@ -1,7 +1,6 @@
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 {
@ -47,9 +46,9 @@ export class DevelopmentRisk extends EntityBase {
})
developmentId: string;
@ManyToOne(() => Development, (development: Development) => development.developmentRisks)
@JoinColumn({ name: "developmentId" })
development: Development;
@ManyToOne(() => Development, (development: Development) => development.developmentRisks)
@JoinColumn({ name: "developmentId" })
development: Development;
}
export class UpdateDevelopmentRisk {

View file

@ -13,18 +13,6 @@ export class Province extends EntityBase {
default: null,
})
name: string;
@OneToMany(
() => DevelopmentAddress,
(developmentAddress: DevelopmentAddress) => developmentAddress.province,
)
developmentAddresss: DevelopmentAddress[];
@OneToMany(() => Development, (development: Development) => development.provinceActual)
developmentActuals: Development[];
@OneToMany(() => DevelopmentOther, (developmentOther: DevelopmentOther) => developmentOther.province)
developmentOthers: Development[];
}
export class CreateProvince {