ปรับโครงาร
This commit is contained in:
parent
b8e1c93cb4
commit
4f8b2cec73
10 changed files with 1317 additions and 483 deletions
42
src/entities/DevelopmentAddress.ts
Normal file
42
src/entities/DevelopmentAddress.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue