hrms-api-org/src/entities/PosMasterAssign.ts
2024-10-07 17:00:54 +07:00

38 lines
982 B
TypeScript

import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { PosMaster } from "./PosMaster";
import { Assign } from "./Assign";
@Entity("posMasterAssign")
export class PosMasterAssign extends EntityBase {
@Column({
nullable: true,
default: null,
length: 40,
comment: "คีย์นอก(FK)ของตาราง posMaster",
})
posMasterId: string;
@ManyToOne(() => PosMaster, (posMaster) => posMaster.posMasterAssigns)
@JoinColumn({ name: "posMasterId" })
posMaster: PosMaster;
@Column({
nullable: true,
default: null,
length: 40,
comment: "คีย์นอก(FK)ของตาราง assign",
})
assignId: string;
@ManyToOne(() => Assign, (assign) => assign.posMasterAssigns)
@JoinColumn({ name: "assignId" })
assign: Assign;
}
export class CreatePosMaster {
@Column()
posMasterNoPrefix: string;
}
export type UpdatePosMaster = Partial<PosMaster>;