62 lines
1.1 KiB
TypeScript
62 lines
1.1 KiB
TypeScript
|
|
import { Entity, Column, OneToMany} from "typeorm";
|
||
|
|
import { EntityBase } from "./base/Base";
|
||
|
|
import { PosMaster } from "./PosMaster";
|
||
|
|
|
||
|
|
@Entity("profile")
|
||
|
|
export class Profile extends EntityBase {
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "คำนำหน้าชื่อ",
|
||
|
|
length: 40,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
prefix: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "ชื่อ",
|
||
|
|
length: 255,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
firstName: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "นามสกุล",
|
||
|
|
length: 255,
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
lastName: string;
|
||
|
|
|
||
|
|
@Column({
|
||
|
|
nullable: true,
|
||
|
|
comment: "เลขประจำตัวประชาชน",
|
||
|
|
default: null,
|
||
|
|
})
|
||
|
|
citizenId: number;
|
||
|
|
|
||
|
|
@OneToMany(() => PosMaster, (posMaster) => posMaster.profile)
|
||
|
|
posMasters: PosMaster[];
|
||
|
|
|
||
|
|
@OneToMany(() => PosMaster, (posMaster) => posMaster.next_holder)
|
||
|
|
next_holder_posMasters: PosMaster[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export class CreateProfile {
|
||
|
|
@Column()
|
||
|
|
prefix: string;
|
||
|
|
|
||
|
|
@Column()
|
||
|
|
firstName: string;
|
||
|
|
|
||
|
|
@Column()
|
||
|
|
lastName: string;
|
||
|
|
|
||
|
|
@Column()
|
||
|
|
citizenId: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
export type UpdateProfile = Partial<CreateProfile>;
|