hrms-api-development/src/entities/DevelopmentAddress.ts
2024-04-11 11:39:56 +07:00

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;
}