upd
This commit is contained in:
@ -24,8 +24,9 @@ export class HrmsAttendance {
|
|||||||
})
|
})
|
||||||
date_at: Date;
|
date_at: Date;
|
||||||
|
|
||||||
|
/** Nullable when record created from break punch only (no clock in) */
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: true,
|
||||||
})
|
})
|
||||||
in_at: Date;
|
in_at: Date;
|
||||||
|
|
||||||
|
|||||||
71
src/entity/hrms/hrms_attendance_request.ts
Normal file
71
src/entity/hrms/hrms_attendance_request.ts
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
ManyToOne,
|
||||||
|
JoinColumn,
|
||||||
|
} from "typeorm";
|
||||||
|
import { HrmsEmployee } from "./hrms_employee";
|
||||||
|
|
||||||
|
export type AttendanceRequestStatus = "PENDING" | "APPROVED" | "REJECTED";
|
||||||
|
|
||||||
|
/** Type of punch being requested: maps to attendance column on approve */
|
||||||
|
export type AttendanceRequestType = "in" | "break_out" | "break_in" | "out";
|
||||||
|
|
||||||
|
@Entity("hrms_attendance_requests", { schema: "hrms" })
|
||||||
|
export class HrmsAttendanceRequest {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => HrmsEmployee, { onDelete: "RESTRICT", nullable: false })
|
||||||
|
@JoinColumn()
|
||||||
|
employee: HrmsEmployee;
|
||||||
|
|
||||||
|
/** Type of punch: in → in_at, break_out → break_out_at, break_in → break_in_at, out → out_at */
|
||||||
|
@Column({ length: 32, nullable: false })
|
||||||
|
type: AttendanceRequestType;
|
||||||
|
|
||||||
|
@Column({ type: "date", nullable: false })
|
||||||
|
date_at: Date;
|
||||||
|
|
||||||
|
/** Requested time for this punch (used for the column indicated by type) */
|
||||||
|
@Column({ type: "timestamp", nullable: false })
|
||||||
|
requested_at: Date;
|
||||||
|
|
||||||
|
/** Employee reason on submit; supervisor can set when rejecting */
|
||||||
|
@Column({ type: "text", nullable: true })
|
||||||
|
remark: string;
|
||||||
|
|
||||||
|
@Column({ length: 32, nullable: false, default: "PENDING" })
|
||||||
|
status: AttendanceRequestStatus;
|
||||||
|
|
||||||
|
@ManyToOne(() => HrmsEmployee, { onDelete: "SET NULL", nullable: true })
|
||||||
|
@JoinColumn()
|
||||||
|
approved_by: HrmsEmployee;
|
||||||
|
|
||||||
|
@Column({ type: "timestamp", nullable: true })
|
||||||
|
approved_at: Date;
|
||||||
|
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
created_by: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by: string;
|
||||||
|
}
|
||||||
@ -10,6 +10,7 @@ export * from "../entity/hrms/hrms_training";
|
|||||||
export * from "../entity/hrms/hrms_training_participant";
|
export * from "../entity/hrms/hrms_training_participant";
|
||||||
export * from "../entity/hrms/hrms_bank";
|
export * from "../entity/hrms/hrms_bank";
|
||||||
export * from "../entity/hrms/hrms_attendance";
|
export * from "../entity/hrms/hrms_attendance";
|
||||||
|
export * from "../entity/hrms/hrms_attendance_request";
|
||||||
export * from "../entity/hrms/hrms_payroll";
|
export * from "../entity/hrms/hrms_payroll";
|
||||||
export * from "../entity/hrms/hrms_payroll_monthly";
|
export * from "../entity/hrms/hrms_payroll_monthly";
|
||||||
export * from "../entity/hrms/hrms_leave";
|
export * from "../entity/hrms/hrms_leave";
|
||||||
|
|||||||
Reference in New Issue
Block a user