--
-- Host: localhost    Database: TAFDB
-- ------------------------------------------------------


--
-- Table structure for table `GL_Journal_Entries`
--

CREATE TABLE `GL_Journal_Entries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `reference` varchar(100) DEFAULT NULL,
  `memo` text DEFAULT NULL,
  `timestamp` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `company_id` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `GL_Journal_Entries`
--

INSERT INTO `GL_Journal_Entries` VALUES
(1,'INV-1001','Initial capital','2025-05-01 09:00:00',1,1,0,'2025-06-02 20:55:41'),
(2,'JE001','Opening balance','2025-06-02 20:55:41',1,1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `account_ai_feedback`
--

CREATE TABLE `account_ai_feedback` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `transaction_id` int(11) DEFAULT NULL,
  `suggested_code` varchar(50) DEFAULT NULL,
  `chosen_code` varchar(50) DEFAULT NULL,
  `rationale` text DEFAULT NULL,
  `accepted` tinyint(1) DEFAULT 0,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `account_ai_feedback`
--


--
-- Table structure for table `ap_transactions`
--

CREATE TABLE `ap_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `gl_transaction_id` int(11) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ap_transactions`
--

INSERT INTO `ap_transactions` VALUES
(1,2,0,'2025-06-02 20:55:41');

--
-- Table structure for table `appeals`
--

CREATE TABLE `appeals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `case_id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `reason` text DEFAULT NULL,
  `status` enum('submitted','review','resolved') DEFAULT 'submitted',
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `appeals`
--

INSERT INTO `appeals` VALUES
(1,1,2,'Disputes severity','submitted',0,'2025-06-02 20:55:41');

--
-- Table structure for table `application_documents`
--

CREATE TABLE `application_documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `application_id` int(11) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `file_type` varchar(50) NOT NULL,
  `file_path` text NOT NULL,
  `uploaded_by` int(11) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `application_documents`
--

INSERT INTO `application_documents` VALUES
(1,1,'resume.pdf','resume','/docs/applications/resume1.pdf',1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `application_shortlists`
--

CREATE TABLE `application_shortlists` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `job_id` int(11) NOT NULL,
  `general_comment` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `application_shortlists`
--


--
-- Table structure for table `applications`
--

CREATE TABLE `applications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `job_id` int(11) NOT NULL,
  `first_name` varchar(100) NOT NULL,
  `last_name` varchar(100) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `position_applied` varchar(255) NOT NULL,
  `application_date` date NOT NULL,
  `status` enum('New','Under Review','Interviewing','Rejected','Hired') NOT NULL,
  `shortlisted` tinyint(1) DEFAULT 0,
  `source` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `pendingSync` tinyint(1) DEFAULT 0,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `applications`
--

INSERT INTO `applications` VALUES
(1,1,'George','Miller','george.miller@example.com','+1-555-1000','10 Market St','1990-04-12','Software Engineer','2025-05-20','Under Review',0,'Website',NULL,1,0,0,'2025-06-02 20:55:41');

--
-- Table structure for table `ar_transactions`
--

CREATE TABLE `ar_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `gl_transaction_id` int(11) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ar_transactions`
--

INSERT INTO `ar_transactions` VALUES
(1,2,0,'2025-06-02 20:55:41');

--
-- Table structure for table `assessment_numbers`
--

CREATE TABLE `assessment_numbers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `number` varchar(100) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `assessment_numbers`
--

INSERT INTO `assessment_numbers` VALUES
(1,1,'A100',0,'2025-06-02 20:55:41'),
(2,2,'A101',0,'2025-06-02 20:55:41');

--
-- Table structure for table `attendance`
--

CREATE TABLE `attendance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `hours_worked` decimal(5,2) NOT NULL DEFAULT 0.00,
  `overtime` decimal(5,2) NOT NULL DEFAULT 0.00,
  `approval_status` varchar(20) DEFAULT 'Approved',
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `attendance`
--


--
-- Table structure for table `bank_detail_changes`
--

CREATE TABLE `bank_detail_changes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `bankName` varchar(255) DEFAULT NULL,
  `accountName` varchar(255) DEFAULT NULL,
  `accountNumber` varchar(255) DEFAULT NULL,
  `status` enum('Pending','Approved','Rejected') DEFAULT 'Pending',
  `approved_at` datetime DEFAULT NULL,
  `approved_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `bank_detail_changes`
--


--
-- Table structure for table `bank_transactions`
--

CREATE TABLE `bank_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `gl_transaction_id` int(11) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `bank_transactions`
--

INSERT INTO `bank_transactions` VALUES
(1,1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `benefit_plans`
--

CREATE TABLE `benefit_plans` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `deduction_amount` decimal(10,2) NOT NULL,
  `pre_tax` tinyint(1) DEFAULT 1,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `benefit_plans`
--

INSERT INTO `benefit_plans` VALUES
(1,'Health Insurance',150.00,1,0,'2025-06-02 20:55:41'),
(2,'Retirement 401k',200.00,1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `case_evidence`
--

CREATE TABLE `case_evidence` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `case_id` int(11) NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `case_evidence`
--

INSERT INTO `case_evidence` VALUES
(1,1,'/evidence/late1.jpg','Time clock screenshot',0,'2025-06-02 20:55:41');

--
-- Table structure for table `case_notes`
--

CREATE TABLE `case_notes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `matter_id` int(11) NOT NULL,
  `note` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `case_notes`
--


--
-- Table structure for table `case_participants`
--

CREATE TABLE `case_participants` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `matter_id` int(11) NOT NULL,
  `person_id` int(11) NOT NULL,
  `role` varchar(100) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `case_participants`
--


--
-- Table structure for table `case_tasks`
--

CREATE TABLE `case_tasks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `matter_id` int(11) NOT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `due_date` datetime DEFAULT NULL,
  `assigned_to` int(11) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `case_tasks`
--


--
-- Table structure for table `cash_sessions`
--

CREATE TABLE `cash_sessions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cashier_id` int(11) NOT NULL,
  `opened_at` datetime NOT NULL,
  `closed_at` datetime DEFAULT NULL,
  `opening_balance` decimal(10,2) NOT NULL,
  `closing_balance` decimal(10,2) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cash_sessions`
--


--
-- Table structure for table `check_ins`
--

CREATE TABLE `check_ins` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `manager_id` int(11) DEFAULT NULL,
  `scheduled_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `check_ins`
--


--
-- Table structure for table `companies`
--

CREATE TABLE `companies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `country_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `country_idx` (`country_id`),
  KEY `name_idx` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `companies`
--

INSERT INTO `companies` VALUES
(1,1,'Biosecurity Authority of Fiji',0,'2025-06-02 20:55:41');

--
-- Table structure for table `compensation`
--

CREATE TABLE `compensation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `pay_type` enum('salary','hourly') NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `effective_from` date NOT NULL,
  `effective_to` date DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `compensation`
--

INSERT INTO `compensation` VALUES
(1,1,'salary',60000.00,'2025-01-01',NULL,0,'2025-06-02 20:55:41'),
(2,2,'salary',80000.00,'2025-01-01',NULL,0,'2025-06-02 20:55:41'),
(3,3,'salary',50000.00,'2025-01-01',NULL,0,'2025-06-02 20:55:41'),
(4,4,'salary',75000.00,'2025-01-01',NULL,0,'2025-06-02 20:55:41'),
(5,5,'salary',45000.00,'2025-01-01',NULL,0,'2025-06-02 20:55:41');

--
-- Table structure for table `countries`
--

CREATE TABLE `countries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `name_idx` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `countries`
--

INSERT INTO `countries` VALUES
(1,'Fiji',0,'2025-06-02 20:55:41'),
(2,'United States',0,'2025-06-02 20:55:41'),
(3,'Australia',0,'2025-06-02 20:55:41');

--
-- Table structure for table `country_holidays`
--

CREATE TABLE `country_holidays` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `country_id` int(11) NOT NULL,
  `holiday_name` varchar(100) NOT NULL,
  `holiday_date` date NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `country_idx` (`country_id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `country_holidays`
--

INSERT INTO `country_holidays` VALUES
(1,1,'New Year\'s Day','2025-01-01',0,'2025-06-02 20:55:41'),
(2,1,'Good Friday','2025-04-18',0,'2025-06-02 20:55:41'),
(3,1,'Easter Saturday','2025-04-19',0,'2025-06-02 20:55:41'),
(4,1,'Easter Monday','2025-04-21',0,'2025-06-02 20:55:41'),
(5,1,'Girmit Day','2025-05-12',0,'2025-06-02 20:55:41'),
(6,1,'Ratu Sir Lala Sukuna Day','2025-05-30',0,'2025-06-02 20:55:41'),
(7,1,'Prophet Mohammed\'s Birthday','2025-09-08',0,'2025-06-02 20:55:41'),
(8,1,'Fiji Day','2025-10-10',0,'2025-06-02 20:55:41'),
(9,1,'Diwali','2025-10-21',0,'2025-06-02 20:55:41'),
(10,1,'Christmas Day','2025-12-25',0,'2025-06-02 20:55:41'),
(11,1,'Boxing Day','2025-12-26',0,'2025-06-02 20:55:41');

--
-- Table structure for table `customer_history`
--

CREATE TABLE `customer_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `customerId` int(11) NOT NULL,
  `action` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `performedBy` int(11) NOT NULL,
  `performedAt` datetime DEFAULT current_timestamp(),
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `customer_history`
--


--
-- Table structure for table `customer_settings`
--

CREATE TABLE `customer_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `customer_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `value` text NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `customer_setting_unique` (`customer_id`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `customer_settings`
--


--
-- Table structure for table `customers`
--

CREATE TABLE `customers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `customerType` enum('individual','corporate','government') NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `tin` varchar(100) DEFAULT NULL,
  `vat` varchar(100) DEFAULT NULL,
  `linkedEntityType` enum('ratepayer','businessRegistration') DEFAULT NULL,
  `linkedEntityId` varchar(255) DEFAULT NULL,
  `riskRating` enum('low','medium','high') DEFAULT NULL,
  `complianceStatus` enum('compliant','non-compliant','pending') DEFAULT NULL,
  `createdBy` int(11) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `customers`
--


--
-- Table structure for table `deduction_settings`
--

CREATE TABLE `deduction_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `start_salary` decimal(10,2) NOT NULL,
  `end_salary` decimal(10,2) DEFAULT NULL,
  `base_amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `percent` decimal(5,2) NOT NULL DEFAULT 0.00,
  `company_contribution` decimal(5,2) NOT NULL DEFAULT 0.00,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `applies_to` enum('resident','non_resident') NOT NULL,
  `scope` enum('country','company') NOT NULL,
  `country_id` int(11) DEFAULT NULL,
  `company_id` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `deduction_settings`
--

INSERT INTO `deduction_settings` VALUES
(1,'PAYE',0.00,30000.00,0.00,0.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(2,'PAYE',30001.00,50000.00,0.00,18.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(3,'PAYE',50001.00,270000.00,3600.00,20.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(4,'PAYE',270001.00,300000.00,47600.00,33.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(5,'PAYE',300001.00,350000.00,57500.00,34.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(6,'PAYE',350001.00,400000.00,74500.00,35.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(7,'PAYE',400001.00,450000.00,92000.00,36.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(8,'PAYE',450001.00,500000.00,110000.00,37.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(9,'PAYE',500001.00,1000000.00,128500.00,38.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(10,'PAYE',1000001.00,NULL,318500.00,39.00,0.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(11,'PAYE',0.00,30000.00,0.00,20.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(12,'PAYE',30001.00,50000.00,6000.00,20.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(13,'PAYE',50001.00,270000.00,10000.00,20.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(14,'PAYE',270001.00,300000.00,54000.00,33.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(15,'PAYE',300001.00,350000.00,63900.00,34.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(16,'PAYE',350001.00,400000.00,80900.00,35.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(17,'PAYE',400001.00,450000.00,98400.00,36.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(18,'PAYE',450001.00,500000.00,116400.00,37.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(19,'PAYE',500001.00,1000000.00,134900.00,38.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(20,'PAYE',1000001.00,NULL,324900.00,39.00,0.00,NULL,NULL,'non_resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(21,'FNPF',0.00,NULL,0.00,8.00,10.00,NULL,NULL,'resident','country',1,NULL,0,'2025-06-02 20:55:41'),
(22,'Union Fee',0.00,2000.00,5.00,1.00,1.00,NULL,NULL,'resident','country',NULL,NULL,0,'2025-06-02 20:55:41'),
(23,'Union Fee Tier 2',2000.01,NULL,10.00,2.00,1.50,NULL,NULL,'resident','country',NULL,NULL,0,'2025-06-02 20:55:41');

--
-- Table structure for table `disciplinary_actions`
--

CREATE TABLE `disciplinary_actions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `case_id` int(11) NOT NULL,
  `action` varchar(255) NOT NULL,
  `effective_date` date NOT NULL,
  `approved_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `disciplinary_actions`
--

INSERT INTO `disciplinary_actions` VALUES
(1,1,'Written warning','2025-06-01',1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `disciplinary_cases`
--

CREATE TABLE `disciplinary_cases` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `violation_id` int(11) NOT NULL,
  `severity` enum('minor','major','critical') NOT NULL,
  `summary` text DEFAULT NULL,
  `status` enum('open','under_review','closed') DEFAULT 'open',
  `assigned_to` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `disciplinary_cases`
--

INSERT INTO `disciplinary_cases` VALUES
(1,2,1,'minor','Late arrival on 2025-05-01','open',1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `employee_authorized_locations`
--

CREATE TABLE `employee_authorized_locations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `location_id` int(11) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `employee_idx` (`employee_id`),
  KEY `location_idx` (`location_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `employee_authorized_locations`
--


--
-- Table structure for table `employee_benefit_documents`
--

CREATE TABLE `employee_benefit_documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_benefit_id` int(11) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `file_type` varchar(50) NOT NULL,
  `file_path` text NOT NULL,
  `uploaded_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `employee_benefit_documents`
--


--
-- Table structure for table `employee_benefits`
--

CREATE TABLE `employee_benefits` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `benefit_plan_id` int(11) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `employee_benefits`
--

INSERT INTO `employee_benefits` VALUES
(1,1,1,'2025-01-01',NULL,0,'2025-06-02 20:55:41'),
(2,2,2,'2025-01-01',NULL,0,'2025-06-02 20:55:41');

--
-- Table structure for table `employee_exits`
--

CREATE TABLE `employee_exits` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `resignation_date` date NOT NULL,
  `status` varchar(50) DEFAULT 'pending',
  `final_pay` decimal(10,2) DEFAULT 0.00,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `employee_exits`
--


--
-- Table structure for table `employee_items`
--

CREATE TABLE `employee_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `item_name` varchar(100) NOT NULL,
  `is_ppe` tinyint(1) NOT NULL DEFAULT 0,
  `expiry_date` date DEFAULT NULL,
  `assignee_user_id` int(11) DEFAULT NULL,
  `assignee_group_id` int(11) DEFAULT NULL,
  `assigned_at` timestamp NULL DEFAULT current_timestamp(),
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `employee_items`
--

INSERT INTO `employee_items` VALUES
(1,2,'Laptop',0,NULL,1,NULL,'2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(2,3,'Safety Helmet',1,'2025-12-31',1,NULL,'2025-06-02 20:55:41',0,'2025-06-02 20:55:41');

--
-- Table structure for table `employee_location_changes`
--

CREATE TABLE `employee_location_changes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `stations` varchar(255) NOT NULL,
  `action` varchar(20) NOT NULL,
  `effective_date` date NOT NULL,
  `processed_at` datetime DEFAULT NULL,
  `updatedAt` datetime DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `emp_idx` (`employee_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `employee_location_changes`
--


--
-- Table structure for table `employee_types`
--

CREATE TABLE `employee_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(50) NOT NULL,
  `default_items` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `employee_types`
--

INSERT INTO `employee_types` VALUES
(1,'Full-Time','Laptop,Phone',0,'2025-06-02 20:55:41'),
(2,'Contractor','Laptop',0,'2025-06-02 20:55:41');

--
-- Table structure for table `employees`
--

CREATE TABLE `employees` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `department` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `salary` decimal(10,2) DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `pay_cycle_id` int(11) DEFAULT NULL,
  `manager_id` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=105 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `employees`
--

INSERT INTO `employees` VALUES
(17,1,'Test Admin',NULL,NULL,NULL,NULL,30000.00,1,1,NULL,0,'2025-06-02 20:55:41'),
(69,NULL,'Test Account',NULL,'testnew@example.com',NULL,NULL,NULL,NULL,NULL,NULL,0,'2025-06-23 23:57:07'),
(70,NULL,'Kritesh Sharma - BN252','ICT','ksharma@baf.com.fj','8919900','Mr.',NULL,NULL,NULL,NULL,0,'2025-06-24 00:56:23'),
(71,NULL,'Ronald Prasad - BN029','Trade','rprasad@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-24 00:59:53'),
(72,NULL,'Mohammed Istikar - BN610','ICT','mohammed.istikar@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-24 01:01:23'),
(73,NULL,'Walesi Vulaono Soro - BN031','Operations','wvulaono@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-24 02:07:01'),
(74,NULL,'Tevita Tuikubulau Karikaritu - BN128','ICT','tkarikaritu@baf.com.fj',NULL,NULL,NULL,NULL,NULL,NULL,0,'2025-06-24 02:09:31'),
(75,NULL,'Mereseini Tawakilai Vubaya - BN197','Animals','mvubaya@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 03:08:41'),
(76,NULL,'Ronak Cylvian Sharma - BN196','Board','rcsharma@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 03:10:11'),
(77,NULL,'Yogesh Reddy - BN198','Animals','yreddy@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 03:10:41'),
(78,NULL,'Mohammed Ifraaz - BN207','Plants','mifraaz@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 03:11:40'),
(79,NULL,'Lora Eta Qiqiwaqa - BN246','Plants','lqiqiwaqa@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 03:12:11'),
(80,NULL,'Jiale Siga Mar - BN257','Admin','jmar@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 03:43:19'),
(81,NULL,'Haroon Buksh - BN267','Admin','hbuksh@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 03:58:49'),
(82,NULL,'Matilda Julia  Hazelman - BN296','Admin','mhazelman@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 03:59:49'),
(83,NULL,'Sylvia  Nandani Reddy - BN309','Trade','sreddy@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:00:19'),
(84,NULL,'Panapasa Meke - BN260','Finance','pmeke@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:01:19'),
(85,NULL,'Mereani Vakadromusiga - BN400','HR','mvakadromusiga@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:02:49'),
(86,NULL,'Sonam Kumar - BN435','HR','sonamk@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:03:49'),
(87,NULL,'Kalisiana Vuniwaqa - BN561','HR','kvuniwaqa@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:04:19'),
(88,NULL,'Hanrieta Sina Yadraca - BN574','Legal','hanrieta.yadraca@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:05:49'),
(89,NULL,'Livai Nakuta - BN339','ICT','lnakuta@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:25:30'),
(90,NULL,'Teria Ribauea - BN360','Finance','thedstrom@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:26:00'),
(91,NULL,'Nirlesh Niraj Lal - BN493','Finance','nirlesh_l@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:27:00'),
(92,NULL,'Veniana Wasarua Tuva - BN519','Admin','veniana_t@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:27:30'),
(93,NULL,'Aminio Tuisavusavu','Admin','atuisavusavu@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:32:00'),
(94,NULL,'Tuverea Tuamoto - BN547','Plants','tuverea_t@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:33:00'),
(95,NULL,'Rashnil Jai - BN556','Admin','rashnil.kumar@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:33:30'),
(96,NULL,'Repeka Tukula - BN566','Admin','repeka.tukula@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:34:00'),
(97,NULL,'Sera Rasiga - BN575','Finance','srasiga@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:34:30'),
(98,NULL,'Lily Pickering - BN611','Admin','lily.pickering@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:44:04'),
(99,NULL,'Arieta Marawaqa - BN612','Admin','arieta.marawaqa@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:44:34'),
(100,NULL,'Taina Mocemaiwaiyevo - BN645','Admin','taina.mocemaiwaiyevo@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:45:34'),
(101,NULL,'Edward James Newton - BN646','Communications','ejames@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:46:05'),
(102,NULL,'Surend Pratap - BN046','CEO','spratap@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:46:34'),
(103,NULL,'Nitesh Datt - BN219','Finance','cppo@baf.com.fj',NULL,'Mr.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:47:34'),
(104,NULL,'Iverlyn Maeta - BN655','Finance','iverlyn.maeta@baf.com.fj',NULL,'Ms.',NULL,NULL,NULL,NULL,0,'2025-06-26 04:48:04');

--
-- Table structure for table `employees2locations`
--

CREATE TABLE `employees2locations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `location_id` int(11) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `location_idx` (`location_id`)
) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `employees2locations`
--

INSERT INTO `employees2locations` VALUES
(1,28,1,0,'2025-06-22 21:59:23'),
(2,29,1,0,'2025-06-22 21:59:53'),
(3,30,1,0,'2025-06-22 22:00:24'),
(4,31,1,0,'2025-06-22 22:00:54'),
(5,32,1,0,'2025-06-22 22:01:30'),
(6,33,1,0,'2025-06-22 22:02:30'),
(7,34,1,0,'2025-06-22 22:03:30'),
(8,35,1,0,'2025-06-22 22:04:29'),
(9,36,1,0,'2025-06-22 22:05:29'),
(10,37,1,0,'2025-06-22 22:06:29'),
(11,38,1,0,'2025-06-22 22:07:29'),
(12,39,1,0,'2025-06-22 22:08:30'),
(13,40,1,0,'2025-06-22 22:09:30'),
(14,41,1,0,'2025-06-22 22:10:30'),
(15,42,1,0,'2025-06-22 22:11:29'),
(16,43,1,0,'2025-06-22 22:13:30'),
(17,44,1,0,'2025-06-22 22:14:30'),
(18,45,1,0,'2025-06-22 22:15:30'),
(19,46,1,0,'2025-06-22 22:16:18'),
(20,47,1,0,'2025-06-22 22:16:23'),
(21,48,1,0,'2025-06-22 22:16:53'),
(22,49,1,0,'2025-06-22 22:55:23'),
(26,52,1,0,'2025-06-23 03:07:37'),
(32,51,1,0,'2025-06-23 03:41:05'),
(33,54,1,0,'2025-06-23 03:41:35'),
(34,55,1,0,'2025-06-23 03:42:05'),
(35,57,1,0,'2025-06-23 03:42:35'),
(38,58,1,0,'2025-06-23 03:47:19'),
(39,56,1,0,'2025-06-23 03:49:07'),
(40,59,1,0,'2025-06-23 03:50:37'),
(41,60,1,0,'2025-06-23 03:54:08'),
(43,62,1,0,'2025-06-23 03:59:38'),
(44,63,1,0,'2025-06-23 04:00:38'),
(45,64,1,0,'2025-06-23 04:04:38'),
(46,65,1,0,'2025-06-23 04:08:08'),
(47,66,1,0,'2025-06-23 04:09:08'),
(48,67,1,0,'2025-06-23 20:32:20'),
(49,68,1,0,'2025-06-23 20:45:28'),
(50,69,1,0,'2025-06-23 23:57:07'),
(52,61,1,0,'2025-06-24 00:30:19'),
(53,50,1,0,'2025-06-24 00:33:28'),
(54,70,1,0,'2025-06-24 00:56:23'),
(55,71,1,0,'2025-06-24 00:59:53'),
(56,72,1,0,'2025-06-24 01:01:23'),
(57,73,1,0,'2025-06-24 02:07:01'),
(59,74,1,0,'2025-06-26 03:02:13'),
(61,76,1,0,'2025-06-26 03:10:11'),
(62,77,1,0,'2025-06-26 03:10:41'),
(63,78,1,0,'2025-06-26 03:11:40'),
(65,80,1,0,'2025-06-26 03:43:19'),
(67,82,1,0,'2025-06-26 03:59:49'),
(68,83,1,0,'2025-06-26 04:00:19'),
(69,84,1,0,'2025-06-26 04:01:19'),
(70,85,1,0,'2025-06-26 04:02:49'),
(71,86,1,0,'2025-06-26 04:03:49'),
(72,87,1,0,'2025-06-26 04:04:19'),
(73,88,1,0,'2025-06-26 04:05:49'),
(74,89,1,0,'2025-06-26 04:25:31'),
(75,90,1,0,'2025-06-26 04:26:01'),
(76,91,1,0,'2025-06-26 04:27:01'),
(77,92,1,0,'2025-06-26 04:27:31'),
(78,93,1,0,'2025-06-26 04:32:01'),
(79,94,1,0,'2025-06-26 04:33:01'),
(80,95,1,0,'2025-06-26 04:33:31'),
(81,96,1,0,'2025-06-26 04:34:01'),
(82,97,1,0,'2025-06-26 04:34:31'),
(83,98,1,0,'2025-06-26 04:44:05'),
(84,99,1,0,'2025-06-26 04:44:34'),
(85,100,1,0,'2025-06-26 04:45:34'),
(86,101,1,0,'2025-06-26 04:46:05'),
(87,102,1,0,'2025-06-26 04:46:34'),
(88,103,1,0,'2025-06-26 04:47:35'),
(89,104,1,0,'2025-06-26 04:48:04'),
(90,75,1,0,'2025-07-02 03:39:19'),
(91,79,1,0,'2025-07-02 03:40:25'),
(92,81,1,0,'2025-07-02 03:40:55');

--
-- Table structure for table `employees2users`
--

CREATE TABLE `employees2users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `user_idx` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `employees2users`
--

INSERT INTO `employees2users` VALUES
(6,17,1,0,'2025-06-02 20:55:41'),
(37,69,159,0,'2025-06-23 23:57:07'),
(38,50,160,0,'2025-06-24 00:30:18'),
(39,61,161,0,'2025-06-24 00:30:19'),
(40,70,204,0,'2025-06-24 00:56:23'),
(41,71,205,0,'2025-06-24 00:59:53'),
(42,72,206,0,'2025-06-24 01:01:23'),
(43,73,207,0,'2025-06-24 02:07:01'),
(44,74,350,0,'2025-06-24 02:09:31'),
(45,75,202,0,'2025-06-26 03:08:41'),
(46,76,352,0,'2025-06-26 03:10:11'),
(47,77,353,0,'2025-06-26 03:10:41'),
(48,78,354,0,'2025-06-26 03:11:40'),
(49,79,203,0,'2025-06-26 03:12:11'),
(50,80,356,0,'2025-06-26 03:43:19'),
(51,81,161,0,'2025-06-26 03:58:49'),
(52,82,358,0,'2025-06-26 03:59:49'),
(53,83,359,0,'2025-06-26 04:00:19'),
(54,84,360,0,'2025-06-26 04:01:19'),
(55,85,361,0,'2025-06-26 04:02:49'),
(56,86,362,0,'2025-06-26 04:03:49'),
(57,87,363,0,'2025-06-26 04:04:19'),
(58,88,364,0,'2025-06-26 04:05:49'),
(59,89,365,0,'2025-06-26 04:25:31'),
(60,90,366,0,'2025-06-26 04:26:01'),
(61,91,367,0,'2025-06-26 04:27:01'),
(62,92,368,0,'2025-06-26 04:27:31'),
(63,93,369,0,'2025-06-26 04:32:01'),
(64,94,370,0,'2025-06-26 04:33:01'),
(65,95,371,0,'2025-06-26 04:33:31'),
(66,96,372,0,'2025-06-26 04:34:01'),
(67,97,373,0,'2025-06-26 04:34:31'),
(68,98,374,0,'2025-06-26 04:44:05'),
(69,99,375,0,'2025-06-26 04:44:34'),
(70,100,376,0,'2025-06-26 04:45:34'),
(71,101,377,0,'2025-06-26 04:46:05'),
(72,102,378,0,'2025-06-26 04:46:34'),
(73,103,379,0,'2025-06-26 04:47:35'),
(74,104,380,0,'2025-06-26 04:48:04');

--
-- Table structure for table `exit_approvals`
--

CREATE TABLE `exit_approvals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exit_id` int(11) NOT NULL,
  `approver_id` int(11) NOT NULL,
  `level` int(11) NOT NULL,
  `status` varchar(50) DEFAULT 'pending',
  `approved_at` datetime DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `exit_approvals`
--


--
-- Table structure for table `exit_clearances`
--

CREATE TABLE `exit_clearances` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exit_id` int(11) NOT NULL,
  `item` varchar(100) DEFAULT NULL,
  `returned` tinyint(1) DEFAULT 0,
  `access_revoked` tinyint(1) DEFAULT 0,
  `notes` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `exit_clearances`
--


--
-- Table structure for table `exit_feedback`
--

CREATE TABLE `exit_feedback` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exit_interview_id` int(11) NOT NULL,
  `question` varchar(255) DEFAULT NULL,
  `response` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `exit_feedback`
--


--
-- Table structure for table `exit_interviews`
--

CREATE TABLE `exit_interviews` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `exit_id` int(11) NOT NULL,
  `interviewer_id` int(11) DEFAULT NULL,
  `scheduled_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `exit_interviews`
--


--
-- Table structure for table `feedback_notes`
--

CREATE TABLE `feedback_notes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `from_user_id` int(11) NOT NULL,
  `to_user_id` int(11) NOT NULL,
  `note` text NOT NULL,
  `is_private` tinyint(1) DEFAULT 1,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `feedback_notes`
--


--
-- Table structure for table `gl_accounts`
--

CREATE TABLE `gl_accounts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(50) NOT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(50) NOT NULL,
  `tags` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `parent_id` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `gl_accounts`
--

INSERT INTO `gl_accounts` VALUES
(1,'1000','Cash','asset','bank',1,NULL,0,'2025-06-02 20:55:41'),
(2,'2000','Accounts Payable','liability','ap',1,NULL,0,'2025-06-02 20:55:41'),
(3,'4000','Sales Revenue','revenue','income',1,NULL,0,'2025-06-02 20:55:41');

--
-- Table structure for table `gl_recurring_entries`
--

CREATE TABLE `gl_recurring_entries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `description` varchar(255) NOT NULL,
  `account_id` int(11) NOT NULL,
  `type` enum('debit','credit') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `frequency` enum('daily','weekly','monthly','yearly') NOT NULL,
  `next_run_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `gl_recurring_entries`
--


--
-- Table structure for table `gl_transactions`
--

CREATE TABLE `gl_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `journal_entry_id` int(11) NOT NULL,
  `account_id` int(11) NOT NULL,
  `type` enum('debit','credit') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `currency` varchar(10) DEFAULT 'USD',
  `rate` decimal(15,6) DEFAULT 1.000000,
  `timestamp` datetime NOT NULL,
  `memo` text DEFAULT NULL,
  `reference` varchar(100) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `gl_transactions`
--

INSERT INTO `gl_transactions` VALUES
(1,1,1,'debit',1000.00,'USD',1.000000,'2025-06-02 20:55:41','Opening cash','JE001-1',0,'2025-06-02 20:55:41'),
(2,1,3,'credit',1000.00,'USD',1.000000,'2025-06-02 20:55:41','Opening equity','JE001-2',0,'2025-06-02 20:55:41');

--
-- Table structure for table `goods_receipts`
--

CREATE TABLE `goods_receipts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `purchase_order_id` int(11) NOT NULL,
  `received_date` date DEFAULT NULL,
  `quantity_received` int(11) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `goods_receipts`
--


--
-- Table structure for table `group_permissions`
--

CREATE TABLE `group_permissions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_id` int(11) NOT NULL,
  `resource_id` int(11) NOT NULL,
  `can_view` tinyint(1) DEFAULT 0,
  `can_edit` tinyint(1) DEFAULT 0,
  `can_create` tinyint(1) DEFAULT 0,
  `can_delete` tinyint(1) DEFAULT 0,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `group_permissions`
--

INSERT INTO `group_permissions` VALUES
(1,2,1,1,1,1,1,0,'2025-06-02 20:55:41'),
(2,2,2,1,1,1,1,0,'2025-06-02 20:55:41'),
(3,3,1,1,0,0,0,0,'2025-06-02 20:55:41'),
(4,2,3,1,1,1,1,0,'2025-06-02 20:55:41'),
(5,3,3,1,0,0,0,0,'2025-06-02 20:55:41');

--
-- Table structure for table `groups`
--

CREATE TABLE `groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `groups`
--

INSERT INTO `groups` VALUES
(1,'HR Admin Group','Full access group',NULL,0,'2025-06-02 20:55:41'),
(2,'Finance Team','Handles company finances',NULL,0,'2025-06-02 20:55:41'),
(3,'Sales Team','Responsible for sales',NULL,0,'2025-06-02 20:55:41');

--
-- Table structure for table `interview_feedback`
--

CREATE TABLE `interview_feedback` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `interview_id` int(11) NOT NULL,
  `reviewer_id` int(11) NOT NULL,
  `score` int(11) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `interview_feedback`
--


--
-- Table structure for table `interview_logs`
--

CREATE TABLE `interview_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `case_id` int(11) NOT NULL,
  `person` varchar(255) NOT NULL,
  `notes` text DEFAULT NULL,
  `logged_at` datetime DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `interview_logs`
--

INSERT INTO `interview_logs` VALUES
(1,1,'Bob Smith','Employee admitted being late due to traffic','2025-06-02 20:55:41',0,'2025-06-02 20:55:41');

--
-- Table structure for table `interview_participants`
--

CREATE TABLE `interview_participants` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `interview_id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `role` varchar(100) DEFAULT NULL,
  `rsvp_status` varchar(50) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `interview_participants`
--


--
-- Table structure for table `interview_stages`
--

CREATE TABLE `interview_stages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `sequence` int(11) NOT NULL,
  `description` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `interview_stages`
--


--
-- Table structure for table `interviews`
--

CREATE TABLE `interviews` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `application_id` int(11) DEFAULT NULL,
  `stage_id` int(11) DEFAULT NULL,
  `calendar_event_id` int(11) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `scheduled_start` datetime DEFAULT NULL,
  `scheduled_end` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `interviews`
--


--
-- Table structure for table `jobs`
--

CREATE TABLE `jobs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `jobs`
--

INSERT INTO `jobs` VALUES
(1,'Software Engineer',0,'2025-06-02 20:55:41'),
(2,'Sales Representative',0,'2025-06-02 20:55:41'),
(3,'HR Specialist',0,'2025-06-02 20:55:41');

--
-- Table structure for table `leave_requests`
--

CREATE TABLE `leave_requests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employeeName` varchar(100) NOT NULL,
  `leaveType` varchar(50) NOT NULL,
  `startDate` date NOT NULL,
  `endDate` date NOT NULL,
  `reason` text DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'Pending',
  `createdBy` int(11) DEFAULT NULL,
  `approvedAt` datetime DEFAULT NULL,
  `approvedBy` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `leave_requests`
--

INSERT INTO `leave_requests` VALUES
(1,'Alice Johnson','Annual Leave','2025-07-01','2025-07-10','Vacation','Approved',1,'2025-06-15 00:00:00',1,0,'2025-06-02 20:55:41'),
(2,'Bob Smith','Sick Leave','2025-06-02','2025-06-05','Flu','Approved',1,'2025-06-01 00:00:00',1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `leave_types`
--

CREATE TABLE `leave_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `code` varchar(10) NOT NULL,
  `description` text DEFAULT NULL,
  `daysPerYear` int(11) NOT NULL,
  `accrualType` varchar(50) NOT NULL,
  `carryForward` tinyint(1) NOT NULL DEFAULT 0,
  `maxCarry` int(11) DEFAULT NULL,
  `approvalRequired` tinyint(1) NOT NULL DEFAULT 1,
  `paid` tinyint(1) NOT NULL DEFAULT 1,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `createdBy` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `leave_types`
--

INSERT INTO `leave_types` VALUES
(1,'Annual Leave','AL','Paid annual leave',20,'monthly',1,10,1,1,1,1,0,'2025-06-02 20:55:41'),
(2,'Sick Leave','SL','Paid sick leave',10,'yearly',0,NULL,0,1,1,1,0,'2025-06-02 20:55:41'),
(3,'Unpaid Leave','UL','Leave without pay',0,'none',0,NULL,1,0,1,1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `locations`
--

CREATE TABLE `locations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `latitude` decimal(10,6) DEFAULT NULL,
  `longitude` decimal(10,6) DEFAULT NULL,
  `company_id` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `radius_m` int(11) NOT NULL DEFAULT 50,
  PRIMARY KEY (`id`),
  KEY `company_idx` (`company_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `locations`
--

INSERT INTO `locations` VALUES
(1,'Suva Headquarters',-18.139796,178.426563,1,0,'2025-06-02 20:55:41',10),
(2,'Sigatoka Office',-18.145800,177.506500,1,0,'2025-06-02 20:55:41',50),
(3,'Suva Export',-18.129200,178.426500,1,0,'2025-06-02 20:55:41',50),
(4,'Nadi Office',-17.753300,177.443500,1,0,'2025-06-02 20:55:41',50),
(5,'Lautoka Office',-17.616700,177.466700,1,0,'2025-06-02 20:55:41',50),
(6,'Ba Office',-17.534100,177.683800,1,0,'2025-06-02 20:55:41',50),
(7,'Nausori Office',-18.024400,178.545100,1,0,'2025-06-02 20:55:41',50),
(8,'Labasa Office',-16.430200,179.382200,1,0,'2025-06-02 20:55:41',50),
(9,'Nausori Station',-18.024400,178.545100,1,0,'2025-06-02 20:55:41',50),
(10,'Savusavu',-16.779400,179.331400,1,0,'2025-06-02 20:55:41',50),
(11,'Navua Station',-18.219400,178.159200,1,0,'2025-06-02 20:55:41',50),
(12,'Rakiraki Office',-17.365800,178.165000,1,0,'2025-06-02 20:55:41',50),
(13,'Rotuma',-12.502500,177.072000,1,0,'2025-06-02 20:55:41',50),
(14,'Lab',-18.049100,178.529800,1,0,'2025-06-02 20:55:41',50),
(15,'Suva Wharf Office',NULL,NULL,NULL,0,'2025-08-04 00:53:17',10);

--
-- Table structure for table `notification_log`
--

CREATE TABLE `notification_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(50) NOT NULL,
  `recipient` varchar(255) NOT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `message` text DEFAULT NULL,
  `status` varchar(20) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `notification_log`
--

INSERT INTO `notification_log` VALUES
(1,'email','alice.johnson@example.com','Welcome','Welcome to the company!','sent',0,'2025-06-02 20:55:41');

--
-- Table structure for table `ohs_actions`
--

CREATE TABLE `ohs_actions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `incident_id` int(11) NOT NULL,
  `description` text DEFAULT NULL,
  `responsible_user_id` int(11) DEFAULT NULL,
  `target_date` date DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_actions`
--


--
-- Table structure for table `ohs_emergency_contacts`
--

CREATE TABLE `ohs_emergency_contacts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `contact_name` varchar(255) NOT NULL,
  `phone` varchar(50) NOT NULL,
  `relation` varchar(100) DEFAULT NULL,
  `pendingSync` tinyint(1) DEFAULT 0,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_emergency_contacts`
--


--
-- Table structure for table `ohs_emergency_drills`
--

CREATE TABLE `ohs_emergency_drills` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `drill_type` varchar(100) NOT NULL,
  `scheduled_for` datetime NOT NULL,
  `conducted_by` int(11) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `reminder_sent` tinyint(1) DEFAULT 0,
  `pendingSync` tinyint(1) DEFAULT 0,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_emergency_drills`
--


--
-- Table structure for table `ohs_hazards`
--

CREATE TABLE `ohs_hazards` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `description` text DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `risk_level` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_hazards`
--


--
-- Table structure for table `ohs_health_checks`
--

CREATE TABLE `ohs_health_checks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `check_type` varchar(100) NOT NULL,
  `result` text DEFAULT NULL,
  `check_date` date NOT NULL,
  `notes` text DEFAULT NULL,
  `pendingSync` tinyint(1) DEFAULT 0,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_health_checks`
--


--
-- Table structure for table `ohs_incident_files`
--

CREATE TABLE `ohs_incident_files` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `incident_id` int(11) NOT NULL,
  `file_path` varchar(255) DEFAULT NULL,
  `uploaded_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_incident_files`
--


--
-- Table structure for table `ohs_incidents`
--

CREATE TABLE `ohs_incidents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `injury_date` date DEFAULT NULL,
  `injury_time` time DEFAULT NULL,
  `classification` enum('injury','property_damage','environmental','near_miss') NOT NULL DEFAULT 'injury',
  `nature` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `workplace_part` varchar(255) DEFAULT NULL,
  `activity` varchar(255) DEFAULT NULL,
  `unexpected` text DEFAULT NULL,
  `how_sustained` text DEFAULT NULL,
  `preferred_language` varchar(100) DEFAULT NULL,
  `employment_type` varchar(100) DEFAULT NULL,
  `employee_type` varchar(100) DEFAULT NULL,
  `experience` varchar(100) DEFAULT NULL,
  `completed_by` varchar(100) DEFAULT NULL,
  `position` varchar(100) DEFAULT NULL,
  `signature` varchar(255) DEFAULT NULL,
  `completion_date` date DEFAULT NULL,
  `rehabilitation` varchar(100) DEFAULT NULL,
  `outcome` varchar(255) DEFAULT NULL,
  `preventative_action` text DEFAULT NULL,
  `resumption_date` date DEFAULT NULL,
  `days_lost` int(11) DEFAULT NULL,
  `required_training_id` int(11) DEFAULT NULL,
  `damaged_item_id` int(11) DEFAULT NULL,
  `status` enum('reported','investigating','closed') NOT NULL DEFAULT 'reported',
  `pendingSync` tinyint(1) DEFAULT 0,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_incidents`
--


--
-- Table structure for table `ohs_inspection_items`
--

CREATE TABLE `ohs_inspection_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `inspection_id` int(11) NOT NULL,
  `question` varchar(255) NOT NULL,
  `response` varchar(100) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `corrective_action` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_inspection_items`
--


--
-- Table structure for table `ohs_inspections`
--

CREATE TABLE `ohs_inspections` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `location` varchar(255) DEFAULT NULL,
  `inspector_id` int(11) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_inspections`
--


--
-- Table structure for table `ohs_medicals`
--

CREATE TABLE `ohs_medicals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `incident_id` int(11) NOT NULL,
  `health_check_id` int(11) DEFAULT NULL,
  `surname` varchar(100) DEFAULT NULL,
  `first_name` varchar(100) DEFAULT NULL,
  `other_initials` varchar(100) DEFAULT NULL,
  `sex` varchar(10) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `job_title` varchar(100) DEFAULT NULL,
  `occ_years` int(11) DEFAULT NULL,
  `occ_months` int(11) DEFAULT NULL,
  `occ_days` int(11) DEFAULT NULL,
  `employment_status` varchar(100) DEFAULT NULL,
  `incident_date` date DEFAULT NULL,
  `incident_time` time DEFAULT NULL,
  `incident_type` varchar(255) DEFAULT NULL,
  `agency` varchar(255) DEFAULT NULL,
  `incident_description` text DEFAULT NULL,
  `damage_location` text DEFAULT NULL,
  `corrective_action` varchar(255) DEFAULT NULL,
  `action_date` date DEFAULT NULL,
  `medical_treatment` varchar(255) DEFAULT NULL,
  `medical_practitioner` varchar(255) DEFAULT NULL,
  `date_notified` date DEFAULT NULL,
  `incapacity_years` int(11) DEFAULT NULL,
  `incapacity_months` int(11) DEFAULT NULL,
  `incapacity_days` int(11) DEFAULT NULL,
  `employer_signature` varchar(255) DEFAULT NULL,
  `employer_date` date DEFAULT NULL,
  `employee_signature` varchar(255) DEFAULT NULL,
  `employee_date` date DEFAULT NULL,
  `pendingSync` tinyint(1) DEFAULT 0,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_medicals`
--


--
-- Table structure for table `ohs_risk_reviews`
--

CREATE TABLE `ohs_risk_reviews` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `hazard_id` int(11) NOT NULL,
  `reviewer_id` int(11) DEFAULT NULL,
  `review_date` date DEFAULT NULL,
  `residual_risk` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_risk_reviews`
--


--
-- Table structure for table `ohs_root_causes`
--

CREATE TABLE `ohs_root_causes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `incident_id` int(11) NOT NULL,
  `method` varchar(100) DEFAULT NULL,
  `analysis_notes` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ohs_root_causes`
--


--
-- Table structure for table `open_positions`
--

CREATE TABLE `open_positions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `position` varchar(255) DEFAULT NULL,
  `applicant_type` enum('All','Internal Only','External Only') DEFAULT 'All',
  `open_date` date DEFAULT NULL,
  `close_date` date DEFAULT NULL,
  `department` text DEFAULT NULL,
  `qualifications` text DEFAULT NULL,
  `salary` decimal(10,2) DEFAULT NULL,
  `status` enum('Open','Closed','Pending') DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `open_positions`
--

INSERT INTO `open_positions` VALUES
(1,'Junior Developer','Entry level role','Suva',NULL,'All',NULL,NULL,'Engineering',NULL,NULL,'Open',1,0,'2025-06-02 20:55:41'),
(2,'Sales Intern','Assist sales team','Nadi',NULL,'All',NULL,NULL,'Sales',NULL,NULL,'Open',1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `overtime_rules`
--

CREATE TABLE `overtime_rules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `scope` enum('country','company') DEFAULT 'company',
  `country_id` int(11) DEFAULT NULL,
  `company_id` int(11) DEFAULT NULL,
  `shift_hours` int(11) NOT NULL,
  `first4_rate` decimal(5,2) DEFAULT 1.50,
  `after4_rate` decimal(5,2) DEFAULT 2.00,
  `holiday_rate` decimal(5,2) DEFAULT 2.00,
  `sixth_day_rate` decimal(5,2) DEFAULT 2.00,
  `seventh_day_rate` decimal(5,2) DEFAULT 2.00,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `country_idx` (`country_id`),
  KEY `company_idx` (`company_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `overtime_rules`
--

INSERT INTO `overtime_rules` VALUES
(1,'country',1,NULL,9,1.50,2.00,2.00,2.00,2.00,0,'2025-06-02 20:55:41'),
(2,'country',1,NULL,8,1.50,2.00,2.00,2.00,2.00,0,'2025-06-02 20:55:41'),
(3,'country',2,NULL,8,1.50,2.00,2.00,2.00,2.00,0,'2025-06-02 20:55:41'),
(4,'country',3,NULL,8,1.50,2.00,2.00,2.00,2.00,0,'2025-06-02 20:55:41');

--
-- Table structure for table `pay_cycles`
--

CREATE TABLE `pay_cycles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `frequency` enum('weekly','fortnightly','bi-monthly','monthly') NOT NULL,
  `pay_day` varchar(20) DEFAULT NULL,
  `cutoff_offset` int(11) DEFAULT 0,
  `next_run_date` date NOT NULL,
  `locale` varchar(10) DEFAULT 'en_US',
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pay_cycles`
--

INSERT INTO `pay_cycles` VALUES
(1,'Weekly','weekly','Friday',0,'2025-06-07','en_US',0,'2025-06-02 20:55:41'),
(2,'Fortnightly','fortnightly','Tuesday',4,'2025-06-14','en_US',0,'2025-06-02 20:55:41'),
(3,'Bi-Monthly-15','bi-monthly','15',2,'2025-06-15','en_US',0,'2025-06-02 20:55:41'),
(4,'Bi-Monthly-30','bi-monthly','30',2,'2025-06-30','en_US',0,'2025-06-02 20:55:41'),
(5,'Monthly','monthly','30',2,'2025-06-30','en_US',0,'2025-06-02 20:55:41');

--
-- Table structure for table `pay_rules`
--

CREATE TABLE `pay_rules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rule_name` varchar(100) NOT NULL,
  `overtime_rate` decimal(5,2) DEFAULT 1.50,
  `threshold_hours` int(11) DEFAULT 40,
  `notes` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pay_rules`
--

INSERT INTO `pay_rules` VALUES
(1,'Standard OT',1.50,40,'Overtime after 40 hours',0,'2025-06-02 20:55:41'),
(2,'Holiday OT',2.00,0,'Double pay on holidays',0,'2025-06-02 20:55:41');

--
-- Table structure for table `payroll_adjustments`
--

CREATE TABLE `payroll_adjustments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `payroll_period_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `adjustment_type` enum('earning','deduction') NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payroll_adjustments`
--

INSERT INTO `payroll_adjustments` VALUES
(1,1,1,'Bonus',500.00,'earning',0,'2025-06-02 20:55:41'),
(2,2,1,'Health Insurance',-200.00,'deduction',0,'2025-06-02 20:55:41');

--
-- Table structure for table `payroll_anomalies`
--

CREATE TABLE `payroll_anomalies` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payroll_run_id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `message` varchar(255) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `run_idx` (`payroll_run_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payroll_anomalies`
--

INSERT INTO `payroll_anomalies` VALUES
(1,1,2,'Missing timesheet',0,'2025-06-02 20:55:41');

--
-- Table structure for table `payroll_periods`
--

CREATE TABLE `payroll_periods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pay_cycle_id` int(11) NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payroll_periods`
--

INSERT INTO `payroll_periods` VALUES
(1,2,'2025-05-02','2025-05-15',0,'2025-06-02 20:55:41'),
(2,2,'2025-05-16','2025-05-29',0,'2025-06-02 20:55:41'),
(3,2,'2025-05-30','2025-06-05',0,'2025-06-02 20:55:41'),
(4,2,'2025-06-09','2025-06-20',0,'2025-06-02 20:55:41');

--
-- Table structure for table `payroll_runs`
--

CREATE TABLE `payroll_runs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payroll_period_id` int(11) NOT NULL,
  `run_date` date NOT NULL,
  `status` varchar(50) DEFAULT NULL,
  `location_id` int(11) DEFAULT NULL,
  `submitted_by` int(11) DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payroll_runs`
--

INSERT INTO `payroll_runs` VALUES
(1,1,'2025-06-07','completed',NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(2,2,'2025-06-07','completed',NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(3,3,'2025-06-01','completed',NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(4,4,'2025-06-21','completed',NULL,NULL,NULL,0,'2025-06-02 20:55:41');

--
-- Table structure for table `payslip_lines`
--

CREATE TABLE `payslip_lines` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payslip_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `line_type` enum('earning','deduction') NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payslip_lines`
--

INSERT INTO `payslip_lines` VALUES
(1,1,'Base Salary',5000.00,'earning',0,'2025-06-02 20:55:41'),
(2,1,'Tax',-1000.00,'deduction',0,'2025-06-02 20:55:41'),
(3,2,'Base Salary',6666.67,'earning',0,'2025-06-02 20:55:41'),
(4,2,'Tax',-1466.67,'deduction',0,'2025-06-02 20:55:41'),
(5,4,'Base Salary',2307.69,'earning',0,'2025-06-02 20:55:41'),
(6,4,'Employee Superannuation',184.62,'deduction',0,'2025-06-02 20:55:41'),
(7,4,'PAYE',215.38,'deduction',0,'2025-06-02 20:55:41'),
(8,4,'Employer Superannuation',230.77,'earning',0,'2025-06-02 20:55:41'),
(9,5,'Base Salary',3076.92,'earning',0,'2025-06-02 20:55:41'),
(10,5,'Employee Superannuation',246.15,'deduction',0,'2025-06-02 20:55:41'),
(11,5,'PAYE',369.23,'deduction',0,'2025-06-02 20:55:41'),
(12,5,'Employer Superannuation',307.69,'earning',0,'2025-06-02 20:55:41'),
(13,6,'Base Salary',1923.08,'earning',0,'2025-06-02 20:55:41'),
(14,6,'Employee Superannuation',153.85,'deduction',0,'2025-06-02 20:55:41'),
(15,6,'PAYE',138.46,'deduction',0,'2025-06-02 20:55:41'),
(16,6,'Employer Superannuation',192.31,'earning',0,'2025-06-02 20:55:41'),
(17,7,'Base Salary',2884.62,'earning',0,'2025-06-02 20:55:41'),
(18,7,'Employee Superannuation',230.77,'deduction',0,'2025-06-02 20:55:41'),
(19,7,'PAYE',330.77,'deduction',0,'2025-06-02 20:55:41'),
(20,7,'Employer Superannuation',288.46,'earning',0,'2025-06-02 20:55:41'),
(21,8,'Base Salary',1730.77,'earning',0,'2025-06-02 20:55:41'),
(22,8,'Employee Superannuation',138.46,'deduction',0,'2025-06-02 20:55:41'),
(23,8,'PAYE',103.85,'deduction',0,'2025-06-02 20:55:41'),
(24,8,'Employer Superannuation',173.08,'earning',0,'2025-06-02 20:55:41');

--
-- Table structure for table `payslips`
--

CREATE TABLE `payslips` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payroll_run_id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `gross_pay` decimal(10,2) DEFAULT 0.00,
  `net_pay` decimal(10,2) DEFAULT 0.00,
  `document_path` text DEFAULT NULL,
  `verified_by` int(11) DEFAULT NULL,
  `verified_at` datetime DEFAULT NULL,
  `verification_notes` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payslips`
--

INSERT INTO `payslips` VALUES
(1,1,1,5000.00,4000.00,'/docs/payslips/1.pdf',NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(2,1,2,6666.67,5200.00,'/docs/payslips/2.pdf',NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(3,2,3,4166.67,3400.00,'/docs/payslips/3.pdf',NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(4,4,1,2307.69,1907.69,NULL,NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(5,4,2,3076.92,2461.54,NULL,NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(6,4,3,1923.08,1630.77,NULL,NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(7,4,4,2884.62,2323.08,NULL,NULL,NULL,NULL,0,'2025-06-02 20:55:41'),
(8,4,5,1730.77,1488.46,NULL,NULL,NULL,NULL,0,'2025-06-02 20:55:41');

--
-- Table structure for table `performance_goals`
--

CREATE TABLE `performance_goals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `description` text NOT NULL,
  `due_date` date DEFAULT NULL,
  `status` varchar(50) DEFAULT 'pending',
  `progress_pct` decimal(5,2) DEFAULT 0.00,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `performance_goals`
--


--
-- Table structure for table `performance_reviews`
--

CREATE TABLE `performance_reviews` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `cycle_id` int(11) NOT NULL,
  `self_rating` decimal(3,2) DEFAULT NULL,
  `manager_rating` decimal(3,2) DEFAULT NULL,
  `comments` text DEFAULT NULL,
  `status` varchar(50) DEFAULT 'draft',
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `performance_reviews`
--


--
-- Table structure for table `permit_applications`
--

CREATE TABLE `permit_applications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `permit_type_id` int(11) NOT NULL,
  `applicant_id` int(11) NOT NULL,
  `status` varchar(50) DEFAULT 'Pending',
  `fee_amount` decimal(10,2) DEFAULT 0.00,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `permit_applications`
--


--
-- Table structure for table `permit_documents`
--

CREATE TABLE `permit_documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `permit_application_id` int(11) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `file_type` varchar(50) NOT NULL,
  `file_path` text NOT NULL,
  `uploaded_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `permit_documents`
--


--
-- Table structure for table `permit_inspections`
--

CREATE TABLE `permit_inspections` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `permit_application_id` int(11) NOT NULL,
  `inspector_id` int(11) NOT NULL,
  `scheduled_for` datetime DEFAULT NULL,
  `result` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `hours_logged` decimal(5,2) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `permit_inspections`
--


--
-- Table structure for table `permit_types`
--

CREATE TABLE `permit_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `permit_types`
--


--
-- Table structure for table `po_line_items`
--

CREATE TABLE `po_line_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `purchase_order_id` int(11) NOT NULL,
  `description` text NOT NULL,
  `quantity` int(11) DEFAULT NULL,
  `unit_price` decimal(10,2) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `po_line_items`
--


--
-- Table structure for table `procurement_requests`
--

CREATE TABLE `procurement_requests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `description` text NOT NULL,
  `justification` text DEFAULT NULL,
  `estimated_cost` decimal(10,2) DEFAULT NULL,
  `quantity` int(11) DEFAULT NULL,
  `preferred_vendor` varchar(100) DEFAULT NULL,
  `needed_by` date DEFAULT NULL,
  `location_id` int(11) DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'Pending',
  `requester_id` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `procurement_requests`
--

INSERT INTO `procurement_requests` VALUES
(1,'Office Chairs','Replace old chairs',1200.00,10,'Fiji Furniture','2025-07-01',NULL,'Pending',1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `properties`
--

CREATE TABLE `properties` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `CouncilID` int(11) DEFAULT NULL,
  `PropertyID` int(11) NOT NULL,
  `AssessmentNumber` int(11) NOT NULL,
  `RatepayerID` int(11) DEFAULT NULL,
  `Zone` varchar(100) DEFAULT NULL,
  `Address` text DEFAULT NULL,
  `Street` varchar(255) DEFAULT NULL,
  `Ward` varchar(100) DEFAULT NULL,
  `LegalDescription` text DEFAULT NULL,
  `NoOfFlats` int(11) DEFAULT NULL,
  `IsActive` tinyint(1) DEFAULT 1,
  `CreatedBy` int(11) DEFAULT NULL,
  `propertyHoldersName` varchar(255) DEFAULT NULL,
  `UCV` decimal(10,2) NOT NULL,
  `RatesStrick` decimal(3,2) NOT NULL,
  `Arrears` decimal(10,2) NOT NULL,
  `AdvancePayment` decimal(10,2) NOT NULL,
  `GarbageFee` decimal(10,2) NOT NULL,
  `GarbageArrears` decimal(10,2) NOT NULL,
  `AdvancePay` decimal(10,2) NOT NULL,
  `LegalFee` decimal(10,2) NOT NULL,
  `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `properties`
--


--
-- Table structure for table `property_rates`
--

CREATE TABLE `property_rates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `Zone` varchar(100) DEFAULT NULL,
  `SubZone` varchar(100) DEFAULT NULL,
  `Category` varchar(100) DEFAULT NULL,
  `BaseRate` decimal(10,2) DEFAULT NULL,
  `RatePer100` decimal(10,2) DEFAULT NULL,
  `RateType` varchar(50) DEFAULT NULL,
  `RateStrick2024` decimal(10,2) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `property_rates`
--


--
-- Table structure for table `purchase_orders`
--

CREATE TABLE `purchase_orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rfq_id` int(11) DEFAULT NULL,
  `vendor_id` int(11) NOT NULL,
  `order_date` date DEFAULT NULL,
  `status` varchar(50) DEFAULT 'Open',
  `total_amount` decimal(10,2) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `purchase_orders`
--


--
-- Table structure for table `purchase_requests`
--

CREATE TABLE `purchase_requests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `description` text NOT NULL,
  `justification` text DEFAULT NULL,
  `estimated_cost` decimal(10,2) DEFAULT NULL,
  `quantity` int(11) DEFAULT NULL,
  `preferred_vendor` varchar(100) DEFAULT NULL,
  `needed_by` date DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `purchase_requests`
--

INSERT INTO `purchase_requests` VALUES
(1,'Laptop','New hire equipment',1500.00,1,'Computer World','2025-06-15',1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `rate_invoices`
--

CREATE TABLE `rate_invoices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `CouncilID` int(11) DEFAULT NULL,
  `RateID` int(11) NOT NULL,
  `PropertyID` int(11) DEFAULT NULL,
  `Period` date DEFAULT NULL,
  `Arrears` decimal(10,2) DEFAULT NULL,
  `CurrentCharges` decimal(10,2) DEFAULT NULL,
  `Penalty` decimal(10,2) DEFAULT NULL,
  `TotalDue` decimal(10,2) DEFAULT NULL,
  `ReceiptsTotal` decimal(10,2) DEFAULT NULL,
  `Balance` decimal(10,2) DEFAULT NULL,
  `CreatedBy` int(11) DEFAULT NULL,
  `customerId` int(11) DEFAULT NULL,
  `gl_transaction_id` int(11) DEFAULT NULL,
  `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `rate_invoices`
--


--
-- Table structure for table `rate_payments`
--

CREATE TABLE `rate_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `CouncilID` int(11) DEFAULT NULL,
  `ReceiptID` int(11) NOT NULL,
  `PropertyID` int(11) DEFAULT NULL,
  `RateID` int(11) DEFAULT NULL,
  `ReferenceNo` varchar(100) DEFAULT NULL,
  `Amount` decimal(10,2) DEFAULT NULL,
  `ReceiptDate` date DEFAULT NULL,
  `Method` varchar(50) DEFAULT NULL,
  `UploadedBy` varchar(100) DEFAULT NULL,
  `ScreenshotPath` text DEFAULT NULL,
  `CreatedBy` int(11) DEFAULT NULL,
  `gl_transaction_id` int(11) DEFAULT NULL,
  `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `rate_payments`
--


--
-- Table structure for table `ratepayers`
--

CREATE TABLE `ratepayers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `CouncilID` int(11) DEFAULT NULL,
  `RatepayerID` int(11) NOT NULL,
  `FullName` varchar(255) DEFAULT NULL,
  `PreviousOwner` varchar(255) DEFAULT NULL,
  `TINNumber` varchar(100) DEFAULT NULL,
  `Notes` text DEFAULT NULL,
  `IsDeceased` tinyint(1) DEFAULT 0,
  `IsOverseasOwner` tinyint(1) DEFAULT 0,
  `WorkPlace` varchar(255) DEFAULT NULL,
  `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ratepayers`
--


--
-- Table structure for table `reimbursement_claims`
--

CREATE TABLE `reimbursement_claims` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `claim_date` date NOT NULL,
  `description` text DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `status` enum('Pending','Approved','Rejected') DEFAULT 'Pending',
  `approved_at` datetime DEFAULT NULL,
  `approved_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `reimbursement_claims`
--


--
-- Table structure for table `resources`
--

CREATE TABLE `resources` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `resources`
--


--
-- Table structure for table `review_cycles`
--

CREATE TABLE `review_cycles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `review_cycles`
--


--
-- Table structure for table `rfq_items`
--

CREATE TABLE `rfq_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rfq_id` int(11) NOT NULL,
  `description` text NOT NULL,
  `quantity` int(11) DEFAULT NULL,
  `unit_price` decimal(10,2) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `rfq_items`
--


--
-- Table structure for table `rfqs`
--

CREATE TABLE `rfqs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `procurement_request_id` int(11) NOT NULL,
  `vendor_id` int(11) NOT NULL,
  `status` varchar(50) DEFAULT 'pending',
  `sent_at` datetime DEFAULT NULL,
  `due_at` datetime DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `rfqs`
--


--
-- Table structure for table `roles_permissions`
--

CREATE TABLE `roles_permissions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `role` varchar(100) NOT NULL,
  `inheritedFrom` varchar(100) DEFAULT NULL,
  `permissions` text NOT NULL,
  `createdBy` int(11) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `roles_permissions`
--

INSERT INTO `roles_permissions` VALUES
(1,'Super Admin',NULL,'{\"*\": [\"*\"]}',1,0,'2025-06-02 20:55:41'),
(2,'Procurement Manager',NULL,'{\n        \"procurement_requests\": [\"getAll\",\"create\",\"update\",\"delete\",\"approve\",\"reject\"],\n        \"purchase_requests\": [\"getAll\",\"create\",\"update\",\"delete\",\"approve\",\"reject\"],\n        \"rfqs\": [\"getAll\",\"create\",\"update\",\"delete\",\"approve\",\"close\"],\n        \"purchase_orders\": [\"getAll\",\"create\",\"update\",\"delete\",\"approve\",\"close\"],\n        \"goods_receipts\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"vendor_invoices\": [\"getAll\",\"create\",\"update\",\"delete\",\"approve\"],\n        \"vendors\": [\"getAll\",\"create\",\"update\",\"delete\"]\n    }',1,0,'2025-06-02 20:55:41'),
(3,'Finance Approver',NULL,'{\n        \"procurement_requests\": [\"getAll\",\"approve\"],\n        \"rfqs\": [\"getAll\",\"approve\"],\n        \"purchase_orders\": [\"getAll\",\"approve\"],\n        \"vendor_invoices\": [\"getAll\",\"approve\"]\n    }',1,0,'2025-06-02 20:55:41'),
(4,'CEO Approver',NULL,'{\n        \"procurement_requests\": [\"getAll\",\"approve\"],\n        \"rfqs\": [\"getAll\",\"approve\"],\n        \"purchase_orders\": [\"getAll\",\"approve\"],\n        \"vendor_invoices\": [\"getAll\",\"approve\"]\n    }',1,0,'2025-06-02 20:55:41'),
(5,'Employee',NULL,'{\n        \"disciplinary_cases\": [\"getById\"],\n        \"appeals\": [\"submit\",\"getById\"],\n        \"purchase_requests\": [\"getAll\",\"create\",\"update\"],\n        \"time_clocks\": [\"getAll\"],\n        \"payroll_periods\": [\"getAll\"]\n    }',1,0,'2025-06-02 20:55:41'),
(6,'HR Administrator',NULL,'{\n        \"attendance\": [\"getAll\",\"create\",\"update\",\"delete\",\"approve\",\"reject\"],\n        \"employees\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"employee_types\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"users\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"time_clock_locations\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"payroll\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"payroll_config\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"payslips\": [\"verify\"],\n        \"requisitions\": [\"getAll\",\"create\",\"update\",\"delete\",\"approve\",\"reject\"],\n        \"procurement_requests\": [\"getAll\",\"create\",\"update\",\"delete\",\"approve\",\"reject\"],\n        \"purchase_requests\": [\"getAll\",\"create\",\"update\",\"delete\",\"approve\",\"reject\"],\n        \"vendor\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"groups\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"user_group_memberships\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"group_permissions\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"training_courses\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"resources\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"locations\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"timeclocks\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"time_clocks\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"reports\": [\"company\",\"summaryToday\",\"absenteesToday\",\"locationAlerts\"],\n        \"performance_goals\": [\"*\"],\n        \"performance_reviews\": [\"*\"],\n        \"feedback_notes\": [\"*\"],\n        \"check_ins\": [\"*\"],\n        \"performance_dashboard\": [\"view\"]\n        \"reports\": [\"company\",\"summaryToday\",\"absenteesToday\",\"locationAlerts\"],\n        \"violation_types\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"disciplinary_cases\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"case_evidence\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"interview_logs\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"disciplinary_actions\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"appeals\": [\"getAll\",\"create\",\"update\",\"delete\",\"review\"],\n        \"ohs_actions\": [\"manage\"],\n        \"ohs_inspections\": [\"view\"],\n        \"ohs_regulations\": [\"manage\"]\n    }',1,0,'2025-06-02 20:55:41'),
(7,'Location Officer',NULL,'{\"*\": [\"*\"]}',1,0,'2025-06-02 20:55:41'),
(8,'HR Manager',NULL,'{\n        \"employee_exits\": [\"*\"],\n        \"exit_clearances\": [\"*\"],\n        \"exit_approvals\": [\"*\"],\n        \"exit_interviews\": [\"*\"],\n        \"exit_feedback\": [\"*\"]\n    }',1,0,'2025-06-02 20:55:41'),
(9,'Department Head',NULL,'{\n        \"employee_exits\": [\"*\"],\n        \"exit_clearances\": [\"*\"],\n        \"exit_approvals\": [\"*\"],\n        \"exit_interviews\": [\"*\"],\n        \"exit_feedback\": [\"*\"]\n    }',1,0,'2025-06-02 20:55:41'),
(10,'IT',NULL,'{\n        \"employee_exits\": [\"*\"],\n        \"exit_clearances\": [\"*\"],\n        \"exit_approvals\": [\"*\"],\n        \"exit_interviews\": [\"*\"],\n        \"exit_feedback\": [\"*\"]\n    }',1,0,'2025-06-02 20:55:41'),
(11,'Admin',NULL,'{\n        \"employee_exits\": [\"*\"],\n        \"exit_clearances\": [\"*\"],\n        \"exit_approvals\": [\"*\"],\n        \"exit_interviews\": [\"*\"],\n        \"exit_feedback\": [\"*\"]\n    }',1,0,'2025-06-02 20:55:41'),
(12,'Legal',NULL,'{\n        \"employee_exits\": [\"*\"],\n        \"exit_clearances\": [\"*\"],\n        \"exit_approvals\": [\"*\"],\n        \"exit_interviews\": [\"*\"],\n        \"exit_feedback\": [\"*\"]\n        \"reports\": [\"company\",\"summaryToday\",\"absenteesToday\",\"locationAlerts\"],\n        \"ohs_inspections\": [\"view\"]\n    }',1,0,'2025-06-02 20:55:41'),
(13,'Legal Admin',NULL,'{\"cases\": [\"*\"], \"matters\": [\"*\"], \"case_documents\": [\"*\"], \"case_events\": [\"*\"], \"case_communications\": [\"*\"], \"case_instructions\": [\"*\"]}',1,0,'2025-06-02 20:55:41'),
(14,'Finance Manager',NULL,'{\n        \"glaccounts\": [\"getAll\",\"create\",\"update\",\"delete\",\"toggle\"],\n        \"gltransactions\": [\"getAll\",\"create\",\"update\",\"delete\",\"import\",\"postBatch\",\"split\",\"parseText\"]\n    }',1,0,'2025-06-02 20:55:41'),
(15,'Accountant','Finance Manager','{\n        \"glaccounts\": [\"getAll\",\"update\"],\n        \"gltransactions\": [\"getAll\",\"create\",\"postBatch\",\"split\"]\n    }',1,0,'2025-06-02 20:55:41'),
(16,'Auditor',NULL,'{\n        \"glaccounts\": [\"getAll\"],\n        \"gltransactions\": [\"getAll\"]\n    }',1,0,'2025-06-02 20:55:41'),
(17,'Finance Officer',NULL,'{\n        \"properties\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"ratepayers\": [\"*\"],\n        \"property_rates\": [\"*\"],\n        \"rates_billing\": [\"generate\"],\n        \"rate_payments\": [\"create\"]\n    }',1,0,'2025-06-02 20:55:41'),
(18,'Council Clerk',NULL,'{\n        \"properties\": [\"getAll\",\"create\",\"update\",\"delete\"],\n        \"ratepayers\": [\"*\"],\n        \"property_rates\": [\"*\"],\n        \"rates_billing\": [\"generate\"],\n        \"rate_payments\": [\"create\"]\n    }',1,0,'2025-06-02 20:55:41'),
(19,'SuperAdmin',NULL,'{\"storage_connectors\": [\"*\"], \"documents\": [\"*\"], \"calendar_events\": [\"*\"], \"meetings\": [\"*\"]}',1,0,'2025-06-02 20:55:41'),
(20,'User',NULL,'{\"documents\": [\"getAll\",\"getById\",\"uploadVersion\"]}',1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `value` text NOT NULL,
  `category` varchar(50) DEFAULT NULL,
  `company_id` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `name_unique` (`name`),
  KEY `company_idx` (`company_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` VALUES
(1,'default_currency','FJD','finance',NULL,0,'2025-06-02 20:55:41'),
(2,'timezone','Pacific/Fiji','system',1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `shortlist_applications`
--

CREATE TABLE `shortlist_applications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `shortlist_id` int(11) NOT NULL,
  `application_id` int(11) NOT NULL,
  `comment` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `shortlist_applications`
--


--
-- Table structure for table `superannuation_settings`
--

CREATE TABLE `superannuation_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `employer_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `superannuation_settings`
--

INSERT INTO `superannuation_settings` VALUES
(1,8.00,10.00,0,'2025-06-02 20:55:41');

--
-- Table structure for table `tasks`
--

CREATE TABLE `tasks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `item_name` varchar(100) DEFAULT NULL,
  `manager_id` int(11) DEFAULT NULL,
  `status` enum('pending','completed') DEFAULT 'pending',
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `tasks`
--

INSERT INTO `tasks` VALUES
(1,2,'Submit project report',1,'pending',0,'2025-06-02 20:55:41'),
(2,3,'Client follow up',1,'completed',0,'2025-06-02 20:55:41');

--
-- Table structure for table `tax_brackets`
--

CREATE TABLE `tax_brackets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `min_income` decimal(10,2) NOT NULL,
  `max_income` decimal(10,2) DEFAULT NULL,
  `rate` decimal(5,2) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tax_brackets`
--

INSERT INTO `tax_brackets` VALUES
(4,0.00,30000.00,0.00,0,'2025-06-02 20:55:41'),
(5,30000.01,50000.00,18.00,0,'2025-06-02 20:55:41'),
(6,50000.01,270000.00,20.00,0,'2025-06-02 20:55:41'),
(7,270000.01,300000.00,33.00,0,'2025-06-02 20:55:41');

--
-- Table structure for table `tax_ledger`
--

CREATE TABLE `tax_ledger` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payroll_run_id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `tax_type` varchar(50) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `ytd_total` decimal(10,2) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `run_idx` (`payroll_run_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tax_ledger`
--


--
-- Table structure for table `tax_settings`
--

CREATE TABLE `tax_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `value` varchar(100) NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tax_settings`
--

INSERT INTO `tax_settings` VALUES
(1,'federal_tax_rate','10',0,'2025-06-02 20:55:41'),
(2,'state_tax_rate','5',0,'2025-06-02 20:55:41');

--
-- Table structure for table `time_clock_locations`
--

CREATE TABLE `time_clock_locations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `shape` enum('circle','polygon') DEFAULT 'circle',
  `center_lat` decimal(10,6) DEFAULT NULL,
  `center_lng` decimal(10,6) DEFAULT NULL,
  `radius_m` int(11) DEFAULT NULL,
  `polygon_points` text DEFAULT NULL,
  `assigned_to_type` varchar(50) DEFAULT NULL,
  `assigned_to_ids` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `time_clock_locations`
--

INSERT INTO `time_clock_locations` VALUES
(1,'Suva HQ','circle',-18.139800,178.426600,50,NULL,'location','1',0,'2025-06-02 20:55:41'),
(2,'Nadi Office','circle',-17.753300,177.443500,50,NULL,'location','4',0,'2025-06-02 20:55:41');

--
-- Table structure for table `time_clocks`
--

CREATE TABLE `time_clocks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `clock_type` varchar(50) NOT NULL,
  `lat` decimal(10,6) DEFAULT NULL,
  `lng` decimal(10,6) DEFAULT NULL,
  `valid_gps` tinyint(1) NOT NULL DEFAULT 0,
  `location_id` int(11) DEFAULT NULL,
  `locationApproved` tinyint(1) NOT NULL DEFAULT 0,
  `security_type` varchar(50) NOT NULL,
  `clocked_at` datetime DEFAULT current_timestamp(),
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2382 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `time_clocks`
--In another file

--
-- Table structure for table `training_certificates`
--

CREATE TABLE `training_certificates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `employee_id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `issued_at` date NOT NULL,
  `expires_at` date DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `training_certificates`
--


--
-- Table structure for table `training_courses`
--

CREATE TABLE `training_courses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `training_courses`
--


--
-- Table structure for table `training_results`
--

CREATE TABLE `training_results` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `enrollment_id` int(11) NOT NULL,
  `score` decimal(5,2) DEFAULT NULL,
  `completed` tinyint(1) DEFAULT 0,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `training_results`
--


--
-- Table structure for table `training_sessions`
--

CREATE TABLE `training_sessions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `course_id` int(11) NOT NULL,
  `start_date` datetime NOT NULL,
  `end_date` datetime DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `createdBy` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `training_sessions`
--


--
-- Table structure for table `user_auth_providers`
--

CREATE TABLE `user_auth_providers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `provider` varchar(100) DEFAULT NULL,
  `provider_user_id` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `profile_pic` text DEFAULT NULL,
  `linked_at` datetime DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_auth_providers`
--

INSERT INTO `user_auth_providers` VALUES
(1,1,'google','google-uid-1','admin@example.com','Test Admin',NULL,'2025-06-02 20:55:41',0,'2025-06-02 20:55:41');

--
-- Table structure for table `user_emails`
--

CREATE TABLE `user_emails` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=399 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_emails`
--

INSERT INTO `user_emails` VALUES
(1,1,'admin@example.com',0,'2025-06-02 20:55:41'),
(159,159,'testnew@example.com',0,'2025-06-23 23:57:07'),
(204,204,'ksharma@baf.com.fj',0,'2025-06-24 00:56:23'),
(205,205,'rprasad@baf.com.fj',0,'2025-06-24 00:59:53'),
(206,206,'mohammed.istikar@baf.com.fj',0,'2025-06-24 01:01:23'),
(207,207,'wvulaono@baf.com.fj',0,'2025-06-24 02:07:01'),
(349,349,'atuisavusavu@baf.com.fj',0,'2025-06-24 03:37:53'),
(350,350,'tkarikaritu@baf.com.fj',0,'2025-06-26 03:02:13'),
(351,351,'mvubaya@baf.com.fj',0,'2025-06-26 03:08:41'),
(352,352,'rcsharma@baf.com.fj',0,'2025-06-26 03:10:11'),
(353,353,'yreddy@baf.com.fj',0,'2025-06-26 03:10:41'),
(354,354,'mifraaz@baf.com.fj',0,'2025-06-26 03:11:40'),
(355,355,'lqiqiwaqa@baf.com.fj',0,'2025-06-26 03:12:11'),
(356,356,'jmar@baf.com.fj',0,'2025-06-26 03:43:19'),
(357,357,'hbuksh@baf.com.fj',0,'2025-06-26 03:58:49'),
(358,358,'mhazelman@baf.com.fj',0,'2025-06-26 03:59:49'),
(359,359,'sreddy@baf.com.fj',0,'2025-06-26 04:00:19'),
(360,360,'pmeke@baf.com.fj',0,'2025-06-26 04:01:19'),
(361,361,'mvakadromusiga@baf.com.fj',0,'2025-06-26 04:02:49'),
(362,362,'sonamk@baf.com.fj',0,'2025-06-26 04:03:49'),
(363,363,'kvuniwaqa@baf.com.fj',0,'2025-06-26 04:04:19'),
(364,364,'hanrieta.yadraca@baf.com.fj',0,'2025-06-26 04:05:49'),
(365,365,'lnakuta@baf.com.fj',0,'2025-06-26 04:25:31'),
(366,366,'thedstrom@baf.com.fj',0,'2025-06-26 04:26:01'),
(367,367,'nirlesh_l@baf.com.fj',0,'2025-06-26 04:27:01'),
(368,368,'veniana_t@baf.com.fj',0,'2025-06-26 04:27:31'),
(369,369,'atuisavusavu@baf.com.fj',0,'2025-06-26 04:32:01'),
(370,370,'tuverea_t@baf.com.fj',0,'2025-06-26 04:33:01'),
(371,371,'rashnil.kumar@baf.com.fj',0,'2025-06-26 04:33:31'),
(372,372,'repeka.tukula@baf.com.fj',0,'2025-06-26 04:34:01'),
(373,373,'srasiga@baf.com.fj',0,'2025-06-26 04:34:31'),
(374,374,'lily.pickering@baf.com.fj',0,'2025-06-26 04:44:05'),
(375,375,'arieta.marawaqa@baf.com.fj',0,'2025-06-26 04:44:34'),
(376,376,'taina.mocemaiwaiyevo@baf.com.fj',0,'2025-06-26 04:45:34'),
(377,377,'ejames@baf.com.fj',0,'2025-06-26 04:46:05'),
(378,378,'spratap@baf.com.fj',0,'2025-06-26 04:46:34'),
(379,379,'cppo@baf.com.fj',0,'2025-06-26 04:47:35'),
(380,380,'iverlyn.maeta@baf.com.fj',0,'2025-06-26 04:48:04'),
(381,381,'cybexpte1@gmail.com',0,'2025-08-04 22:07:54'),
(382,382,'spatel@baf.com.fj',0,'2025-08-04 22:13:55'),
(383,383,'knaisaboca@baf.com.fj',0,'2025-08-04 22:23:34'),
(384,384,'ngasara@baf.com.fj',0,'2025-08-04 22:24:42'),
(385,385,'pdevi@baf.com.fj',0,'2025-08-04 22:26:14'),
(386,386,'vvarea@baf.com.fj',0,'2025-08-04 22:28:01'),
(387,387,'uraia_m@baf.com.fj',0,'2025-08-04 22:29:08'),
(388,388,'samuela.paula@baf.com.fj',0,'2025-08-04 22:30:03'),
(389,389,'nvalevatu@baf.com.fj',0,'2025-08-04 22:30:53'),
(390,390,'nbibi@baf.com.fj',0,'2025-08-04 22:31:21'),
(391,391,'jloiti@baf.com.fj',0,'2025-08-04 22:31:49'),
(392,392,'sakeasi_n@baf.com.fj',0,'2025-08-04 22:47:29'),
(393,393,'adi_r@baf.com.fj',0,'2025-08-04 22:48:40'),
(394,394,'usharma@baf.com.fj',0,'2025-08-04 22:49:21'),
(395,395,'ahafeez@baf.com.fj',0,'2025-08-04 22:50:02'),
(396,396,'Rahul_P@baf.com.fj',0,'2025-08-04 22:50:43'),
(397,397,'aminiasi.b@baf.com.fj',0,'2025-08-04 22:51:25'),
(398,398,'knaisaboca@baf.com.fj',0,'2025-10-02 02:48:35');

--
-- Table structure for table `user_group_memberships`
--

CREATE TABLE `user_group_memberships` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `role` varchar(100) DEFAULT NULL,
  `joined_at` datetime DEFAULT current_timestamp(),
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_group_memberships`
--

INSERT INTO `user_group_memberships` VALUES
(1,1,1,'Super Admin','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(2,6,1,'Location Officer','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(3,3,1,'Location Officer','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(4,4,1,'Location Officer','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(5,7,1,'Procurement Manager','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(6,8,1,'Finance Approver','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(7,9,1,'CEO Approver','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(8,8,1,'Finance Officer','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(9,9,1,'Council Clerk','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(10,2,2,'Finance Team','2025-06-02 20:55:41',0,'2025-06-02 20:55:41'),
(11,3,3,'Sales Team','2025-06-02 20:55:41',0,'2025-06-02 20:55:41');

--
-- Table structure for table `user_phones`
--

CREATE TABLE `user_phones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `phone_number` varchar(50) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_phones`
--

INSERT INTO `user_phones` VALUES
(1,1,'+1-555-2001',0,'2025-06-02 20:55:41');

--
-- Table structure for table `user_settings`
--

CREATE TABLE `user_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `value` text NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_setting_unique` (`user_id`,`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_settings`
--

INSERT INTO `user_settings` VALUES
(1,1,'theme','modern-blue',0,'2025-06-22 21:05:43');

--
-- Table structure for table `vendor_addresses`
--

CREATE TABLE `vendor_addresses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vendor_id` int(11) NOT NULL,
  `type` enum('office','postal') NOT NULL,
  `address` text NOT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci WITH SYSTEM VERSIONING;

--
-- Dumping data for table `vendor_addresses`
--

INSERT INTO `vendor_addresses` VALUES
(1,1,'office','123 Main St, Suva',0,'2025-06-02 20:55:41'),
(2,2,'office','456 Tech Park, Nadi',0,'2025-06-02 20:55:41'),
(3,3,'office','789 Catering Rd, Lautoka',0,'2025-06-02 20:55:41');

--
-- Table structure for table `vendor_bank_accounts`
--

CREATE TABLE `vendor_bank_accounts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vendor_id` int(11) NOT NULL,
  `bankName` varchar(255) DEFAULT NULL,
  `bankBranch` varchar(255) DEFAULT NULL,
  `accountName` varchar(255) DEFAULT NULL,
  `accountNumber` varchar(255) DEFAULT NULL,
  `bankCode` varchar(255) DEFAULT NULL,
  `bankAddress` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci WITH SYSTEM VERSIONING;

--
-- Dumping data for table `vendor_bank_accounts`
--

INSERT INTO `vendor_bank_accounts` VALUES
(1,1,'Bank of Fiji','Suva','Fiji Stationers Ltd','123456789','BOF001','1 Bank St, Suva',0,'2025-06-02 20:55:41'),
(2,2,'Fiji Bank','Nadi','Island Tech Solutions','987654321','FJB002','2 Bank St, Nadi',0,'2025-06-02 20:55:41'),
(3,3,'Bank of Pacific','Lautoka','Pacific Catering Co','555666777','BOP003','3 Bank St, Lautoka',0,'2025-06-02 20:55:41');

--
-- Table structure for table `vendor_capabilities`
--

CREATE TABLE `vendor_capabilities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vendor_id` int(11) NOT NULL,
  `goodsServices` text DEFAULT NULL,
  `categoryTags` text DEFAULT NULL,
  `pastClients` text DEFAULT NULL,
  `experienceYears` int(11) DEFAULT NULL,
  `certifications` text DEFAULT NULL,
  `capacity` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci WITH SYSTEM VERSIONING;

--
-- Dumping data for table `vendor_capabilities`
--

INSERT INTO `vendor_capabilities` VALUES
(1,1,'Office Supplies','stationery','Gov Dept',15,'ISO9001','High volume',0,'2025-06-02 20:55:41'),
(2,2,'IT Services','software,hardware','Various clients',10,'Cisco','Medium',0,'2025-06-02 20:55:41'),
(3,3,'Catering Services','food','Hotels',8,'FoodSafe','Large events',0,'2025-06-02 20:55:41');

--
-- Table structure for table `vendor_contacts`
--

CREATE TABLE `vendor_contacts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vendor_id` int(11) NOT NULL,
  `primaryContactName` varchar(255) DEFAULT NULL,
  `designation` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `altContactDetails` text DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci WITH SYSTEM VERSIONING;

--
-- Dumping data for table `vendor_contacts`
--

INSERT INTO `vendor_contacts` VALUES
(1,1,'John Vendor','Manager','contact@fijistationers.com','+679-100-200',NULL,0,'2025-06-02 20:55:41'),
(2,2,'Jane Tech','Director','info@islandtech.com','+679-200-300',NULL,0,'2025-06-02 20:55:41'),
(3,3,'Paul Cater','Owner','service@paccater.com','+679-300-400',NULL,0,'2025-06-02 20:55:41');

--
-- Table structure for table `vendor_documents`
--

CREATE TABLE `vendor_documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vendor_id` int(11) NOT NULL,
  `filetype` varchar(50) NOT NULL,
  `type` varchar(100) NOT NULL,
  `file_url` text NOT NULL,
  `validity` date DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci WITH SYSTEM VERSIONING;

--
-- Dumping data for table `vendor_documents`
--

INSERT INTO `vendor_documents` VALUES
(1,1,'pdf','business_license','/docs/vendors/license1.pdf','2026-12-31',0,'2025-06-02 20:55:41'),
(2,2,'pdf','business_license','/docs/vendors/license2.pdf','2027-05-31',0,'2025-06-02 20:55:41'),
(3,3,'pdf','business_license','/docs/vendors/license3.pdf','2027-10-31',0,'2025-06-02 20:55:41');

--
-- Table structure for table `vendor_invoices`
--

CREATE TABLE `vendor_invoices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `purchase_order_id` int(11) NOT NULL,
  `invoice_number` varchar(100) NOT NULL,
  `invoice_date` date DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `status` varchar(50) DEFAULT 'unpaid',
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vendor_invoices`
--


--
-- Table structure for table `vendor_supporting_docs`
--

CREATE TABLE `vendor_supporting_docs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vendor_id` int(11) NOT NULL,
  `filetype` varchar(50) NOT NULL,
  `type` varchar(100) NOT NULL,
  `file_url` text NOT NULL,
  `validity` date DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci WITH SYSTEM VERSIONING;

--
-- Dumping data for table `vendor_supporting_docs`
--

INSERT INTO `vendor_supporting_docs` VALUES
(1,1,'pdf','insurance_certificate','/docs/vendors/insurance1.pdf','2025-12-31',0,'2025-06-02 20:55:41'),
(2,2,'pdf','insurance_certificate','/docs/vendors/insurance2.pdf','2026-12-31',0,'2025-06-02 20:55:41'),
(3,3,'pdf','insurance_certificate','/docs/vendors/insurance3.pdf','2026-12-31',0,'2025-06-02 20:55:41');

--
-- Table structure for table `vendors`
--

CREATE TABLE `vendors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vendorName` varchar(255) NOT NULL,
  `tradingName` varchar(255) DEFAULT NULL,
  `businessRegNumber` varchar(255) DEFAULT NULL,
  `tin` varchar(255) DEFAULT NULL,
  `vatNumber` varchar(255) DEFAULT NULL,
  `businessType` varchar(255) DEFAULT NULL,
  `incorporationDate` date DEFAULT NULL,
  `registrationCountry` varchar(255) DEFAULT NULL,
  `status` varchar(100) DEFAULT 'pending',
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci WITH SYSTEM VERSIONING;

--
-- Dumping data for table `vendors`
--

INSERT INTO `vendors` VALUES
(1,'Fiji Stationers Ltd','Fiji Stationers','BRN12345','TIN54321','VAT11111','LLC','2010-03-15','Fiji','approved',1,1,0,'2025-06-02 20:55:41'),
(2,'Island Tech Solutions','IslandTech','BRN67890','TIN98765','VAT22222','Ltd','2015-07-20','Fiji','pending',1,1,0,'2025-06-02 20:55:41'),
(3,'Pacific Catering Co','PacCater','BRN23456','TIN12321','VAT33333','Ltd','2012-11-10','Fiji','approved',1,1,0,'2025-06-02 20:55:41');

--
-- Table structure for table `violation_types`
--

CREATE TABLE `violation_types` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `handbook_ref` varchar(255) DEFAULT NULL,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `violation_types`
--

INSERT INTO `violation_types` VALUES
(1,'Attendance Violation','Section 5.2',0,'2025-06-02 20:55:41'),
(2,'Code of Conduct','Section 3.1',0,'2025-06-02 20:55:41');

--
-- Table structure for table `workflows`
--

CREATE TABLE `workflows` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `trigger_event` varchar(100) NOT NULL,
  `definition` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`definition`)),
  `is_active` tinyint(1) DEFAULT 1,
  `isDeleted` tinyint(1) NOT NULL DEFAULT 0,
  `updatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `workflows`
--

INSERT INTO `workflows` VALUES
(1,'Employee Onboarding','employee.hired','{\n    \"conditions\": [],\n    \"steps\": [\n      { \"type\": \"assign_items\" },\n      { \"type\": \"notify_manager\" },\n      { \"type\": \"trigger_api\", \"items\": [\"365\", \"email_signature\"] }\n    ]\n  }',1,0,'2025-06-02 20:55:41'),
(2,'OHS Incident Reporting','ohs_incident_reported','{\n    \"conditions\": [],\n    \"steps\": [\n      { \"type\": \"wait_approval\", \"role\": \"hs_officer\" },\n      { \"type\": \"update_status\", \"field\": \"status\", \"value\": \"investigating\" }\n    ]\n  }',1,0,'2025-06-02 20:55:41');


