update
This commit is contained in:
75
src/entity/hrms/hrms_attendance.ts
Normal file
75
src/entity/hrms/hrms_attendance.ts
Normal file
@ -0,0 +1,75 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
import { HrmsEmployee } from "./hrms_employee";
|
||||
import { AttendanceType } from "../../types/hrms";
|
||||
import { HrmsShift } from "./hrms_shift";
|
||||
|
||||
@Entity("hrms_attendances", { schema: "hrms" })
|
||||
export class HrmsAttendance {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: false })
|
||||
@JoinColumn()
|
||||
employee: HrmsEmployee;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
type: AttendanceType;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
date_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
in_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
out_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
duration: number;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
default: false,
|
||||
})
|
||||
is_late: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@Column()
|
||||
@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;
|
||||
}
|
||||
@ -9,6 +9,7 @@ export * from "../entity/hrms/hrms_scholarship";
|
||||
export * from "../entity/hrms/hrms_training";
|
||||
export * from "../entity/hrms/hrms_training_participant";
|
||||
export * from "../entity/hrms/hrms_bank";
|
||||
export * from "../entity/hrms/hrms_attendance";
|
||||
export * from "../entity/hrms/hrms_payroll";
|
||||
export * from "../entity/hrms/hrms_payroll_monthly";
|
||||
export * from "../entity/hrms/hrms_leave";
|
||||
|
||||
@ -1,20 +1,25 @@
|
||||
export enum HolidayType {
|
||||
NATIONAL = "NH", // National Holiday
|
||||
COLLECTIVE = "CL", // Collective Leave / Cuti Bersama
|
||||
COMPANY = "CH", // Company Holiday
|
||||
RELIGIOUS = "RH", // Religious Holiday
|
||||
SPECIAL = "SH", // Special / Exceptional Holiday
|
||||
NATIONAL = "NH", // National Holiday
|
||||
COLLECTIVE = "CL", // Collective Leave / Cuti Bersama
|
||||
COMPANY = "CH", // Company Holiday
|
||||
RELIGIOUS = "RH", // Religious Holiday
|
||||
SPECIAL = "SH", // Special / Exceptional Holiday
|
||||
}
|
||||
|
||||
export const HolidayTypeLabel: Record<HolidayType, string> = {
|
||||
[HolidayType.NATIONAL]: "National Holiday",
|
||||
[HolidayType.COLLECTIVE]: "Collective Leave",
|
||||
[HolidayType.COMPANY]: "Company Holiday",
|
||||
[HolidayType.RELIGIOUS]: "Religious Holiday",
|
||||
[HolidayType.SPECIAL]: "Special Holiday",
|
||||
[HolidayType.NATIONAL]: "National Holiday",
|
||||
[HolidayType.COLLECTIVE]: "Collective Leave",
|
||||
[HolidayType.COMPANY]: "Company Holiday",
|
||||
[HolidayType.RELIGIOUS]: "Religious Holiday",
|
||||
[HolidayType.SPECIAL]: "Special Holiday",
|
||||
};
|
||||
|
||||
export enum YesNo {
|
||||
YES = "Y",
|
||||
NO = "N",
|
||||
YES = "Y",
|
||||
NO = "N",
|
||||
}
|
||||
|
||||
export enum AttendanceType {
|
||||
IN = "in",
|
||||
OUT = "out",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user