leave type, shift module

This commit is contained in:
Narul Hidayah
2025-12-31 11:23:15 +07:00
parent 6525af21ea
commit af7a31fd56
5 changed files with 141 additions and 3 deletions

View File

@ -7,7 +7,7 @@ import {
DeleteDateColumn DeleteDateColumn
} from "typeorm"; } from "typeorm";
import { Status } from "../../types/status"; import { Status } from "../../types/status";
import { HolidayType } from "../../types/hrms_holiday"; import { HolidayType } from "../../types/hrms";
@Entity("hrms_holidays", { schema: "hrms" }) @Entity("hrms_holidays", { schema: "hrms" })
export class HrmsHoliday { export class HrmsHoliday {

View File

@ -0,0 +1,61 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
} from "typeorm";
import { Status } from "../../types/status";
import { YesNo } from "../../types/hrms";
@Entity("hrms_leave_types", { schema: "hrms" })
export class HrmsLeaveType {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({ length: 128 })
name: string;
@Column({ nullable: true, length: 256 })
description: string;
@Column({ type: "int" })
maximum_days: number;
@Column({
type: "enum",
enum: YesNo,
default: YesNo.NO,
})
deduct_quota: YesNo;
@Column({
type: "enum",
enum: YesNo,
default: YesNo.YES,
})
paid: YesNo;
@Column({ length: 64 })
status: Status;
@CreateDateColumn()
created_at: Date;
@Column({ nullable: true, length: 256 })
created_by: string;
@UpdateDateColumn({ nullable: true })
updated_at: Date;
@Column({ nullable: true, length: 256 })
updated_by: string;
@DeleteDateColumn({ nullable: true })
deleted_at: Date;
@Column({ nullable: true, length: 256 })
deleted_by: string;
}

View File

@ -0,0 +1,70 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
} from "typeorm";
import { Status } from "../../types/status";
@Entity("hrms_shifts", { schema: "hrms" })
export class HrmsShift {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({
length: 128,
nullable: false,
})
name: string;
@Column({
type: "time",
nullable: false,
})
in_start_time: string; // HH:mm:ss
@Column({
type: "time",
nullable: false,
})
in_end_time: string;
@Column({
type: "time",
nullable: false,
})
out_start_time: string;
@Column({
type: "time",
nullable: false,
})
out_end_time: string;
@Column({
length: 64,
nullable: false,
})
status: Status;
@CreateDateColumn()
created_at: Date;
@Column({ nullable: true, length: 256 })
created_by: string;
@UpdateDateColumn({ nullable: true })
updated_at: Date;
@Column({ nullable: true, length: 256 })
updated_by: string;
@DeleteDateColumn({ nullable: true })
deleted_at: Date;
@Column({ nullable: true, length: 256 })
deleted_by: string;
}

View File

@ -2,5 +2,7 @@ export * from "../entity/hrms/hrms_department"
export * from "../entity/hrms/hrms_airport" export * from "../entity/hrms/hrms_airport"
export * from "../entity/hrms/hrms_position" export * from "../entity/hrms/hrms_position"
export * from "../entity/hrms/hrms_holiday" export * from "../entity/hrms/hrms_holiday"
export * from "../entity/hrms/hrms_leave_type"
export * from "../entity/hrms/hrms_shift"
export * from "../types/hrms_holiday" export * from "../types/hrms"

View File

@ -12,4 +12,9 @@ export const HolidayTypeLabel: Record<HolidayType, string> = {
[HolidayType.COMPANY]: "Company Holiday", [HolidayType.COMPANY]: "Company Holiday",
[HolidayType.RELIGIOUS]: "Religious Holiday", [HolidayType.RELIGIOUS]: "Religious Holiday",
[HolidayType.SPECIAL]: "Special Holiday", [HolidayType.SPECIAL]: "Special Holiday",
}; };
export enum YesNo {
YES = "Y",
NO = "N",
}