hrms-api-org/src/entities/PosMasterAssign.ts
harid 96a2d34c1f
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m0s
fix โคลนสิทธิ์เมนู task #2160
2026-01-13 14:57:43 +07:00

44 lines
1.1 KiB
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 class PosMasterAssignDTO {
id: string;
posMasterId: string;
assignId: string;
}
export type UpdatePosMaster = Partial<PosMaster>;