68 lines
1.8 KiB
TypeScript
68 lines
1.8 KiB
TypeScript
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
|
import { EntityBase } from "./base/Base";
|
|
import { Development } from "./Development";
|
|
|
|
@Entity("developmentAddress")
|
|
export class DevelopmentAddress extends EntityBase {
|
|
@Column({
|
|
nullable: true,
|
|
comment: "ที่อยู่",
|
|
default: null,
|
|
})
|
|
address: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
|
default: null,
|
|
})
|
|
provinceId: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment: "ชื่อจังหวัด (กรณีเลือกสถานที่ดำเนินการในประเทศ)",
|
|
default: null,
|
|
})
|
|
provinceName: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
|
default: null,
|
|
})
|
|
developmentId: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment: "สถานที่ดำเนินการ ในประเทศ(IN_COUNTRY) หรือ ต่างประเทศ(ABROAD)",
|
|
default: null,
|
|
})
|
|
addressType: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment: "ชื่อประเทศ (กรณีเลือกสถานที่ดำเนินการต่างประเทศ)",
|
|
default: null,
|
|
})
|
|
country: string;
|
|
|
|
@ManyToOne(() => Development, (development: Development) => development.developmentAddresss)
|
|
@JoinColumn({ name: "developmentId" })
|
|
development: Development;
|
|
}
|
|
export class CreateDevelopmentAddress {
|
|
@Column()
|
|
address: string | null;
|
|
|
|
@Column()
|
|
provinceId: string | null;
|
|
|
|
@Column()
|
|
addressType?: string | null;
|
|
|
|
@Column()
|
|
provinceName?: string | null;
|
|
|
|
@Column()
|
|
country?: string | null;
|
|
}
|