fix: entity fields

This commit is contained in:
Methapon2001 2024-03-21 11:38:13 +07:00
parent f769a0820c
commit c20676af5d
2 changed files with 10 additions and 9 deletions

View file

@ -16,10 +16,9 @@ export class LeaveType extends EntityBase {
@Column({ @Column({
nullable: true, nullable: true,
comment: "รหัสประเภอการลา", comment: "รหัสประเภอการลา",
length: 255,
default: null, default: null,
}) })
code: number; code: string;
@Column({ @Column({
nullable: true, nullable: true,
@ -34,8 +33,12 @@ export class LeaveType extends EntityBase {
export class CreateLeaveType { export class CreateLeaveType {
name: string | null; name: string | null;
code: number | null; code: string | null;
limit: number | null; limit: number | null;
} }
export type UpdateLeaveType = Partial<CreateLeaveType>; export type UpdateLeaveType = {
name?: string | null;
code?: string | null;
limit?: number | null;
};

View file

@ -70,15 +70,13 @@ export class ProfileLeave extends EntityBase {
}) })
reason: string; reason: string;
@OneToMany(() => ProfileLeaveHistory, (profileLeaveHistory) => profileLeaveHistory.histories) @OneToMany(() => ProfileLeaveHistory, (v) => v.histories)
profileLeaves: ProfileLeaveHistory[]; profileLeaves: ProfileLeaveHistory[];
@ManyToOne(() => LeaveType, (leaveType) => leaveType.profileLeave) @ManyToOne(() => LeaveType, (v) => v.profileLeave)
@JoinColumn({ name: "leaveTypeId" })
leaveType: LeaveType; leaveType: LeaveType;
@ManyToOne(() => Profile, (profile) => profile.profileLeaves) @ManyToOne(() => Profile, (v) => v.profileLeaves)
@JoinColumn({ name: "profileId" })
profile: Profile; profile: Profile;
} }