tbl_attendance_workschedule_history

1 rows


Description

Module: HRMS Time & Attendance (Work Schedule Audit)
Purpose: Stores the historical, immutable audit log of all changes made to employee work schedule configurations.
Data: Contains a snapshot of the work schedule rules (min hours, flexible settings, etc.) at the time a modification occurred.
Process Usage:
- Used for auditing, compliance checks, and reconstructing the exact work schedule rules applicable to an employee on any past date.
- Populated automatically upon creation, update, or deletion of a master work schedule record.
Key Points:
- Critical for payroll accuracy and legally defensible attendance calculations.
- The workscheduleid links the historical record back to its active counterpart.
Business Impact: Provides a robust trail of configuration changes for all employee scheduling rules.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id bigserial 19 nextval('tbl_attendance_workschedule_history_id_seq'::regclass)

Primary key of the history table
Format: Integer (auto-increment)
Used as: Unique identifier for this single historical snapshot.

workschedulename varchar 255 null

The name of the work schedule configuration at the time of this history record.
Format: Varchar/Text.

flexibletype varchar 20 null

The type of flexible schedule applied (e.g., Daily, Weekly, Monthly, or Not Applicable).
Format: Varchar/Text.

duration varchar 20 null

The total time duration covered by the schedule configuration (e.g., 8:00 hours).
Format: Time/Interval.

reason varchar 1000 null

The justification or comment provided for the change that led to the creation of this history record.
Format: Text.

monthlyminimumhours int4 10 null

The minimum total working hours required monthly to meet attendance compliance.
Format: Time/Interval.

weeklyminimumhours int4 10 null

The minimum total working hours required weekly to meet attendance compliance.
Format: Time/Interval.

dailyminimumhours int4 10 null

The minimum working hours required daily to qualify for a full day of attendance.
Format: Time/Interval.

dailyhalfdayminimumhours int4 10 null

The minimum working hours required daily to qualify for a half day of attendance.
Format: Time/Interval.

hoursforfulldayleave int4 10 null

The number of hours deducted from an employee’s balance or used as working credit for a full day of leave.
Format: Time/Interval.

hoursforhalfdayleave int4 10 null

The number of hours deducted from an employee’s balance or used as working credit for a half day of leave.
Format: Time/Interval.

workscheduleid int8 19 null

FK: public.tbl_attendance_workschedule_master.id
Meaning: The ID of the primary work schedule master record to which this history record pertains.

stage varchar 20 null

The lifecycle stage of the work schedule configuration (e.g., Active) at the time of the change.
Format: Varchar/Text.

workingdayscount int4 10 0

The number of required working days in the schedule period (e.g., 5 or 6).
Format: Integer.

createdby varchar 50 null

FK: public.tbl_userlogin.id or public.tbl_employee.employeeid
Meaning: The user who made the change that resulted in this history record being created.

createddate timestamp 29,6 null

Timestamp of when the historical record was created (i.e., when the modification to the master record occurred).
Format: Timestamp with timezone.

modifiedby varchar 50 null

FK: public.tbl_userlogin.id or public.tbl_employee.employeeid
Meaning: The last user who modified the work schedule before this history snapshot was taken (same as createdby if the change was immediate).

modifieddate timestamp 29,6 null

Timestamp of the last modification to the master work schedule record before this history snapshot was taken.
Format: Timestamp with timezone.

calculation_on varchar 20 null

Specifies the basis for minimum hours calculation (e.g., Based on total hors , Based on Net Hours ).
Format: Varchar/Text.

Indexes

Constraint Name Type Sort Column(s)
tbl_attendance_workschedule_history_pk_tbl_attendance_worksched Primary key Asc id

Relationships