-- جدول تسجيل العمل الإضافي للموظفين
CREATE TABLE IF NOT EXISTS `EmpOvertime` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `EmpID` int NOT NULL COMMENT 'Emp.ID',
  `OvertimeDate` date NOT NULL,
  `OvertimeWage` int NOT NULL DEFAULT 25000 COMMENT 'أجرة العمل الإضافي',
  `WorkLocation` varchar(1000) DEFAULT NULL,
  `Notes` varchar(2000) DEFAULT NULL,
  `EnteredByUserId` int NOT NULL COMMENT 'users.id_user',
  `IsApproved` tinyint(1) NOT NULL DEFAULT 0,
  `ApprovedByUserId` int DEFAULT NULL,
  `ApprovedAt` datetime DEFAULT NULL,
  `CreatedAt` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `idx_EmpOvertime_EmpID` (`EmpID`),
  KEY `idx_EmpOvertime_Date` (`OvertimeDate`),
  KEY `idx_EmpOvertime_EnteredBy` (`EnteredByUserId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
