hrms-api-org/src/entities/PosMasterAct.ts

45 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-06-19 23:03:54 +07:00
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>;