Schema of attendance_records: id : bigint(20) unsigned (Null: NO, Key: PRI, Default: ) employee_id : bigint(20) unsigned (Null: NO, Key: MUL, Default: ) date : date (Null: NO, Key: , Default: ) shift_id : bigint(20) unsigned (Null: YES, Key: MUL, Default: ) first_in : datetime (Null: YES, Key: , Default: ) last_out : datetime (Null: YES, Key: , Default: ) total_work_minutes : int(10) unsigned (Null: YES, Key: , Default: 0) total_break_minutes : int(10) unsigned (Null: YES, Key: , Default: 0) overtime_minutes : int(10) unsigned (Null: YES, Key: , Default: 0) status : enum('Present','Absent','HalfDay','WeekOff','Holiday','OnLeave') (Null: YES, Key: , Default: Absent) late_minutes : int(10) unsigned (Null: YES, Key: , Default: 0) early_out_minutes : int(10) unsigned (Null: YES, Key: , Default: 0) is_regularized : tinyint(1) (Null: YES, Key: , Default: 0) reconciliation_status : enum('Reconciled','PendingException','Unpaired') (Null: YES, Key: , Default: Reconciled) exception_details : varchar(255) (Null: YES, Key: , Default: ) created_at : timestamp (Null: NO, Key: , Default: current_timestamp()) updated_at : timestamp (Null: NO, Key: , Default: current_timestamp()) ----------------------------------------- Schema of attendance_policies: id : bigint(20) unsigned (Null: NO, Key: PRI, Default: ) company_id : bigint(20) unsigned (Null: NO, Key: MUL, Default: ) name : varchar(100) (Null: NO, Key: , Default: ) grace_period_in_minutes : int(10) unsigned (Null: YES, Key: , Default: 15) late_threshold_in_minutes : int(10) unsigned (Null: YES, Key: , Default: 30) half_day_hours_threshold : decimal(4,2) (Null: YES, Key: , Default: 4.00) full_day_hours_threshold : decimal(4,2) (Null: YES, Key: , Default: 8.00) max_late_allowed_per_month : int(10) unsigned (Null: YES, Key: , Default: 3) deduction_rules : longtext (Null: YES, Key: , Default: ) created_at : timestamp (Null: NO, Key: , Default: current_timestamp()) updated_at : timestamp (Null: NO, Key: , Default: current_timestamp()) ----------------------------------------- Schema of shifts: id : bigint(20) unsigned (Null: NO, Key: PRI, Default: ) company_id : bigint(20) unsigned (Null: NO, Key: MUL, Default: ) name : varchar(100) (Null: NO, Key: , Default: ) start_time : time (Null: NO, Key: , Default: ) end_time : time (Null: NO, Key: , Default: ) grace_late_minutes : int(11) (Null: YES, Key: , Default: 0) grace_early_minutes : int(11) (Null: YES, Key: , Default: 0) half_day_hours : decimal(4,2) (Null: YES, Key: , Default: 4.00) full_day_hours : decimal(4,2) (Null: YES, Key: , Default: 8.00) is_night_shift : tinyint(1) (Null: YES, Key: , Default: 0) break_minutes : int(11) (Null: YES, Key: , Default: 60) created_at : timestamp (Null: NO, Key: , Default: current_timestamp()) updated_at : timestamp (Null: NO, Key: , Default: current_timestamp()) ----------------------------------------- Schema of employee_rosters: id : bigint(20) unsigned (Null: NO, Key: PRI, Default: ) employee_id : bigint(20) unsigned (Null: NO, Key: MUL, Default: ) shift_id : bigint(20) unsigned (Null: YES, Key: MUL, Default: ) date : date (Null: NO, Key: , Default: ) created_at : timestamp (Null: NO, Key: , Default: current_timestamp()) updated_at : timestamp (Null: NO, Key: , Default: current_timestamp()) ----------------------------------------- Schema of leave_types: id : bigint(20) unsigned (Null: NO, Key: PRI, Default: ) company_id : bigint(20) unsigned (Null: NO, Key: MUL, Default: ) name : varchar(100) (Null: NO, Key: , Default: ) code : varchar(10) (Null: NO, Key: , Default: ) annual_entitlement : decimal(4,2) (Null: YES, Key: , Default: 0.00) max_carry_forward : decimal(4,2) (Null: YES, Key: , Default: 0.00) is_encashable : tinyint(1) (Null: YES, Key: , Default: 0) is_lwp : tinyint(1) (Null: YES, Key: , Default: 0) accrual_frequency : enum('Monthly','Quarterly','Yearly','None') (Null: YES, Key: , Default: Monthly) sandwich_rule : tinyint(1) (Null: YES, Key: , Default: 0) created_at : timestamp (Null: NO, Key: , Default: current_timestamp()) updated_at : timestamp (Null: NO, Key: , Default: current_timestamp()) ----------------------------------------- Schema of leave_balances: id : bigint(20) unsigned (Null: NO, Key: PRI, Default: ) employee_id : bigint(20) unsigned (Null: NO, Key: MUL, Default: ) leave_type_id : bigint(20) unsigned (Null: NO, Key: MUL, Default: ) year : int(10) unsigned (Null: NO, Key: , Default: ) entitled : decimal(5,2) (Null: YES, Key: , Default: 0.00) utilized : decimal(5,2) (Null: YES, Key: , Default: 0.00) pending_approval : decimal(5,2) (Null: YES, Key: , Default: 0.00) adjusted : decimal(5,2) (Null: YES, Key: , Default: 0.00) created_at : timestamp (Null: NO, Key: , Default: current_timestamp()) updated_at : timestamp (Null: NO, Key: , Default: current_timestamp()) ----------------------------------------- Schema of leave_applications: id : bigint(20) unsigned (Null: NO, Key: PRI, Default: ) employee_id : bigint(20) unsigned (Null: NO, Key: MUL, Default: ) leave_type_id : bigint(20) unsigned (Null: NO, Key: MUL, Default: ) start_date : date (Null: NO, Key: , Default: ) end_date : date (Null: NO, Key: , Default: ) total_days : decimal(4,1) (Null: NO, Key: , Default: ) reason : text (Null: NO, Key: , Default: ) attachment_path : varchar(500) (Null: YES, Key: , Default: ) status : enum('Pending','Approved','Rejected','Cancelled') (Null: YES, Key: , Default: Pending) approved_by : bigint(20) unsigned (Null: YES, Key: MUL, Default: ) comments : text (Null: YES, Key: , Default: ) created_at : timestamp (Null: NO, Key: , Default: current_timestamp()) updated_at : timestamp (Null: NO, Key: , Default: current_timestamp()) ----------------------------------------- Schema of raw_attendance_logs: id : bigint(20) unsigned (Null: NO, Key: PRI, Default: ) employee_id : bigint(20) unsigned (Null: YES, Key: MUL, Default: ) device_id : bigint(20) unsigned (Null: YES, Key: MUL, Default: ) branch_id : bigint(20) unsigned (Null: YES, Key: MUL, Default: ) punch_time : datetime (Null: NO, Key: , Default: ) punch_type : enum('In','Out','Auto') (Null: YES, Key: , Default: Auto) source : enum('Device','Web','Mobile','Manual') (Null: YES, Key: , Default: Device) latitude : decimal(10,8) (Null: YES, Key: , Default: ) longitude : decimal(11,8) (Null: YES, Key: , Default: ) ip_address : varchar(45) (Null: YES, Key: , Default: ) created_at : timestamp (Null: NO, Key: , Default: current_timestamp()) device_user_id : varchar(50) (Null: YES, Key: , Default: ) device_event_id : varchar(100) (Null: YES, Key: , Default: ) sync_status : enum('Resolved','Unresolved') (Null: YES, Key: , Default: Resolved) ----------------------------------------- Schema of sync_queues: id : bigint(20) unsigned (Null: NO, Key: PRI, Default: ) queue_type : enum('EmployeeSync','AttendanceSync','DeviceCommand') (Null: NO, Key: , Default: ) reference_id : bigint(20) unsigned (Null: NO, Key: , Default: ) payload : longtext (Null: YES, Key: , Default: ) status : enum('Pending','Processing','Success','Failed') (Null: YES, Key: , Default: Pending) attempts : int(10) unsigned (Null: YES, Key: , Default: 0) created_at : timestamp (Null: NO, Key: , Default: current_timestamp()) updated_at : timestamp (Null: NO, Key: , Default: current_timestamp()) -----------------------------------------