2024-02-06 11:30:41 +07:00
|
|
|
import { Entity, Column, OneToMany, OneToOne, JoinColumn} from "typeorm";
|
2024-02-06 10:12:41 +07:00
|
|
|
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,
|
2024-02-06 11:02:29 +07:00
|
|
|
length: 13
|
2024-02-06 10:12:41 +07:00
|
|
|
})
|
2024-02-06 11:02:29 +07:00
|
|
|
citizenId: string;
|
2024-02-06 10:12:41 +07:00
|
|
|
|
2024-02-06 11:30:41 +07:00
|
|
|
@OneToOne(() => PosMaster)
|
|
|
|
|
@JoinColumn()
|
|
|
|
|
current_holder: PosMaster;
|
2024-02-06 10:12:41 +07:00
|
|
|
|
2024-02-06 11:30:41 +07:00
|
|
|
@OneToOne(() => PosMaster)
|
|
|
|
|
@JoinColumn()
|
|
|
|
|
next_holder: PosMaster;
|
2024-02-06 10:12:41 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class CreateProfile {
|
|
|
|
|
@Column()
|
|
|
|
|
prefix: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
firstName: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
lastName: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
2024-02-06 11:02:29 +07:00
|
|
|
citizenId: string;
|
2024-02-06 10:12:41 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export type UpdateProfile = Partial<CreateProfile>;
|