diff --git a/src/entities/LeaveType.ts b/src/entities/LeaveType.ts index 373dc2a6..86ae595c 100644 --- a/src/entities/LeaveType.ts +++ b/src/entities/LeaveType.ts @@ -16,10 +16,9 @@ export class LeaveType extends EntityBase { @Column({ nullable: true, comment: "รหัสประเภอการลา", - length: 255, default: null, }) - code: number; + code: string; @Column({ nullable: true, @@ -34,8 +33,12 @@ export class LeaveType extends EntityBase { export class CreateLeaveType { name: string | null; - code: number | null; + code: string | null; limit: number | null; } -export type UpdateLeaveType = Partial; +export type UpdateLeaveType = { + name?: string | null; + code?: string | null; + limit?: number | null; +}; diff --git a/src/entities/ProfileLeave.ts b/src/entities/ProfileLeave.ts index 9380b028..c9f060e3 100644 --- a/src/entities/ProfileLeave.ts +++ b/src/entities/ProfileLeave.ts @@ -70,15 +70,13 @@ export class ProfileLeave extends EntityBase { }) reason: string; - @OneToMany(() => ProfileLeaveHistory, (profileLeaveHistory) => profileLeaveHistory.histories) + @OneToMany(() => ProfileLeaveHistory, (v) => v.histories) profileLeaves: ProfileLeaveHistory[]; - @ManyToOne(() => LeaveType, (leaveType) => leaveType.profileLeave) - @JoinColumn({ name: "leaveTypeId" }) + @ManyToOne(() => LeaveType, (v) => v.profileLeave) leaveType: LeaveType; - @ManyToOne(() => Profile, (profile) => profile.profileLeaves) - @JoinColumn({ name: "profileId" }) + @ManyToOne(() => Profile, (v) => v.profileLeaves) profile: Profile; }