45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
|
|
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany, ManyToMany } from "typeorm";
|
||
|
|
import { EntityBase } from "./base/Base";
|
||
|
|
import { PosMaster } from "./PosMaster";
|
||
|
|
|
||
|
|
@Entity("posMasterAct")
|
||
|
|
export class PosMasterAct extends EntityBase {
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "ลำดับที่แสดงผล",
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
posMasterOrder: number;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
default: null,
|
||
|
|
length: 40,
|
||
|
|
comment: "คีย์นอก(FK)ของตาราง posMaster",
|
||
|
|
})
|
||
|
|
posMasterId: string;
|
||
|
|
|
||
|
|
@ManyToOne(() => PosMaster, (posMaster) => posMaster.posMasterActs)
|
||
|
|
@JoinColumn({ name: "posMasterId" })
|
||
|
|
posMaster: PosMaster;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
default: null,
|
||
|
|
length: 40,
|
||
|
|
comment: "คีย์นอก(FK)ของตาราง posMasterChild",
|
||
|
|
})
|
||
|
|
posMasterChildId: string;
|
||
|
|
|
||
|
|
@ManyToOne(() => PosMaster, (posMaster) => posMaster.posMasterActChilds)
|
||
|
|
@JoinColumn({ name: "posMasterChildId" })
|
||
|
|
posMasterChild: PosMaster;
|
||
|
|
}
|
||
|
|
|
||
|
|
export class CreatePosMaster {
|
||
|
|
@Column()
|
||
|
|
posMasterNoPrefix: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export type UpdatePosMaster = Partial<PosMaster>;
|