42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
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 {
|
|
@Column({
|
|
nullable: true,
|
|
comment: "ที่อยู่",
|
|
default: null,
|
|
})
|
|
address: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
|
default: null,
|
|
})
|
|
provinceId: string;
|
|
|
|
@ManyToOne(() => Province, (province: Province) => province.developmentAddresss)
|
|
@JoinColumn({ name: "provinceId" })
|
|
province: Province;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
|
default: null,
|
|
})
|
|
developmentId: string;
|
|
|
|
@ManyToOne(() => Development, (development: Development) => development.developmentAddresss)
|
|
@JoinColumn({ name: "developmentId" })
|
|
development: Development;
|
|
}
|
|
export class CreateDevelopmentAddress {
|
|
@Column()
|
|
address: string | null;
|
|
@Column()
|
|
provinceId: string;
|
|
}
|