This commit is contained in:
2026-01-02 11:12:44 +07:00
parent c7ea4b09fb
commit ca66190604
3 changed files with 93 additions and 12 deletions

View 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;
}

View File

@ -9,6 +9,7 @@ export * from "../entity/hrms/hrms_scholarship";
export * from "../entity/hrms/hrms_training"; 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_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";

View File

@ -18,3 +18,8 @@ export enum YesNo {
YES = "Y", YES = "Y",
NO = "N", NO = "N",
} }
export enum AttendanceType {
IN = "in",
OUT = "out",
}