
--
-- Table structure for table `journal_transaction_archives`
--

CREATE TABLE `journal_transaction_archives` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `journal_transaction_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `data` json NOT NULL,
  `fiscal_year_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `journal_transaction_archives_fiscal_year_id_index` (`fiscal_year_id`),
  KEY `journal_transaction_archives_journal_transaction_id_foreign` (`journal_transaction_id`),
  CONSTRAINT `journal_transaction_archives_fiscal_year_id_foreign` FOREIGN KEY (`fiscal_year_id`) REFERENCES `fiscal_years` (`id`) ON DELETE CASCADE,
  CONSTRAINT `journal_transaction_archives_journal_transaction_id_foreign` FOREIGN KEY (`journal_transaction_id`) REFERENCES `journal_transactions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `journal_transaction_archives`
--


--
-- Table structure for table `journal_transactions`
--

CREATE TABLE `journal_transactions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `branch_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transaction_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `status` enum('active','deleted','reversed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `supporting_documents` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `segment_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `budget_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `journal_type_id` bigint unsigned DEFAULT NULL,
  `fiscal_year_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reversed_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reverse_message` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reversal_date` date DEFAULT NULL,
  `unique_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cash_impact` enum('Direct','Indirect','None') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Indirect' COMMENT 'How this transaction affects cash flow',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `journal_transactions_journal_type_id_foreign` (`journal_type_id`),
  KEY `journal_transactions_project_id_foreign` (`project_id`),
  KEY `journal_transactions_fiscal_year_id_foreign` (`fiscal_year_id`),
  KEY `journal_transactions_segment_id_foreign` (`segment_id`),
  KEY `journal_transactions_reversed_by_foreign` (`reversed_by`),
  KEY `journal_transactions_created_by_foreign` (`created_by`),
  KEY `jt_status_fy_date_org_idx` (`status`,`fiscal_year_id`,`transaction_date`,`organisation_id`),
  KEY `jt_status_fy_org_date_idx` (`status`,`fiscal_year_id`,`organisation_id`,`transaction_date`),
  CONSTRAINT `journal_transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `journal_transactions_fiscal_year_id_foreign` FOREIGN KEY (`fiscal_year_id`) REFERENCES `fiscal_years` (`id`) ON DELETE CASCADE,
  CONSTRAINT `journal_transactions_journal_type_id_foreign` FOREIGN KEY (`journal_type_id`) REFERENCES `journal_types` (`id`),
  CONSTRAINT `journal_transactions_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  CONSTRAINT `journal_transactions_reversed_by_foreign` FOREIGN KEY (`reversed_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `journal_transactions_segment_id_foreign` FOREIGN KEY (`segment_id`) REFERENCES `segments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `journal_transactions`
--

INSERT INTO `journal_transactions` VALUES ('282b3f1d-603a-46d0-8382-da717b2e69e4','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'2025-04-01 00:00:00','active',NULL,NULL,NULL,NULL,NULL,2,'474999f5-e3a4-473f-9ec3-6211fc872bf1','Opening balances brought forward',NULL,NULL,NULL,NULL,'69b0968df1914','Direct',NULL,'2026-03-11 01:09:18','2026-03-11 01:09:20'),('43bb10a3-337e-4446-9301-94c9ae68bcea','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'2026-03-12 00:00:00','active','#OP',NULL,NULL,NULL,NULL,1,'474999f5-e3a4-473f-9ec3-6211fc872bf1',NULL,NULL,NULL,NULL,NULL,'69b2e27fdce96','Indirect','2026-03-27 08:39:17','2026-03-12 18:57:51','2026-03-27 08:39:17'),('44460125-7f86-4020-90e6-c98b3a1d513c','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'2025-04-08 16:59:45','active','566',NULL,NULL,NULL,NULL,3,'474999f5-e3a4-473f-9ec3-6211fc872bf1','UPANGISHAJI MAGHALA',NULL,NULL,NULL,NULL,'69e782d1956c1','Indirect',NULL,'2026-04-21 16:59:45','2026-04-21 16:59:45'),('552632a6-bccb-450c-bd63-5ba7fba6bc5d','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'2025-04-01 12:35:05','active','PV',NULL,NULL,NULL,NULL,3,'474999f5-e3a4-473f-9ec3-6211fc872bf1','PAYE',NULL,NULL,NULL,NULL,'69dcb8c97839f','Direct',NULL,'2026-04-13 12:35:05','2026-04-13 12:35:05'),('7632b2f4-7efe-455b-b44d-1997c965f1d2','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'2026-04-23 09:24:42','active','CR00001',NULL,NULL,NULL,NULL,4,'474999f5-e3a4-473f-9ec3-6211fc872bf1','Cash requisition discbursement for item Posho za Safari',NULL,NULL,NULL,NULL,'CR-20260423-48477','Direct',NULL,'2026-04-23 09:24:42','2026-04-23 09:24:42'),('7c578ef9-b013-48fe-97af-c08d0a7cf96b','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'2025-04-01 09:18:31','active','456',NULL,NULL,NULL,NULL,3,'474999f5-e3a4-473f-9ec3-6211fc872bf1','SDL',NULL,NULL,NULL,NULL,'69e9b9b7bfe8e','Direct',NULL,'2026-04-23 09:18:31','2026-04-23 09:18:31'),('815e2d8a-8c53-4501-a1ec-616736707206','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'2025-04-29 18:45:42','active','1901',NULL,NULL,NULL,'e78e7024-ab8d-4c2f-b968-e5e1fad6e026',4,'474999f5-e3a4-473f-9ec3-6211fc872bf1',NULL,NULL,NULL,NULL,NULL,'69c6a62655103','Direct',NULL,'2026-03-27 18:45:42','2026-03-27 18:45:42'),('9e0fb27a-fbbf-433e-9083-b18cf0588fa6','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'2026-02-11 21:05:08','active','#OP',NULL,NULL,NULL,NULL,1,'20664a10-d692-43c0-8fa3-57776cb5cacc','Opening balances from COA upload',NULL,NULL,NULL,NULL,'698cc4d492567','Direct',NULL,'2026-02-11 21:05:08','2026-02-11 21:37:30'),('c9b5040c-7cee-44b5-8400-18c39b8ef9e5','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'2025-04-01 10:38:48','active','6666',NULL,NULL,NULL,NULL,3,'474999f5-e3a4-473f-9ec3-6211fc872bf1','MALIPO',NULL,NULL,NULL,NULL,'69f064088bbab','Direct','2026-04-28 10:46:37','2026-04-28 10:38:48','2026-04-28 10:46:37');

--
-- Table structure for table `journal_types`
--

CREATE TABLE `journal_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('1','0') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `journal_types`
--

INSERT INTO `journal_types` VALUES (1,'Opening Balance','Opening Balance','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(2,'Closing Journal','Fiscal Year Closure','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(3,'General Journal','General','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(4,'Expense Journal','Expense Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(5,'Sales Journal','Income','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(6,'Purchases Journal','Purchases Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(7,'Cash Receipts Journal','Cash Receipts Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(8,'Cash Disbursements (Payments) Journal','Cash Disbursements (Payments) Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(9,'Sales Returns and Allowances Journal','Sales Returns and Allowances Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(10,'Purchases Returns and Allowances Journal','Purchases Returns and Allowances Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(11,'Payroll Journal','Payroll Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(12,'General Ledger Journal','General Ledger Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(13,'Adjusting Journal','Adjusting Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(14,'Reversing Journal','Reversing Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(15,'Depreciation Journal','Depreciation Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(16,'Appreciation Journal','Appreciation Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(17,'Amortization Journal','Amortization Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(18,'Inventory Journal','Inventory Journal','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(19,'Asset purchase','Asset purchase','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(20,'Cash Transfer','Movement of money from one cash account to another','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(21,'Loan Disbursement','Loan disbursement','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(22,'Loan Payment','Loan payment details','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(23,'Purcahse Payment','Purchase payment details','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(24,'Payroll','Payroll entries','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(25,'Acruel','Accruel entries','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(26,'Security Deposit','Security Deposit','1','2026-03-10 21:55:10','2026-03-10 21:55:10'),(27,'Rent Payment','Rent payment','1','2026-03-10 21:55:10','2026-03-10 21:55:10');

--
-- Table structure for table `landlords`
--

CREATE TABLE `landlords` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `metadata` json DEFAULT NULL,
  `management_fee_type` enum('percentage','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percentage',
  `management_fee_percent` decimal(5,2) NOT NULL DEFAULT '0.00',
  `balance` decimal(12,2) NOT NULL DEFAULT '0.00',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `landlords_user_id_foreign` (`user_id`),
  CONSTRAINT `landlords_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `landlords`
--


--
-- Table structure for table `lead_notes`
--

CREATE TABLE `lead_notes` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lead_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `added_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `lead_notes_lead_id_foreign` (`lead_id`),
  KEY `lead_notes_added_by_foreign` (`added_by`),
  CONSTRAINT `lead_notes_added_by_foreign` FOREIGN KEY (`added_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `lead_notes_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `lead_notes`
--


--
-- Table structure for table `leads`
--

CREATE TABLE `leads` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `assigned_to` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `status` enum('new','contacted','qualified','converted') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'new',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `leads_assigned_to_foreign` (`assigned_to`),
  CONSTRAINT `leads_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `leads`
--


--
-- Table structure for table `leave_application_approvals`
--

CREATE TABLE `leave_application_approvals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `request_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approver_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `status` enum('Approved','Rejected') COLLATE utf8mb4_unicode_ci NOT NULL,
  `comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `leave_application_approvals_approval_level_id_foreign` (`approval_level_id`),
  KEY `leave_application_approvals_request_id_foreign` (`request_id`),
  KEY `leave_application_approvals_approver_id_foreign` (`approver_id`),
  CONSTRAINT `leave_application_approvals_approval_level_id_foreign` FOREIGN KEY (`approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `leave_application_approvals_approver_id_foreign` FOREIGN KEY (`approver_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `leave_application_approvals_request_id_foreign` FOREIGN KEY (`request_id`) REFERENCES `leave_requests` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `leave_application_approvals`
--


--
-- Table structure for table `leave_balances`
--

CREATE TABLE `leave_balances` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `leave_type_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `balance` decimal(5,1) NOT NULL DEFAULT '0.0',
  `year` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `leave_balances_employee_id_leave_type_id_year_unique` (`employee_id`,`leave_type_id`,`year`),
  KEY `leave_balances_leave_type_id_foreign` (`leave_type_id`),
  CONSTRAINT `leave_balances_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `leave_balances_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `leave_balances`
--


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

CREATE TABLE `leave_requests` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `leave_type_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_approval_level` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci,
  `status` enum('Pending','Approved','Rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `leave_requests_employee_id_foreign` (`employee_id`),
  KEY `leave_requests_leave_type_id_foreign` (`leave_type_id`),
  CONSTRAINT `leave_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `leave_requests_leave_type_id_foreign` FOREIGN KEY (`leave_type_id`) REFERENCES `leave_types` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


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

CREATE TABLE `leave_types` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `leave_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `max_days` int DEFAULT NULL,
  `is_paid` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `leave_types_leave_name_unique` (`leave_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `loan_types`
--

CREATE TABLE `loan_types` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loan_types_account_id_foreign` (`account_id`),
  CONSTRAINT `loan_types_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `chart_of_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_types`
--


--
-- Table structure for table `localities`
--

CREATE TABLE `localities` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `district_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `localities_district_id_foreign` (`district_id`),
  CONSTRAINT `localities_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `localities`
--


--
-- Table structure for table `machine_logs`
--

CREATE TABLE `machine_logs` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `machine_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('idle','running','maintenance','error','out_of_service') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `machine_logs_machine_id_foreign` (`machine_id`),
  CONSTRAINT `machine_logs_machine_id_foreign` FOREIGN KEY (`machine_id`) REFERENCES `machines` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `machine_logs`
--


--
-- Table structure for table `machine_maintenances`
--

CREATE TABLE `machine_maintenances` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `machine_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `maintenance_type` enum('preventive','corrective','predictive') COLLATE utf8mb4_unicode_ci NOT NULL,
  `scheduled_date` date NOT NULL,
  `completed_date` date DEFAULT NULL,
  `technician_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `technician_name` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `actions_taken` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `machine_maintenances_machine_id_foreign` (`machine_id`),
  KEY `machine_maintenances_technician_id_foreign` (`technician_id`),
  CONSTRAINT `machine_maintenances_machine_id_foreign` FOREIGN KEY (`machine_id`) REFERENCES `machines` (`id`),
  CONSTRAINT `machine_maintenances_technician_id_foreign` FOREIGN KEY (`technician_id`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `machine_maintenances`
--


--
-- Table structure for table `machines`
--

CREATE TABLE `machines` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `work_station_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('running','maintenance','out_of_service','error','idle') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'idle',
  `machine_type` enum('mixer','packer','other') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'other',
  `capabilities` json NOT NULL,
  `hourly_rate` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `machines_work_station_id_foreign` (`work_station_id`),
  CONSTRAINT `machines_work_station_id_foreign` FOREIGN KEY (`work_station_id`) REFERENCES `work_stations` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `machines`
--


--
-- Table structure for table `maintenance_tasks`
--

CREATE TABLE `maintenance_tasks` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `property_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `unit_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `type` enum('painting','plumbing','electrical','carpentry','general') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general',
  `status` enum('planned','in_progress','completed','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'planned',
  `estimated_cost` decimal(12,2) DEFAULT NULL,
  `is_paid` tinyint(1) NOT NULL DEFAULT '0',
  `requestable_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `requestable_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assignable_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assignable_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scheduled_date` date DEFAULT NULL,
  `completed_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `maintenance_tasks_property_id_foreign` (`property_id`),
  KEY `maintenance_tasks_unit_id_foreign` (`unit_id`),
  CONSTRAINT `maintenance_tasks_property_id_foreign` FOREIGN KEY (`property_id`) REFERENCES `properties` (`id`) ON DELETE CASCADE,
  CONSTRAINT `maintenance_tasks_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `property_units` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `maintenance_tasks`
--


--
-- Table structure for table `material_request_items`
--

CREATE TABLE `material_request_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `request_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `uom_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requested_qty` decimal(15,3) NOT NULL,
  `issued_qty` decimal(15,3) NOT NULL DEFAULT '0.000',
  `qty_returned` decimal(15,3) NOT NULL DEFAULT '0.000',
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `approved_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `rejected_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rejected_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `material_request_items_request_id_foreign` (`request_id`),
  KEY `material_request_items_item_id_foreign` (`item_id`),
  KEY `material_request_items_uom_id_foreign` (`uom_id`),
  CONSTRAINT `material_request_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `material_request_items_request_id_foreign` FOREIGN KEY (`request_id`) REFERENCES `material_requests` (`id`) ON DELETE CASCADE,
  CONSTRAINT `material_request_items_uom_id_foreign` FOREIGN KEY (`uom_id`) REFERENCES `unit_of_measures` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `material_request_items`
--


--
-- Table structure for table `material_requests`
--

CREATE TABLE `material_requests` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `request_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `requested_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `request_date` date DEFAULT NULL,
  `status` enum('pending','partially_approved','approved','partially_issued','completed','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `approved_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `rejected_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rejected_at` timestamp NULL DEFAULT NULL,
  `issued_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issued_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `material_requests_requested_by_foreign` (`requested_by`),
  KEY `material_requests_rejected_by_foreign` (`rejected_by`),
  KEY `material_requests_approved_by_foreign` (`approved_by`),
  KEY `material_requests_issued_by_foreign` (`issued_by`),
  KEY `material_requests_organisation_id_foreign` (`organisation_id`),
  CONSTRAINT `material_requests_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `employees` (`id`),
  CONSTRAINT `material_requests_issued_by_foreign` FOREIGN KEY (`issued_by`) REFERENCES `employees` (`id`),
  CONSTRAINT `material_requests_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`),
  CONSTRAINT `material_requests_rejected_by_foreign` FOREIGN KEY (`rejected_by`) REFERENCES `employees` (`id`),
  CONSTRAINT `material_requests_requested_by_foreign` FOREIGN KEY (`requested_by`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `material_requests`
--


--
-- Table structure for table `members`
--

CREATE TABLE `members` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amcos_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `registrationType` enum('MEMBER','NON-MEMBER') COLLATE utf8mb4_unicode_ci NOT NULL,
  `nin` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `firstName` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lastName` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `middleName` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dateOfBirth` date DEFAULT NULL,
  `phoneNumber` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `noOfShares` decimal(10,2) NOT NULL DEFAULT '0.00',
  `savingAmount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `wardPostCode` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `referenceNumber` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `maritalStatus` enum('SINGLE','MARRIED','DIVORCED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'SINGLE',
  `gender` enum('MALE','FEMALE') COLLATE utf8mb4_unicode_ci NOT NULL,
  `villageStreet` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tinNumber` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `educationLevelUid` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nationality` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contactPerson` tinyint(1) NOT NULL DEFAULT '0',
  `steeringCommittee` tinyint(1) NOT NULL DEFAULT '0',
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `muvu_uid` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `membershipNumber` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `members_nin_unique` (`nin`),
  UNIQUE KEY `members_phonenumber_unique` (`phoneNumber`),
  UNIQUE KEY `members_referencenumber_unique` (`referenceNumber`),
  KEY `members_educationleveluid_foreign` (`educationLevelUid`),
  KEY `members_amcos_id_foreign` (`amcos_id`),
  CONSTRAINT `members_amcos_id_foreign` FOREIGN KEY (`amcos_id`) REFERENCES `amcos` (`id`) ON DELETE CASCADE,
  CONSTRAINT `members_educationleveluid_foreign` FOREIGN KEY (`educationLevelUid`) REFERENCES `education_levels` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `members`
--


--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=173 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` VALUES (1,'0001_01_01_000001_create_cache_table',1),(2,'0001_01_01_000002_create_configurations_table',1),(3,'0001_01_01_000002_create_organisations_table',1),(4,'0001_01_02_000003_create_users_table',1),(5,'0001_01_03_000004_create_employees_table',1),(6,'0001_01_03_000005_create_approval_levels_table',1),(7,'0001_01_03_000005_create_attendances_table',1),(8,'2014_10_12_100000_create_leave_management_table',1),(9,'2014_10_12_100000_create_password_reset_tokens_table',1),(10,'2016_06_01_000001_create_oauth_auth_codes_table',1),(11,'2016_06_01_000002_create_oauth_access_tokens_table',1),(12,'2016_06_01_000003_create_oauth_refresh_tokens_table',1),(13,'2016_06_01_000004_create_oauth_clients_table',1),(14,'2016_06_01_000005_create_oauth_personal_access_clients_table',1),(15,'2023_08_13_072301_create_permission_tables',1),(16,'2023_08_15_064720_create_admins_table',1),(17,'2023_08_23_201138_create_subscription_states_table',1),(18,'2023_08_23_201140_create_branches_table',1),(19,'2023_08_24_073620_create_organisation_types_table',1),(20,'2023_08_25_122104_create_organisation_services_table',1),(21,'2023_08_30_054205_add_expires_at_to_users_table',1),(22,'2023_10_17_082023_create_activity_log_table',1),(23,'2024_01_01_00334_create_files_table',1),(24,'2024_01_01_004506_create_suppliers_table',1),(25,'2024_01_01_121648_create_sectors_table',1),(26,'2024_01_01_123521_create_project_categories_table',1),(27,'2024_01_01_152710_create_age_groups_table',1),(28,'2024_01_01_152710_create_partners_table',1),(29,'2024_01_01_152720_create_projects_table',1),(30,'2024_01_01_152721_create_project_comments_table',1),(31,'2024_01_01_152722_create_project_files_table',1),(32,'2024_01_01_152725_create_project_partners_table',1),(33,'2024_01_01_152725_create_project_roles_table',1),(34,'2024_01_02_142334_create_customers_table',1),(35,'2024_01_02_142335_create_customer_details_table',1),(36,'2024_01_03_000107_create_trucks_table',1),(37,'2024_01_11_231348_create_project_teams_table',1),(38,'2024_02_01_181648_create_configs_table',1),(39,'2024_02_01_181648_create_segments_table',1),(40,'2024_02_01_205022_create_co_and_transactions_table',1),(41,'2024_02_01_213943_create_activities_table',1),(42,'2024_02_02_010333_create_amcos_table',1),(43,'2024_02_02_010333_create_corporate_buyers_table',1),(44,'2024_02_02_010333_create_education_levels_table',1),(45,'2024_02_02_010333_create_items_table',1),(46,'2024_02_02_010333_create_locations_table',1),(47,'2024_02_02_010333_create_products_table',1),(48,'2024_02_02_010334_create_procurement_table',1),(49,'2024_02_02_010342_create_return_and_disputes_table',1),(50,'2024_02_02_100648_create_budgets_table',1),(51,'2024_02_02_510333_create_amcos_warehouses_table',1),(52,'2024_02_02_510334_create_marketing_table',1),(53,'2024_02_02_510334_create_members_table',1),(54,'2024_02_02_510335_create_amcos_financial_years_table',1),(55,'2024_02_02_510335_create_buyers_table',1),(56,'2024_02_03_000011_create_services_items_table',1),(57,'2024_02_03_000011_create_services_table',1),(58,'2024_02_03_000012_create_crm_table',1),(59,'2024_02_03_00004_create_drivers_table',1),(60,'2024_02_03_000055_create_warehouses_table',1),(61,'2024_02_03_003117_create_inventories_table',1),(62,'2024_02_03_100114_create_sales_table',1),(63,'2024_02_03_100116_create_fullfillments_table',1),(64,'2024_02_04_152721_create_project_budgets_table',1),(65,'2024_02_04_181052_create_credit_notes_table',1),(66,'2024_03_04_062835_create_jobs_table',1),(67,'2024_03_14_163402_create_settings_table',1),(68,'2024_03_26_085326_create_public_holidays_table',1),(69,'2024_04_00_212413_create_payroll_table',1),(70,'2024_04_05_075821_create_billing_cycles_table',1),(71,'2024_04_05_080649_create_packages_table',1),(72,'2024_04_05_085628_create_package_services_table',1),(73,'2024_05_06_202814_create_forms_table',1),(74,'2024_05_06_212151_create_form_questions_table',1),(75,'2024_05_06_231432_create_form_responses_table',1),(76,'2024_05_07_100713_create_recruitments_table',1),(77,'2024_05_11_223931_create_activity_parameters_table',1),(78,'2024_05_11_223931_create_activity_plans_table',1),(79,'2024_05_11_223931_create_activity_programs_table',1),(80,'2024_05_11_223931_create_activity_teams_table',1),(81,'2024_05_11_223932_create_activity_parameter_results_table',1),(82,'2024_05_11_225012_create_performance_cycles_table',1),(83,'2024_05_11_225012_create_performance_rankings_table',1),(84,'2024_05_11_225012_create_project_timesheets_table',1),(85,'2024_05_11_225013_create_activity_services_table',1),(86,'2024_05_11_231856_create_activity_approvals_table',1),(87,'2024_05_11_232842_create_activity_budgets_table',1),(88,'2024_05_11_233108_create_activity_files_table',1),(89,'2024_05_11_234057_create_contracts_table',1),(90,'2024_05_26_094104_create_assets_table',1),(91,'2024_05_26_094113_create_work_stations_and_machines_table',1),(92,'2024_05_27_094104_create_asset_renting_table',1),(93,'2024_05_27_094105_create_asset_locations_table',1),(94,'2024_05_27_184836_create_milestones-table',1),(95,'2024_06_17_062749_create_job_applications_table',1),(96,'2024_06_20_150144_create_activity_logs_table',1),(97,'2024_06_20_152152_create_performance_table',1),(98,'2024_06_20_192233_create_training_programs_table',1),(99,'2024_06_20_195055_create_employee_leaves_table',1),(100,'2024_06_20_195055_create_employee_trainings_table',1),(101,'2024_06_20_202134_create_timesheets_table',1),(102,'2024_06_20_202420_create_attendance_records_table',1),(103,'2024_06_20_202420_create_employee_documents_table',1),(104,'2024_06_20_202634_create_disciplinary_actions_table',1),(105,'2024_06_21_132730_create_evaluations_table',1),(106,'2024_06_21_134359_create_employee_dependants_table',1),(107,'2024_06_21_140122_create_insurance_providers_table',1),(108,'2024_06_21_140337_create_employee_insurances_table',1),(109,'2024_06_21_142645_create_job_descriptions_table',1),(110,'2024_06_21_144926_create_job_transfers_table',1),(111,'2024_06_21_144926_create_reimbursement_types_table',1),(112,'2024_06_21_150534_create_termination_reasons_table',1),(113,'2024_06_21_151047_create_shift_schedules_table',1),(114,'2024_06_22_122249_create_asset_loan_financing_table',1),(115,'2024_06_23_154939_create_personal_access_tokens_table',1),(116,'2024_07_23_071949_create_employee_awards_table',1),(117,'2024_07_23_071949_create_employee_certifications_table',1),(118,'2024_07_23_071949_create_employee_reimbursements_table',1),(119,'2024_07_23_071949_create_work_experience_table',1),(120,'2024_08_07_085555_create_holiday_calendars_table',1),(121,'2024_08_07_085556_create_overtime_requests_table',1),(122,'2024_09_22_165127_create_cash_requisitions_table',1),(123,'2024_09_22_1651288_delete_rejection_comment_repair_requisitions_table',1),(124,'2024_09_22_1651290_delete_rejection_comment_repair_requisitions_table',1),(125,'2024_09_22_165315_create_fuel_requisitions_table',1),(126,'2024_09_22_165315_create_store_requisitions_table',1),(127,'2024_09_22_165315_create_vehicle_repair_requisitions_table',1),(128,'2024_09_22_165316_add_organisation_id_to_repair_requisitions_table',1),(129,'2024_09_22_165317_add_deleted_at_to_repair_requisitions_table',1),(130,'2025-09-27_000001_add_service_form_and_log_book_to_repair_requisitions_table',1),(131,'2025-10-30_000001_update_sales_table',1),(132,'2025-11-18_000001_update_reversal_sales_table',1),(133,'2025_01_11_161240_create_otps_table',1),(134,'2025_01_24_064657_create_bank_reconciliation_table',1),(135,'2025_02_23_000001_create_employee_warehouse_table',1),(136,'2025_04_22_123515_add_deleted_at_to_fuel_requisition_approvals_table',1),(137,'2025_04_22_174648_create_payment_voucher_table',1),(138,'2025_05_12_000001_create_configurables_table',1),(139,'2025_05_12_000002_create_candidates_table',1),(140,'2025_05_12_000003_create_companies_table',1),(141,'2025_05_12_000004_create_job_orders_table',1),(142,'2025_05_12_000005_create_job_management_table',1),(143,'2025_05_12_000006_create_placements_table',1),(144,'2025_05_12_000007_create_recruitment_invoices_table',1),(145,'2025_07_26_510335_create_input_loans_table',1),(146,'2025_07_26_510335_create_supplier_loans_table',1),(147,'2025_10_01_000001_create_production_and_packaging_table',1),(148,'2025_11_11_000001_change_quantity_to_decimal_in_sales_table',1),(149,'2025_11_12_create_budget_item_periods_table',1),(150,'2025_11_19_add_status_po_table',1),(151,'2025_11_20_0000001_create_uom_conversions_table',1),(152,'2025_12_11_000001_create_audit_logs_table',1),(153,'2025_12_11_000001_create_property_management_table',1),(154,'2026-01-20_000001_add_requested_quantity_to_fuel_requisitions_table',1),(155,'2026-01-24_000001_add_disbursed_amount_to_fuel_requisitions_table',1),(156,'2026_01_20_000001_create_cash_requisition_approval_table',1),(157,'2026_01_21_make_rejection_comments_nullable_on_cash_requisition_approvals',1),(158,'2026_01_24_add_posted_to_accounts_gr_table',1),(159,'2026_01_26_add_column_status_reconciliation_table',1),(160,'2026_01_27_100001_create_asset_payments_table',1),(161,'2026_01_27_100001_create_report_layouts_table',1),(162,'2026_01_27_100002_add_column_profit_and_loss_to_fy_table',1),(163,'2026_01_30_000002_update_status_enum_add_pending_to_payroll_approvals',1),(164,'2026_01_30_1000004_create_default_accounts_table',1),(165,'2026_01_31_add_column_is_tax_chart_of_accounts_table',1),(166,'2026_02_03_000001_manage_collateral_tables',1),(167,'2026_02_03_000002_add_vault_table',1),(168,'2026_02_05_000001_add_column_is_tax_account_sub_categories_table',1),(169,'2026_02_05_000002_add_column_is_non_taxable_account_sub_categories_table',1),(170,'2026_02_05_000003_add_column_category_ids_report_layout_table',1),(171,'2026_02_05_000004_add_column_sort_accounts_tables_table',1),(172,'2026_08_02_000001_create_item_purchases_table',1);

--
-- Table structure for table `milestones`
--

CREATE TABLE `milestones` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `due_date` date NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `milestones`
--


--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` bigint unsigned NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_permissions`
--


--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` bigint unsigned NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` VALUES (9,'App\\Models\\User','03e8e97b-cff4-4949-b409-4c3dc6976352'),(9,'App\\Models\\User','042baf55-b9fd-4189-bf60-bc3426ae6504'),(9,'App\\Models\\User','0541c03e-a05a-443d-bda1-4ad252451421'),(1,'App\\Models\\User','09ba2537-d2ac-4b24-99f1-9710a9848540'),(9,'App\\Models\\User','09d0c22e-ff8a-4f3e-b3f7-f63d6ddd4e30'),(9,'App\\Models\\User','12ba56ea-49eb-4243-a32d-fcec6d799e47'),(9,'App\\Models\\User','19b12682-3f57-4ff3-99b7-a0d2e565b861'),(1,'App\\Models\\User','2f53812f-395f-46da-97cd-1b2a21aa41da'),(9,'App\\Models\\User','3b2f297e-c981-4415-b303-42496eedcbb0'),(9,'App\\Models\\User','4afd55da-fd3b-4e31-9abe-a1d5b68aff95'),(9,'App\\Models\\User','4d9d6020-cde2-4d2a-9eaf-99f743355dc4'),(9,'App\\Models\\User','4da4c3ce-1098-40fa-aac2-30fb73b43301'),(9,'App\\Models\\User','4f76120c-b7a7-4797-8b2d-88ffded468c3'),(9,'App\\Models\\User','56f0fcd2-4fa1-463a-9997-2db1a78c7b2c'),(9,'App\\Models\\User','58d73f72-2ec2-4899-a61a-31fae0a06e36'),(9,'App\\Models\\User','5ee98551-e09e-4b94-9d10-0445e6ab5c18'),(9,'App\\Models\\User','652c213d-d058-471a-86e4-18fad2b8fa26'),(9,'App\\Models\\User','66c451b2-a7c4-4a22-95a8-34c3d0e5413b'),(9,'App\\Models\\User','683bd77b-e8ea-4d01-8069-7fd5348dcbcd'),(9,'App\\Models\\User','703c8f89-e05f-41a5-8f09-8577bb4651da'),(9,'App\\Models\\User','70e07d4e-6f13-48bc-a1e6-4c559574b384'),(9,'App\\Models\\User','721556ed-61a0-4f9b-9132-7c09efba5bc0'),(9,'App\\Models\\User','74577dd5-601a-4d0f-82fc-a1481f8d90bf'),(9,'App\\Models\\User','752b1990-a3a0-416e-8555-dde2e561d606'),(9,'App\\Models\\User','75d6ab45-acef-4895-b6aa-4139f5c7736c'),(1,'App\\Models\\User','768bae0b-3b3f-476e-b7a9-4529fa1f9158'),(9,'App\\Models\\User','7a04c448-8902-4abd-82d5-3bfcba78e9fe'),(9,'App\\Models\\User','8bd364f7-8731-4dee-9fd8-bff490392814'),(2,'App\\Models\\User','8c855c64-34dd-4970-a80c-77f1b73be813'),(9,'App\\Models\\User','97014f95-e102-4f16-9495-0447d9813b2d'),(5,'App\\Models\\User','98eae2f6-6d69-4078-b187-e95f8187ee80'),(9,'App\\Models\\User','9bb53385-d6ac-41d3-9647-220cb8b08442'),(7,'App\\Models\\User','a3fc9881-c570-4a43-86cc-e5dc3f465f39'),(9,'App\\Models\\User','b1c6259e-e057-4907-8b10-c122e80820f7'),(9,'App\\Models\\User','b71ed933-ddb0-4b55-8bb9-370c5bd726e6'),(9,'App\\Models\\User','bcc29eb6-2da1-48b0-9ddf-d099cb7ad669'),(9,'App\\Models\\User','bd9dd1a0-80de-464b-86fe-25c24d168077'),(9,'App\\Models\\User','be107e9c-0371-422c-a39b-9e0e24539880'),(9,'App\\Models\\User','bf5d9a00-49d7-4248-8892-42294cdcc560'),(9,'App\\Models\\User','bf745f6a-be55-4dfb-852a-db4114594f6a'),(9,'App\\Models\\User','c323136d-78d6-4bec-b345-16bda3eedfa1'),(9,'App\\Models\\User','c447ffdc-83d1-4be4-9173-9f902f150b17'),(4,'App\\Models\\User','cc10bd7e-9f0e-453d-bece-e76872f0854f'),(9,'App\\Models\\User','d8a7b6cb-30b3-41af-b647-57d388cb7f02'),(3,'App\\Models\\User','db76612e-7eae-40e5-83c9-78f38ed17581'),(9,'App\\Models\\User','dc973442-332f-4762-b364-5d4d38a77e4d'),(9,'App\\Models\\User','ec297908-a1c8-4817-9c76-652062d2c871'),(6,'App\\Models\\User','ffd625c8-6186-446c-bff1-6983463bdabd');

--
-- Table structure for table `movement_approvals`
--

CREATE TABLE `movement_approvals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `movement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approver_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approval_level` int NOT NULL,
  `comments` text COLLATE utf8mb4_unicode_ci,
  `decision` enum('Approved','Rejected','Pending') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `decision_date` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `movement_approvals_movement_id_foreign` (`movement_id`),
  KEY `movement_approvals_approver_id_foreign` (`approver_id`),
  CONSTRAINT `movement_approvals_approver_id_foreign` FOREIGN KEY (`approver_id`) REFERENCES `users` (`id`),
  CONSTRAINT `movement_approvals_movement_id_foreign` FOREIGN KEY (`movement_id`) REFERENCES `asset_movements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `movement_approvals`
--


--
-- Table structure for table `movement_documents`
--

CREATE TABLE `movement_documents` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `movement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `original_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mime_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `size` int NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `movement_documents_movement_id_foreign` (`movement_id`),
  CONSTRAINT `movement_documents_movement_id_foreign` FOREIGN KEY (`movement_id`) REFERENCES `asset_movements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `movement_documents`
--


--
-- Table structure for table `notices`
--

CREATE TABLE `notices` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `rental_agreement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('rent_due','overdue','eviction','renewal') COLLATE utf8mb4_unicode_ci NOT NULL,
  `issued_on` date NOT NULL,
  `delivery_method` enum('sms','email','printed') COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notices_rental_agreement_id_foreign` (`rental_agreement_id`),
  CONSTRAINT `notices_rental_agreement_id_foreign` FOREIGN KEY (`rental_agreement_id`) REFERENCES `rental_agreements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notices`
--


--
-- Table structure for table `oauth_auth_codes`
--

CREATE TABLE `oauth_auth_codes` (
  `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `client_id` bigint unsigned NOT NULL,
  `scopes` text COLLATE utf8mb4_unicode_ci,
  `revoked` tinyint(1) NOT NULL,
  `expires_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `oauth_auth_codes_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `oauth_auth_codes`
--


--
-- Table structure for table `oauth_personal_access_clients`
--

CREATE TABLE `oauth_personal_access_clients` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `client_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `oauth_personal_access_clients`
--

INSERT INTO `oauth_personal_access_clients` VALUES (1,1,'2026-03-10 21:55:46','2026-03-10 21:55:46');

--
-- Table structure for table `offer_approvals`
--

CREATE TABLE `offer_approvals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `offer_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approver_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `offer_approvals_offer_id_foreign` (`offer_id`),
  KEY `offer_approvals_approval_level_id_foreign` (`approval_level_id`),
  KEY `offer_approvals_approver_id_foreign` (`approver_id`),
  CONSTRAINT `offer_approvals_approval_level_id_foreign` FOREIGN KEY (`approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `offer_approvals_approver_id_foreign` FOREIGN KEY (`approver_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `offer_approvals_offer_id_foreign` FOREIGN KEY (`offer_id`) REFERENCES `offers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `offer_approvals`
--


--
-- Table structure for table `offers`
--

CREATE TABLE `offers` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `application_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `offer_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `salary` decimal(12,2) NOT NULL,
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `pay_frequency` enum('hourly','weekly','bi-weekly','monthly','annual') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'annual',
  `start_date` date NOT NULL,
  `benefits` text COLLATE utf8mb4_unicode_ci,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `status` enum('draft','sent','accepted','rejected','withdrawn') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `sent_at` timestamp NULL DEFAULT NULL,
  `accepted_at` timestamp NULL DEFAULT NULL,
  `rejected_at` timestamp NULL DEFAULT NULL,
  `document_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `offers_offer_number_unique` (`offer_number`),
  KEY `offers_application_id_foreign` (`application_id`),
  KEY `offers_currency_id_foreign` (`currency_id`),
  KEY `offers_created_by_foreign` (`created_by`),
  KEY `offers_current_approval_level_id_foreign` (`current_approval_level_id`),
  CONSTRAINT `offers_application_id_foreign` FOREIGN KEY (`application_id`) REFERENCES `applications` (`id`) ON DELETE CASCADE,
  CONSTRAINT `offers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `offers_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `offers_current_approval_level_id_foreign` FOREIGN KEY (`current_approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `offers`
--


--
-- Table structure for table `onboarding_documents`
--

CREATE TABLE `onboarding_documents` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `placement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `due_date` date DEFAULT NULL,
  `completed_date` date DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `template_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `completed_document_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `candidate_signed_at` timestamp NULL DEFAULT NULL,
  `employer_signed_at` timestamp NULL DEFAULT NULL,
  `agency_signed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `onboarding_documents_placement_id_foreign` (`placement_id`),
  CONSTRAINT `onboarding_documents_placement_id_foreign` FOREIGN KEY (`placement_id`) REFERENCES `placements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `onboarding_documents`
--


--
-- Table structure for table `opportunities`
--

CREATE TABLE `opportunities` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lead_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `assigned_to` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `value` decimal(15,2) DEFAULT NULL,
  `stage` enum('initial','negotiation','proposal','closed_won','closed_lost') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'initial',
  `expected_close_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `opportunities_lead_id_foreign` (`lead_id`),
  KEY `opportunities_assigned_to_foreign` (`assigned_to`),
  CONSTRAINT `opportunities_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `opportunities_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `opportunities`
--


--
-- Table structure for table `order_lines`
--

CREATE TABLE `order_lines` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sale_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quote_line_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `qty_ordered` decimal(10,2) NOT NULL,
  `qty_backordered` decimal(10,2) DEFAULT NULL,
  `qty_shipped` decimal(10,2) DEFAULT NULL,
  `uom_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `discount_pct` decimal(12,2) DEFAULT NULL,
  `tax_pct` decimal(15,2) NOT NULL DEFAULT '0.00',
  `line_total` decimal(20,2) NOT NULL,
  `fulfillment_status` enum('pending','partial','fulfilled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_lines_sale_order_id_foreign` (`sale_order_id`),
  KEY `order_lines_quote_line_id_foreign` (`quote_line_id`),
  KEY `order_lines_uom_id_foreign` (`uom_id`),
  CONSTRAINT `order_lines_quote_line_id_foreign` FOREIGN KEY (`quote_line_id`) REFERENCES `quote_lines` (`id`),
  CONSTRAINT `order_lines_sale_order_id_foreign` FOREIGN KEY (`sale_order_id`) REFERENCES `sale_orders` (`id`),
  CONSTRAINT `order_lines_uom_id_foreign` FOREIGN KEY (`uom_id`) REFERENCES `unit_of_measures` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_lines`
--


--
-- Table structure for table `order_package_items`
--

CREATE TABLE `order_package_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_package_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_line_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(10,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`id`),
  KEY `order_package_items_order_package_id_foreign` (`order_package_id`),
  KEY `order_package_items_order_line_id_foreign` (`order_line_id`),
  CONSTRAINT `order_package_items_order_line_id_foreign` FOREIGN KEY (`order_line_id`) REFERENCES `order_lines` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_package_items_order_package_id_foreign` FOREIGN KEY (`order_package_id`) REFERENCES `order_packages` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_package_items`
--


--
-- Table structure for table `order_packages`
--

CREATE TABLE `order_packages` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `package_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sale_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `package_unit_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `weight` decimal(10,2) NOT NULL,
  `length` decimal(10,2) NOT NULL,
  `height` decimal(10,2) NOT NULL,
  `volumetric_weight` decimal(10,2) NOT NULL,
  `package_date` date NOT NULL,
  `packed_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_packages_sale_order_id_foreign` (`sale_order_id`),
  KEY `order_packages_package_unit_id_foreign` (`package_unit_id`),
  KEY `order_packages_packed_by_foreign` (`packed_by`),
  CONSTRAINT `order_packages_package_unit_id_foreign` FOREIGN KEY (`package_unit_id`) REFERENCES `package_units` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_packages_packed_by_foreign` FOREIGN KEY (`packed_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_packages_sale_order_id_foreign` FOREIGN KEY (`sale_order_id`) REFERENCES `sale_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_packages`
--


--
-- Table structure for table `organisation_services`
--

CREATE TABLE `organisation_services` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `service_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `organisation_services`
--


--
-- Table structure for table `organisation_types`
--

CREATE TABLE `organisation_types` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `package_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `organisation_types`
--


--
-- Table structure for table `overtime_requests`
--

CREATE TABLE `overtime_requests` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `overtime_date` date NOT NULL,
  `hours` decimal(5,2) NOT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci,
  `status` enum('Pending','Approved','Rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `overtime_requests_employee_id_foreign` (`employee_id`),
  CONSTRAINT `overtime_requests_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `overtime_requests`
--


--
-- Table structure for table `package_services`
--

CREATE TABLE `package_services` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `package_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `service_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `package_services`
--


--
-- Table structure for table `package_units`
--

CREATE TABLE `package_units` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `length` decimal(10,2) NOT NULL,
  `width` decimal(10,2) NOT NULL,
  `height` decimal(10,2) NOT NULL,
  `max_weight` decimal(10,2) NOT NULL,
  `cost` decimal(10,2) NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `package_units`
--


--
-- Table structure for table `packages`
--

CREATE TABLE `packages` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` int NOT NULL DEFAULT '0',
  `is_for_trial` tinyint(1) NOT NULL DEFAULT '0',
  `billing_cycle_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `packages`
--


--
-- Table structure for table `packaging_stations`
--

CREATE TABLE `packaging_stations` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `packaging_stations`
--


--
-- Table structure for table `packaging_tasks`
--

CREATE TABLE `packaging_tasks` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sale_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `station_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `assigned_to` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('PENDING','IN_PROGRESS','COMPLETED','CANCELLED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING',
  `priority` enum('LOW','MEDIUM','HIGH','URGENT') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'MEDIUM',
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `packaging_tasks_sale_order_id_foreign` (`sale_order_id`),
  KEY `packaging_tasks_assigned_to_foreign` (`assigned_to`),
  KEY `packaging_tasks_station_id_foreign` (`station_id`),
  CONSTRAINT `packaging_tasks_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `packaging_tasks_sale_order_id_foreign` FOREIGN KEY (`sale_order_id`) REFERENCES `sale_orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `packaging_tasks_station_id_foreign` FOREIGN KEY (`station_id`) REFERENCES `packaging_stations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `packaging_tasks`
--


--
-- Table structure for table `partners`
--

CREATE TABLE `partners` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `partner_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contact_person` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_person_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_person_phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `partners`
--


--
-- Table structure for table `payment_methods`
--

CREATE TABLE `payment_methods` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `chart_of_account_id` bigint unsigned NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `require_transaction_ref` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_methods_chart_of_account_id_foreign` (`chart_of_account_id`),
  CONSTRAINT `payment_methods_chart_of_account_id_foreign` FOREIGN KEY (`chart_of_account_id`) REFERENCES `chart_of_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_methods`
--

INSERT INTO `payment_methods` VALUES ('1e9bacbb-39b9-4368-8263-995d82d04a65','CHEQUE','ac7e5b0f-d0dd-44a4-913c-6d365861fad6',531,'CHEQUE',1,'2026-04-23 09:24:05','2026-04-23 09:24:13');

--
-- Table structure for table `payment_schedules`
--

CREATE TABLE `payment_schedules` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contract_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `installment_number` int NOT NULL,
  `due_date` date NOT NULL,
  `principal_amount` decimal(12,2) NOT NULL,
  `interest_amount` decimal(12,2) NOT NULL,
  `fee_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `total_amount` decimal(12,2) NOT NULL,
  `status` enum('Pending','Paid','Overdue','Waived') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `paid_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_schedules_contract_id_foreign` (`contract_id`),
  CONSTRAINT `payment_schedules_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `financing_contracts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_schedules`
--


--
-- Table structure for table `payment_splits`
--

CREATE TABLE `payment_splits` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rental_agreement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `type` enum('owner_portion','management_fee','expense','tax') COLLATE utf8mb4_unicode_ci NOT NULL,
  `calculation_details` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_splits_rental_agreement_id_foreign` (`rental_agreement_id`),
  KEY `payment_splits_payment_id_type_index` (`payment_id`,`type`),
  CONSTRAINT `payment_splits_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `property_payments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payment_splits_rental_agreement_id_foreign` FOREIGN KEY (`rental_agreement_id`) REFERENCES `rental_agreements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_splits`
--


--
-- Table structure for table `payment_voucher_items`
--

CREATE TABLE `payment_voucher_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_voucher_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requisition_item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `chart_of_account_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_voucher_items_payment_voucher_id_foreign` (`payment_voucher_id`),
  KEY `payment_voucher_items_requisition_item_id_foreign` (`requisition_item_id`),
  CONSTRAINT `payment_voucher_items_payment_voucher_id_foreign` FOREIGN KEY (`payment_voucher_id`) REFERENCES `payment_vouchers` (`id`),
  CONSTRAINT `payment_voucher_items_requisition_item_id_foreign` FOREIGN KEY (`requisition_item_id`) REFERENCES `cash_requisition_items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_voucher_items`
--

INSERT INTO `payment_voucher_items` VALUES ('e9256fa3-542b-4a61-8147-14ecf641528b','f39b2049-b98b-4232-82d4-291be0e9d9c4','650a835b-e35c-4c7b-9e57-9322c4974035',200000.00,64,'2026-04-23 09:24:42','2026-04-23 09:24:42',NULL);

--
-- Table structure for table `payment_vouchers`
--

CREATE TABLE `payment_vouchers` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `voucher_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cash_requisition_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_date` date NOT NULL,
  `paid_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('draft','processed','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payment_vouchers_voucher_number_unique` (`voucher_number`),
  KEY `payment_vouchers_cash_requisition_id_foreign` (`cash_requisition_id`),
  KEY `payment_vouchers_paid_by_foreign` (`paid_by`),
  CONSTRAINT `payment_vouchers_cash_requisition_id_foreign` FOREIGN KEY (`cash_requisition_id`) REFERENCES `cash_requisitions` (`id`),
  CONSTRAINT `payment_vouchers_paid_by_foreign` FOREIGN KEY (`paid_by`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_vouchers`
--

INSERT INTO `payment_vouchers` VALUES ('f39b2049-b98b-4232-82d4-291be0e9d9c4','PV-20260423-00001','37ab2f2e-fb4a-498f-af44-700dbbb27c03','2026-04-23','3de7c572-94cb-4a65-b30e-ba55d6c94893','processed','Auto-generated from disbursement','2026-04-23 09:24:42','2026-04-23 09:24:42',NULL);

--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_method_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `received_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_date` date NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `income_portion` decimal(12,2) NOT NULL DEFAULT '0.00',
  `tax_portion` decimal(12,2) NOT NULL DEFAULT '0.00',
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `transaction_reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reversed_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reverse_msg` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','Confirmed','Failed','Reversed','Cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `unique_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payable_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payments_payable_type_payable_id_index` (`payable_type`,`payable_id`),
  KEY `payments_customer_id_foreign` (`customer_id`),
  KEY `payments_currency_id_foreign` (`currency_id`),
  KEY `payments_payment_method_id_foreign` (`payment_method_id`),
  KEY `payments_received_by_foreign` (`received_by`),
  CONSTRAINT `payments_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payments_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payments_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payments_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `employees` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payments`
--


--
-- Table structure for table `payroll_allowances`
--

CREATE TABLE `payroll_allowances` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payroll_run_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `allowance_type` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(20,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_allowances_allowance_type_foreign` (`allowance_type`),
  KEY `payroll_allowances_payroll_run_id_foreign` (`payroll_run_id`),
  KEY `payroll_allowances_employee_id_foreign` (`employee_id`),
  CONSTRAINT `payroll_allowances_allowance_type_foreign` FOREIGN KEY (`allowance_type`) REFERENCES `allowance_types` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_allowances_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_allowances_payroll_run_id_foreign` FOREIGN KEY (`payroll_run_id`) REFERENCES `payroll_runs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_allowances`
--


--
-- Table structure for table `payroll_approvals`
--

CREATE TABLE `payroll_approvals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payroll_net_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approved_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('pending','approved','rejected','reviewed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `remarks` text COLLATE utf8mb4_unicode_ci,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_approvals_payroll_net_id_foreign` (`payroll_net_id`),
  KEY `payroll_approvals_approved_by_foreign` (`approved_by`),
  KEY `payroll_approvals_approval_level_id_foreign` (`approval_level_id`),
  CONSTRAINT `payroll_approvals_approval_level_id_foreign` FOREIGN KEY (`approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_approvals_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_approvals_payroll_net_id_foreign` FOREIGN KEY (`payroll_net_id`) REFERENCES `payroll_nets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_approvals`
--


--
-- Table structure for table `payroll_deductions`
--

CREATE TABLE `payroll_deductions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payroll_run_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deduction_type` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_deductions_deduction_type_foreign` (`deduction_type`),
  KEY `payroll_deductions_payroll_run_id_foreign` (`payroll_run_id`),
  KEY `payroll_deductions_employee_id_foreign` (`employee_id`),
  CONSTRAINT `payroll_deductions_deduction_type_foreign` FOREIGN KEY (`deduction_type`) REFERENCES `deduction_types` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_deductions_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_deductions_payroll_run_id_foreign` FOREIGN KEY (`payroll_run_id`) REFERENCES `payroll_runs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_deductions`
--


--
-- Table structure for table `payroll_grosses`
--

CREATE TABLE `payroll_grosses` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payroll_run_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `basic_pay` decimal(15,2) NOT NULL,
  `allowances_total` decimal(15,2) NOT NULL,
  `overtime_total` decimal(15,2) NOT NULL DEFAULT '0.00',
  `gross_pay` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_grosses_payroll_run_id_index` (`payroll_run_id`),
  KEY `payroll_grosses_employee_id_index` (`employee_id`),
  CONSTRAINT `payroll_grosses_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_grosses_payroll_run_id_foreign` FOREIGN KEY (`payroll_run_id`) REFERENCES `payroll_runs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_grosses`
--


--
-- Table structure for table `payroll_journal_entries`
--

CREATE TABLE `payroll_journal_entries` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payroll_run_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(20,2) NOT NULL DEFAULT '0.00',
  `debit_account` bigint unsigned DEFAULT NULL,
  `credit_account` int DEFAULT NULL,
  `status` enum('draft','gl_posted') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_journal_entries_debit_account_foreign` (`debit_account`),
  CONSTRAINT `payroll_journal_entries_debit_account_foreign` FOREIGN KEY (`debit_account`) REFERENCES `chart_of_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_journal_entries`
--


--
-- Table structure for table `payroll_loan_deductions`
--

CREATE TABLE `payroll_loan_deductions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payroll_run_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_loan_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_loan_deductions_payroll_run_id_foreign` (`payroll_run_id`),
  KEY `payroll_loan_deductions_employee_loan_id_foreign` (`employee_loan_id`),
  KEY `payroll_loan_deductions_employee_id_foreign` (`employee_id`),
  CONSTRAINT `payroll_loan_deductions_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_loan_deductions_employee_loan_id_foreign` FOREIGN KEY (`employee_loan_id`) REFERENCES `employee_loans` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_loan_deductions_payroll_run_id_foreign` FOREIGN KEY (`payroll_run_id`) REFERENCES `payroll_runs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_loan_deductions`
--


--
-- Table structure for table `payroll_nets`
--

CREATE TABLE `payroll_nets` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payroll_run_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_approval_level` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `gross_pay` decimal(15,2) NOT NULL,
  `total_deductions` decimal(15,2) NOT NULL,
  `net_pay` decimal(15,2) NOT NULL,
  `status` enum('pending','approved','rejected','processed','reviewed') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payroll_nets_payroll_run_id_employee_id_unique` (`payroll_run_id`,`employee_id`),
  KEY `payroll_nets_payroll_run_id_index` (`payroll_run_id`),
  KEY `payroll_nets_employee_id_index` (`employee_id`),
  KEY `payroll_nets_current_approval_level_index` (`current_approval_level`),
  KEY `payroll_nets_status_index` (`status`),
  CONSTRAINT `payroll_nets_current_approval_level_foreign` FOREIGN KEY (`current_approval_level`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_nets_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_nets_payroll_run_id_foreign` FOREIGN KEY (`payroll_run_id`) REFERENCES `payroll_runs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_nets`
--


--
-- Table structure for table `payroll_payments`
--

CREATE TABLE `payroll_payments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payroll_net_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_method_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `payment_date` date NOT NULL,
  `reference_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `paid_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_payments_payroll_net_id_index` (`payroll_net_id`),
  KEY `payroll_payments_paid_by_index` (`paid_by`),
  KEY `payroll_payments_payment_date_index` (`payment_date`),
  KEY `payroll_payments_payment_method_id_index` (`payment_method_id`),
  CONSTRAINT `payroll_payments_paid_by_foreign` FOREIGN KEY (`paid_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_payments_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_payments_payroll_net_id_foreign` FOREIGN KEY (`payroll_net_id`) REFERENCES `payroll_nets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_payments`
--


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

CREATE TABLE `payroll_runs` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payroll_schedule_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `run_date` date NOT NULL,
  `remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('generated','gross_generated','net_calculated','paid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'generated',
  `generated_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payroll_runs_payroll_schedule_id_index` (`payroll_schedule_id`),
  KEY `payroll_runs_run_date_index` (`run_date`),
  KEY `payroll_runs_status_index` (`status`),
  KEY `payroll_runs_generated_by_index` (`generated_by`),
  CONSTRAINT `payroll_runs_generated_by_foreign` FOREIGN KEY (`generated_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `payroll_runs_payroll_schedule_id_foreign` FOREIGN KEY (`payroll_schedule_id`) REFERENCES `payroll_schedules` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `payroll_schedules`
--

CREATE TABLE `payroll_schedules` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `scheduled_date` date NOT NULL,
  `paytime` enum('end_of_month','specific_day') COLLATE utf8mb4_unicode_ci NOT NULL,
  `frequency` enum('monthly','bi-weekly','weekly') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'monthly',
  `pay_day` int DEFAULT NULL,
  `is_system_generated` tinyint(1) NOT NULL DEFAULT '0',
  `created_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `status` enum('pending','generated','processed','paid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  PRIMARY KEY (`id`),
  KEY `payroll_schedules_created_by_foreign` (`created_by`),
  KEY `payroll_schedules_organisation_id_index` (`organisation_id`),
  KEY `payroll_schedules_scheduled_date_index` (`scheduled_date`),
  KEY `payroll_schedules_status_index` (`status`),
  CONSTRAINT `payroll_schedules_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payroll_schedules`
--

INSERT INTO `payroll_schedules` VALUES ('7cbb4d9a-6c6e-4dc1-be3e-8fbcbc3ff4f2','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','2026-02-28','2026-04-22','2026-04-22','specific_day','monthly',25,0,'b93d6dcc-79cd-4a45-aeca-1b647f9066d5','2026-04-02 09:21:01','2026-04-02 09:21:01',NULL,'pending');

--
-- Table structure for table `performance_cycles`
--

CREATE TABLE `performance_cycles` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `staff_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `performance_cycles`
--


--
-- Table structure for table `performance_evaluations`
--

CREATE TABLE `performance_evaluations` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `evaluator` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `comments` text COLLATE utf8mb4_unicode_ci,
  `rating` int NOT NULL,
  `evaluation_date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `performance_evaluations_employee_id_foreign` (`employee_id`),
  CONSTRAINT `performance_evaluations_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `performance_evaluations`
--


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

CREATE TABLE `performance_goals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `goal` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `status` enum('Pending','Completed','Failed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `performance_goals_employee_id_foreign` (`employee_id`),
  CONSTRAINT `performance_goals_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `performance_rankings`
--

CREATE TABLE `performance_rankings` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rank` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `performance_rankings_employee_id_foreign` (`employee_id`),
  CONSTRAINT `performance_rankings_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `performance_rankings`
--


--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `service_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=468 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` VALUES (1,'access_accounting_module','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(2,'view_accounting_dashboard','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(3,'view_financial_overview','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(4,'view_chart_of_accounts','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(5,'create_chart_of_account','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(6,'edit_chart_of_account','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(7,'delete_chart_of_account','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(8,'activate_chart_of_account','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(9,'deactivate_chart_of_account','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(10,'view_journal_entries','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(11,'view_journal_entry_audit','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(12,'create_journal_entry','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(13,'edit_journal_entry','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(14,'delete_journal_entry','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(15,'approve_journal_entry','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(16,'reverse_journal_entry','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(17,'post_journal_entry','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(18,'unpost_journal_entry','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(19,'view_payment_methods','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(20,'add_payment_methods','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(21,'edit_payment_methods','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(22,'delete_payment_methods','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(23,'view_accounts_payable','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(24,'create_supplier_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(25,'edit_supplier_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(26,'delete_supplier_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(27,'approve_supplier_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(28,'pay_supplier_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(29,'view_supplier_payment_history','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(30,'manage_credit_notes','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(31,'apply_credit_note','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(32,'view_accounts_receivable','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(33,'create_customer_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(34,'edit_customer_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(35,'delete_customer_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(36,'approve_customer_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(37,'record_customer_payment','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(38,'view_customer_payment_history','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(39,'manage_customer_credit_notes','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(40,'apply_customer_credit_note','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(41,'view_purchase_invoices','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(42,'create_purchase_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(43,'edit_purchase_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(44,'delete_purchase_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(45,'approve_purchase_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(46,'match_purchase_invoice_to_grn','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(47,'unmatch_purchase_invoice','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(48,'view_invoice_matching_history','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(49,'export_purchase_invoices','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(50,'view_bank_accounts','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(51,'add_bank_account','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(52,'edit_bank_account','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(53,'delete_bank_account','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(54,'view_bank_transactions','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(55,'record_bank_transaction','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(56,'perform_bank_reconciliation','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(57,'approve_bank_reconciliation','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(58,'export_bank_transactions','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(59,'import_bank_transactions','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(60,'view_tax_rates','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(61,'create_tax_rate','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(62,'edit_tax_rate','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(63,'delete_tax_rate','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(64,'file_tax_return','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(65,'view_tax_return','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(66,'approve_tax_return','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(67,'generate_tax_report_summary','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(68,'view_trial_balance','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(69,'view_balance_sheet','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(70,'view_income_statement','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(71,'view_cash_flow_statement','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(72,'view_owners_equity_statement','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(73,'view_general_ledger_statement','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(74,'generate_financial_reports','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(75,'export_financial_reports','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(76,'open_accounting_period','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(77,'close_accounting_period','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(78,'reopen_accounting_period','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(79,'view_currencies','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(80,'add_currency','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(81,'edit_currency','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(82,'delete_currency','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(83,'set_exchange_rate','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(84,'manage_fixed_assets_register','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(85,'calculate_depreciation','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(86,'view_audit_trail','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(87,'approve_expenses','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(88,'approve_petty_cash','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(89,'manage_retentions','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(90,'apply_advance_payment','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(91,'recalculate_currency_adjustments','api','5a40b104-ec35-436d-803b-219017431cb2','2026-01-20 02:08:20','2026-01-20 02:08:20'),(92,'access_assets_module','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(93,'view_assets_dashboard','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(94,'view_assets','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(95,'create_asset','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(96,'edit_asset','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(97,'delete_asset','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(98,'approve_asset','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(99,'view_depreciation_schedule','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(100,'run_depreciation','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(101,'reverse_depreciation','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(102,'view_asset_maintenance','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(103,'record_asset_maintenance','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(104,'dispose_asset','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(105,'view_asset_reports','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(106,'export_asset_reports','api','b912970f-dbfe-4cfc-89fc-84a48244a5b7','2026-01-20 02:08:20','2026-01-20 02:08:20'),(107,'access_branches_module','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(108,'view_branches_dashboard','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(109,'view_branches','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(110,'create_branch','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(111,'edit_branch','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(112,'delete_branch','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(113,'activate_branch','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(114,'deactivate_branch','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(115,'view_branch_reports','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(116,'export_branch_reports','api','bf24daaa-4483-4ab0-a265-98d0ef7d9b03','2026-01-20 02:08:20','2026-01-20 02:08:20'),(117,'access_budget_module','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(118,'view_budget_dashboard','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(119,'view_budgets','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(120,'create_budget','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(121,'edit_budget','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(122,'delete_budget','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(123,'approve_budget','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(124,'reject_budget','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(125,'compare_budget_vs_actual','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(126,'generate_budget_report','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(127,'export_budget_report','api','7db34290-b914-448d-9aa2-571b84feb2ce','2026-01-20 02:08:20','2026-01-20 02:08:20'),(128,'access_crm_module','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(129,'view_crm_dashboard','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(130,'view_leads','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(131,'create_lead','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(132,'edit_lead','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(133,'delete_lead','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(134,'assign_lead','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(135,'convert_lead_to_opportunity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(136,'import_leads','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(137,'export_leads','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(138,'view_opportunities','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(139,'create_opportunity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(140,'edit_opportunity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(141,'delete_opportunity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(142,'assign_opportunity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(143,'move_opportunity_stage','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(144,'close_opportunity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(145,'import_opportunities','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(146,'export_opportunities','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(147,'view_contacts','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(148,'create_contact','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(149,'edit_contact','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(150,'delete_contact','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(151,'merge_contacts','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(152,'import_contacts','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(153,'export_contacts','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(154,'view_accounts','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(155,'create_account','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(156,'edit_account','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(157,'delete_account','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(158,'merge_accounts','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(159,'import_accounts','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(160,'export_accounts','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(161,'view_activities','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(162,'create_activity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(163,'edit_activity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(164,'delete_activity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(165,'assign_activity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(166,'complete_activity','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(167,'view_notes','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(168,'add_note','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(169,'edit_note','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(170,'delete_note','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(171,'upload_attachment','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(172,'delete_attachment','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(173,'view_campaigns','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(174,'create_campaign','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(175,'edit_campaign','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(176,'delete_campaign','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(177,'launch_campaign','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(178,'close_campaign','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(179,'view_crm_reports','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(180,'export_crm_reports','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(181,'manage_crm_settings','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(182,'manage_crm_stages','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(183,'manage_crm_sources','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(184,'manage_crm_pipelines','api','8429eeb5-59b4-48c2-8398-f842642129c3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(185,'access_hr_module','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(186,'view_hr_dashboard','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(187,'view_employees','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(188,'create_employee','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(189,'edit_employee','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(190,'delete_employee','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(191,'view_attendance','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(192,'record_attendance','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(193,'view_leave_requests','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(194,'approve_leave_request','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(195,'reject_leave_request','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(196,'view_payroll','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(197,'process_payroll','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(198,'approve_payroll','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(199,'export_payslips','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(200,'view_performance_reviews','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(201,'conduct_performance_review','api','f10a0335-9f50-486d-b354-f67efa44593a','2026-01-20 02:08:20','2026-01-20 02:08:20'),(202,'access_inventory_module','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(203,'view_inventory_dashboard','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(204,'view_inventory','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(205,'adjust_inventory_levels','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(206,'set_reorder_points','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(207,'perform_stock_count','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(208,'approve_stock_adjustment','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(209,'view_warehouses','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(210,'create_warehouse','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(211,'edit_warehouse','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(212,'delete_warehouse','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(213,'transfer_stock','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(214,'view_inventory_reports','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(215,'export_inventory_reports','api','f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','2026-01-20 02:08:20','2026-01-20 02:08:20'),(216,'access_investments_module','api','71fe893c-3956-48f3-bbe8-60b5add3869c','2026-01-20 02:08:20','2026-01-20 02:08:20'),(217,'view_investments_dashboard','api','71fe893c-3956-48f3-bbe8-60b5add3869c','2026-01-20 02:08:20','2026-01-20 02:08:20'),(218,'access_manufacturing_module','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(219,'view_manufacturing_dashboard','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(220,'view_production_orders','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(221,'create_production_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(222,'edit_production_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(223,'delete_production_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(224,'approve_production_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(225,'start_production_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(226,'complete_production_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(227,'cancel_production_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(228,'view_bill_of_materials','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(229,'create_bill_of_materials','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(230,'edit_bill_of_materials','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(231,'delete_bill_of_materials','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(232,'view_work_centers','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(233,'manage_work_centers','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(234,'view_production_routings','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(235,'manage_production_routings','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(236,'view_packaging_orders','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(237,'create_packaging_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(238,'edit_packaging_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(239,'delete_packaging_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(240,'approve_packaging_order','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(241,'start_packaging','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(242,'record_packaging_progress','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(243,'complete_packaging','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(244,'reject_packaged_items','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(245,'approve_packaged_items','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(246,'view_quality_checks','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(247,'record_quality_check','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(248,'approve_quality_check','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(249,'reject_quality_check','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(250,'view_production_reports','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(251,'view_packaging_reports','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(252,'export_production_reports','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(253,'export_packaging_reports','api','87a193ec-15d5-49df-af89-da2ae5f8ba5e','2026-01-20 02:08:20','2026-01-20 02:08:20'),(254,'access_procurement_module','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(255,'view_procurement_dashboard','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(256,'view_purchase_requests','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(257,'create_purchase_request','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(258,'edit_purchase_request','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(259,'delete_purchase_request','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(260,'approve_purchase_request','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(261,'reject_purchase_request','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(262,'upload_purchase_request_attachments','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(263,'delete_purchase_request_attachments','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(264,'view_purchase_orders','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(265,'create_purchase_order','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(266,'edit_purchase_order','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(267,'delete_purchase_order','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(268,'approve_purchase_order','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(269,'receive_purchase_order','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(270,'cancel_purchase_order','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(271,'split_purchase_order','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(272,'duplicate_purchase_order','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(273,'change_purchase_order_supplier','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(274,'upload_purchase_order_attachments','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(275,'delete_purchase_order_attachments','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(276,'view_suppliers','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(277,'create_supplier','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(278,'edit_supplier','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(279,'delete_supplier','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(280,'approve_supplier','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(281,'import_suppliers','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(282,'export_suppliers','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(283,'manage_supplier_contacts','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(284,'manage_supplier_addresses','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(285,'manage_supplier_categories','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(286,'record_goods_receipt','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(287,'approve_goods_receipt','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(288,'approve_partial_goods_receipt','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(289,'edit_goods_receipt','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(290,'delete_goods_receipt','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(291,'return_goods_to_supplier','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(292,'record_damage_goods_receipt','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(293,'import_goods_receipts','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(294,'export_goods_receipts','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(295,'view_goods_receipt_details','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(296,'view_procurement_reports','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(297,'export_procurement_reports','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(298,'view_purchase_request_reports','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(299,'view_purchase_order_reports','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(300,'view_supplier_reports','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(301,'view_goods_receipt_reports','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(302,'manage_procurement_settings','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(303,'manage_procurement_categories','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(304,'manage_procurement_approval_workflows','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(305,'manage_unit_of_measure','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(306,'manage_tax_rates','api','68460011-b08d-40d5-9826-6539fe4796fc','2026-01-20 02:08:20','2026-01-20 02:08:20'),(307,'access_projects_module','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(308,'view_projects_dashboard','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(309,'view_projects','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(310,'create_project','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(311,'edit_project','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(312,'delete_project','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(313,'approve_project','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(314,'view_tasks','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(315,'create_task','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(316,'edit_task','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(317,'delete_task','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(318,'assign_task','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(319,'complete_task','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(320,'view_project_team','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(321,'add_team_member','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(322,'remove_team_member','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(323,'view_milestones','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(324,'create_milestone','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(325,'edit_milestone','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(326,'delete_milestone','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(327,'view_project_reports','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(328,'export_project_reports','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(329,'manage_project_settings','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(330,'manage_project_templates','api','ca5b6609-7812-4a3a-b003-b22a5648aee8','2026-01-20 02:08:20','2026-01-20 02:08:20'),(331,'access_recruitment_module','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:20','2026-01-20 02:08:20'),(332,'view_recruitment_dashboard','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:20','2026-01-20 02:08:20'),(333,'view_job_listings','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:20','2026-01-20 02:08:20'),(334,'create_job_listing','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:20','2026-01-20 02:08:20'),(335,'edit_job_listing','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(336,'delete_job_listing','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(337,'approve_job_listing','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(338,'view_applications','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(339,'create_application','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(340,'edit_application','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(341,'delete_application','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(342,'shortlist_application','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(343,'view_interviews','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(344,'schedule_interview','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(345,'edit_interview','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(346,'delete_interview','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(347,'record_interview_feedback','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(348,'view_offers','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(349,'create_offer','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(350,'edit_offer','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(351,'delete_offer','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(352,'approve_offer','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(353,'view_recruitment_reports','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(354,'export_recruitment_reports','api','19e6b303-d50d-47fb-a697-4c53f2db665d','2026-01-20 02:08:21','2026-01-20 02:08:21'),(355,'access_reports_module','api','dfa6194d-6eca-4e6f-a295-b47f5c91cb08','2026-01-20 02:08:21','2026-01-20 02:08:21'),(356,'view_reports_dashboard','api','dfa6194d-6eca-4e6f-a295-b47f5c91cb08','2026-01-20 02:08:21','2026-01-20 02:08:21'),(357,'access_expense_requisition_module','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(358,'view_expense_requisition_dashboard','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(359,'view_expense_requisitions','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(360,'create_expense_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(361,'edit_expense_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(362,'delete_expense_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(363,'approve_expense_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(364,'reject_expense_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(365,'record_expense_payment','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(366,'edit_expense_payment','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(367,'delete_expense_payment','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(368,'view_expense_requisition_reports','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(369,'export_expense_requisition_reports','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(370,'access_fuel_requisition_module','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(371,'view_fuel_requisition_dashboard','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(372,'view_fuel_requisitions','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(373,'create_fuel_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(374,'edit_fuel_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(375,'delete_fuel_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(376,'approve_fuel_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(377,'reject_fuel_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(378,'record_fuel_payment','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(379,'edit_fuel_payment','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(380,'delete_fuel_payment','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(381,'view_fuel_requisition_reports','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(382,'export_fuel_requisition_reports','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(383,'access_repair_requisition_module','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(384,'view_repair_requisition_dashboard','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(385,'view_repair_requisitions','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(386,'create_repair_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(387,'edit_repair_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(388,'delete_repair_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(389,'approve_repair_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(390,'reject_repair_requisition','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(391,'record_repair_payment','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(392,'edit_repair_payment','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(393,'delete_repair_payment','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(394,'view_repair_requisition_reports','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(395,'export_repair_requisition_reports','api','416afa15-9e39-4d6f-b994-a6f99822a2dc','2026-01-20 02:08:21','2026-01-20 02:08:21'),(396,'access_sales_module','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(397,'view_sales_dashboard','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(398,'view_quotations','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(399,'create_quotation','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(400,'edit_quotation','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(401,'delete_quotation','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(402,'approve_quotation','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(403,'convert_quotation_to_order','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(404,'export_quotations','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(405,'import_quotations','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(406,'view_sales_orders','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(407,'create_sales_order','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(408,'edit_sales_order','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(409,'delete_sales_order','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(410,'approve_sales_order','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(411,'fulfill_sales_order','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(412,'cancel_sales_order','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(413,'export_sales_orders','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(414,'import_sales_orders','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(415,'view_deliveries','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(416,'create_delivery','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(417,'edit_delivery','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(418,'delete_delivery','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(419,'approve_delivery','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(420,'record_delivery_receipt','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(421,'return_delivery','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(422,'export_deliveries','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(423,'import_deliveries','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(424,'view_sales_invoices','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(425,'create_sales_invoice','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(426,'edit_sales_invoice','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(427,'delete_sales_invoice','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(428,'approve_sales_invoice','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(429,'record_sales_payment','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(430,'match_sales_invoice_to_payment','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(431,'unmatch_sales_invoice_payment','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(432,'export_sales_invoices','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(433,'import_sales_invoices','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(434,'access_pos_module','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(435,'view_pos_dashboard','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(436,'create_pos_sale','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(437,'edit_pos_sale','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(438,'delete_pos_sale','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(439,'approve_pos_sale','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(440,'record_pos_payment','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(441,'apply_pos_discount','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(442,'apply_pos_tax','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(443,'refund_pos_sale','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(444,'export_pos_sales','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(445,'import_pos_sales','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(446,'view_pos_sales_reports','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(447,'export_pos_sales_reports','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(448,'generate_pos_summary_report','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(449,'view_pos_audit_trail','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(450,'view_sales_reports','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(451,'export_sales_reports','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(452,'generate_sales_summary','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(453,'view_sales_audit_trail','api','b619fe61-9283-4619-aef6-ff5116bfa9b6','2026-01-20 02:08:21','2026-01-20 02:08:21'),(454,'access_settings_module','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(455,'view_settings_dashboard','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(456,'view_users','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(457,'create_user','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(458,'edit_user','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(459,'delete_user','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(460,'view_roles','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(461,'create_role','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(462,'edit_role','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(463,'delete_role','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(464,'assign_permissions','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(465,'update_system_settings','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(466,'manage_integrations','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21'),(467,'manage_notification_settings','api','ffba6077-da72-4120-984c-d48972f4f568','2026-01-20 02:08:21','2026-01-20 02:08:21');

--
-- Table structure for table `placements`
--

CREATE TABLE `placements` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `application_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `job_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `candidate_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_manager_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `placement_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `employment_type` enum('permanent','contract','temp') COLLATE utf8mb4_unicode_ci NOT NULL,
  `salary` decimal(12,2) DEFAULT NULL,
  `bill_rate` decimal(12,2) DEFAULT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'USD',
  `pay_frequency` enum('hourly','weekly','bi-weekly','monthly','annual') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('active','completed','terminated','extended') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `probation_end_date` date DEFAULT NULL,
  `probation_passed` tinyint(1) DEFAULT NULL,
  `custom_fields` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `placements_placement_number_unique` (`placement_number`),
  KEY `placements_application_id_foreign` (`application_id`),
  KEY `placements_job_order_id_foreign` (`job_order_id`),
  KEY `placements_candidate_id_foreign` (`candidate_id`),
  KEY `placements_account_manager_id_foreign` (`account_manager_id`),
  CONSTRAINT `placements_account_manager_id_foreign` FOREIGN KEY (`account_manager_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `placements_application_id_foreign` FOREIGN KEY (`application_id`) REFERENCES `applications` (`id`) ON DELETE CASCADE,
  CONSTRAINT `placements_candidate_id_foreign` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE,
  CONSTRAINT `placements_job_order_id_foreign` FOREIGN KEY (`job_order_id`) REFERENCES `job_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `placements`
--


--
-- Table structure for table `procurement_approvals`
--

CREATE TABLE `procurement_approvals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approvable_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approvable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approver_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `comments` text COLLATE utf8mb4_unicode_ci,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `procurement_approvals_approvable_id_approvable_type_index` (`approvable_id`,`approvable_type`),
  KEY `procurement_approvals_approval_level_id_foreign` (`approval_level_id`),
  CONSTRAINT `procurement_approvals_approval_level_id_foreign` FOREIGN KEY (`approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `procurement_approvals`
--


--
-- Table structure for table `procurement_attachments`
--

CREATE TABLE `procurement_attachments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `attachable_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `attachable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `procurement_attachments_attachable_id_attachable_type_index` (`attachable_id`,`attachable_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `procurement_attachments`
--


--
-- Table structure for table `procurement_audits`
--

CREATE TABLE `procurement_audits` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` enum('PR','PO','RFQ','BID','GRN','Invoice') COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `old_values` text COLLATE utf8mb4_unicode_ci,
  `new_values` text COLLATE utf8mb4_unicode_ci,
  `ip_address` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `procurement_audits_user_id_foreign` (`user_id`),
  CONSTRAINT `procurement_audits_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `procurement_audits`
--


--
-- Table structure for table `procurement_plan_items`
--

CREATE TABLE `procurement_plan_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `procurement_plan_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `procurement_type` enum('Direct','Indirect') COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `specifications` text COLLATE utf8mb4_unicode_ci,
  `estimated_cost` decimal(20,2) NOT NULL,
  `quantity` int NOT NULL DEFAULT '1',
  `unit_of_measure` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `procurement_method` enum('open_tender','limited_tender','direct_procurement','request_for_quotation','competitive_bidding') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'request_for_quotation',
  `priority` enum('low','medium','high','critical') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `expected_delivery_date` date DEFAULT NULL,
  `budget_allocation_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `required_documents` json DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `procurement_plan_items_budget_allocation_id_foreign` (`budget_allocation_id`),
  KEY `procurement_plan_items_procurement_plan_id_priority_index` (`procurement_plan_id`,`priority`),
  CONSTRAINT `procurement_plan_items_budget_allocation_id_foreign` FOREIGN KEY (`budget_allocation_id`) REFERENCES `budget_allocations` (`id`),
  CONSTRAINT `procurement_plan_items_procurement_plan_id_foreign` FOREIGN KEY (`procurement_plan_id`) REFERENCES `procurement_plans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `procurement_plan_items`
--


--
-- Table structure for table `procurement_plans`
--

CREATE TABLE `procurement_plans` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fiscal_year_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `plan_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('draft','under_review','approved','rejected','active','completed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `total_budget` decimal(20,2) NOT NULL DEFAULT '0.00',
  `committed_budget` decimal(20,2) NOT NULL DEFAULT '0.00',
  `actual_spend` decimal(20,2) NOT NULL DEFAULT '0.00',
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `objectives` text COLLATE utf8mb4_unicode_ci,
  `approval_chain` json DEFAULT NULL,
  `prepared_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approved_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `approval_notes` text COLLATE utf8mb4_unicode_ci,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `procurement_plans_plan_number_unique` (`plan_number`),
  KEY `procurement_plans_fiscal_year_id_foreign` (`fiscal_year_id`),
  KEY `procurement_plans_prepared_by_foreign` (`prepared_by`),
  KEY `procurement_plans_approved_by_foreign` (`approved_by`),
  KEY `procurement_plans_organisation_id_status_index` (`organisation_id`,`status`),
  KEY `procurement_plans_organisation_id_index` (`organisation_id`),
  CONSTRAINT `procurement_plans_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `employees` (`id`),
  CONSTRAINT `procurement_plans_fiscal_year_id_foreign` FOREIGN KEY (`fiscal_year_id`) REFERENCES `fiscal_years` (`id`),
  CONSTRAINT `procurement_plans_prepared_by_foreign` FOREIGN KEY (`prepared_by`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `procurement_plans`
--


--
-- Table structure for table `produce_deliveries`
--

CREATE TABLE `produce_deliveries` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `member_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `input_loan_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `product_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity_kg` decimal(10,2) NOT NULL,
  `price_per_kg` decimal(10,2) NOT NULL,
  `total_value` decimal(10,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `produce_deliveries_product_id_foreign` (`product_id`),
  KEY `produce_deliveries_input_loan_id_foreign` (`input_loan_id`),
  KEY `produce_deliveries_member_id_foreign` (`member_id`),
  CONSTRAINT `produce_deliveries_input_loan_id_foreign` FOREIGN KEY (`input_loan_id`) REFERENCES `input_loans` (`id`) ON DELETE CASCADE,
  CONSTRAINT `produce_deliveries_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `members` (`id`) ON DELETE CASCADE,
  CONSTRAINT `produce_deliveries_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `produce_deliveries`
--


--
-- Table structure for table `production_batches`
--

CREATE TABLE `production_batches` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `production_schedule_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `machine_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `operator_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_time` timestamp NOT NULL,
  `end_time` timestamp NULL DEFAULT NULL,
  `uom_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity_produced` decimal(15,3) NOT NULL DEFAULT '0.000',
  `status` enum('planned','in_progress','completed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'planned',
  `created_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `production_batches_organisation_id_foreign` (`organisation_id`),
  KEY `production_batches_machine_id_foreign` (`machine_id`),
  KEY `production_batches_operator_id_foreign` (`operator_id`),
  KEY `production_batches_created_by_foreign` (`created_by`),
  KEY `production_batches_uom_id_foreign` (`uom_id`),
  CONSTRAINT `production_batches_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `employees` (`id`),
  CONSTRAINT `production_batches_machine_id_foreign` FOREIGN KEY (`machine_id`) REFERENCES `machines` (`id`),
  CONSTRAINT `production_batches_operator_id_foreign` FOREIGN KEY (`operator_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `production_batches_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`),
  CONSTRAINT `production_batches_uom_id_foreign` FOREIGN KEY (`uom_id`) REFERENCES `unit_of_measures` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `production_batches`
--


--
-- Table structure for table `production_outputs`
--

CREATE TABLE `production_outputs` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `uom_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(15,3) NOT NULL,
  `unit_cost` decimal(15,2) NOT NULL DEFAULT '0.00',
  `output_type` enum('main','byproduct','waste') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'main',
  `transferred_to_store` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `production_outputs_batch_id_foreign` (`batch_id`),
  KEY `production_outputs_item_id_foreign` (`item_id`),
  KEY `production_outputs_uom_id_foreign` (`uom_id`),
  CONSTRAINT `production_outputs_batch_id_foreign` FOREIGN KEY (`batch_id`) REFERENCES `production_batches` (`id`) ON DELETE CASCADE,
  CONSTRAINT `production_outputs_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `production_outputs_uom_id_foreign` FOREIGN KEY (`uom_id`) REFERENCES `unit_of_measures` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `production_outputs`
--


--
-- Table structure for table `production_quality_checks`
--

CREATE TABLE `production_quality_checks` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `batch_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `checkable_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `checkable_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `inspector_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `check_date` date NOT NULL,
  `result` enum('pass','fail','rework') COLLATE utf8mb4_unicode_ci NOT NULL,
  `remark` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `production_quality_checks_organisation_id_foreign` (`organisation_id`),
  KEY `production_quality_checks_batch_id_foreign` (`batch_id`),
  KEY `production_quality_checks_inspector_id_foreign` (`inspector_id`),
  CONSTRAINT `production_quality_checks_batch_id_foreign` FOREIGN KEY (`batch_id`) REFERENCES `production_batches` (`id`),
  CONSTRAINT `production_quality_checks_inspector_id_foreign` FOREIGN KEY (`inspector_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `production_quality_checks_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `production_quality_checks`
--


--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `muvu_uid` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `products`
--


--
-- Table structure for table `project_budgets`
--

CREATE TABLE `project_budgets` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `budget_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `project_budgets_budget_id_foreign` (`budget_id`),
  KEY `project_budgets_project_id_foreign` (`project_id`),
  CONSTRAINT `project_budgets_budget_id_foreign` FOREIGN KEY (`budget_id`) REFERENCES `budgets` (`id`) ON DELETE CASCADE,
  CONSTRAINT `project_budgets_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_budgets`
--


--
-- Table structure for table `project_categories`
--

CREATE TABLE `project_categories` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_categories`
--


--
-- Table structure for table `project_comments`
--

CREATE TABLE `project_comments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_comment` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `project_comments_project_id_foreign` (`project_id`),
  CONSTRAINT `project_comments_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_comments`
--


--
-- Table structure for table `project_files`
--

CREATE TABLE `project_files` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_path` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `uploaded_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `project_files_project_id_foreign` (`project_id`),
  KEY `project_files_uploaded_by_foreign` (`uploaded_by`),
  CONSTRAINT `project_files_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  CONSTRAINT `project_files_uploaded_by_foreign` FOREIGN KEY (`uploaded_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_files`
--


--
-- Table structure for table `project_partners`
--

CREATE TABLE `project_partners` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `partner_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('Sponsor','Manager','Client','Contractor','Consultant','Supplier','Team Member','Regulatory Body','Investor','Strategic Partner','Community Stakeholder') COLLATE utf8mb4_unicode_ci NOT NULL,
  `role` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `project_partners_partner_id_project_id_unique` (`partner_id`,`project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_partners`
--


--
-- Table structure for table `project_roles`
--

CREATE TABLE `project_roles` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `project_roles_project_id_foreign` (`project_id`),
  CONSTRAINT `project_roles_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_roles`
--


--
-- Table structure for table `project_teams`
--

CREATE TABLE `project_teams` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_role_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `project_teams_project_id_foreign` (`project_id`),
  KEY `project_teams_employee_id_foreign` (`employee_id`),
  KEY `project_teams_project_role_id_foreign` (`project_role_id`),
  CONSTRAINT `project_teams_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `project_teams_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  CONSTRAINT `project_teams_project_role_id_foreign` FOREIGN KEY (`project_role_id`) REFERENCES `project_roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_teams`
--


--
-- Table structure for table `project_timesheets`
--

CREATE TABLE `project_timesheets` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `activity_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `startdate` date NOT NULL,
  `enddate` date NOT NULL,
  `hours_worked` int DEFAULT NULL,
  `overtime_hours_worked` int DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `project_timesheets`
--


--
-- Table structure for table `projects`
--

CREATE TABLE `projects` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_category_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sector_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `prioty` enum('High','Medium','Low') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Low',
  `status` enum('Not Started','In Progress','Completed','On Hold','Cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Not Started',
  `cost` decimal(20,2) DEFAULT NULL,
  `challenges` text COLLATE utf8mb4_unicode_ci,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reporting_period` enum('Daily','Weekly','Bi-weekly','Monthly','Quarterly','Semi-Annually','Annually','Biennially','Ad-hoc') COLLATE utf8mb4_unicode_ci NOT NULL,
  `project_manager` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `recommendations` text COLLATE utf8mb4_unicode_ci,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `projects`
--


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

CREATE TABLE `properties` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `landlord_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `locality_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `purpose` enum('commercial','residential','industrial','mixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'residential',
  `management_fee_type` enum('percentage','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percentage',
  `management_fee` decimal(20,2) NOT NULL DEFAULT '0.00',
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `postal_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latitude` decimal(20,8) DEFAULT NULL,
  `longitude` decimal(20,8) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `properties_code_unique` (`code`),
  KEY `properties_landlord_id_foreign` (`landlord_id`),
  KEY `properties_locality_id_foreign` (`locality_id`),
  CONSTRAINT `properties_landlord_id_foreign` FOREIGN KEY (`landlord_id`) REFERENCES `landlords` (`id`) ON DELETE CASCADE,
  CONSTRAINT `properties_locality_id_foreign` FOREIGN KEY (`locality_id`) REFERENCES `localities` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `property_expenses`
--

CREATE TABLE `property_expenses` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `property_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `unit_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `maintenance_task_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` decimal(12,2) NOT NULL,
  `expense_date` date NOT NULL,
  `type` enum('maintenance','insurance','tax','utility','other') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'maintenance',
  `paid_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_method_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `attachment_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','paid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'paid',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `property_expenses_maintenance_task_id_foreign` (`maintenance_task_id`),
  KEY `property_expenses_property_id_foreign` (`property_id`),
  KEY `property_expenses_unit_id_foreign` (`unit_id`),
  CONSTRAINT `property_expenses_maintenance_task_id_foreign` FOREIGN KEY (`maintenance_task_id`) REFERENCES `maintenance_tasks` (`id`) ON DELETE SET NULL,
  CONSTRAINT `property_expenses_property_id_foreign` FOREIGN KEY (`property_id`) REFERENCES `properties` (`id`) ON DELETE CASCADE,
  CONSTRAINT `property_expenses_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `property_units` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `property_expenses`
--


--
-- Table structure for table `property_images`
--

CREATE TABLE `property_images` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `property_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `image_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `meta_data` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `property_images_property_id_foreign` (`property_id`),
  CONSTRAINT `property_images_property_id_foreign` FOREIGN KEY (`property_id`) REFERENCES `properties` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `property_images`
--


--
-- Table structure for table `property_payments`
--

CREATE TABLE `property_payments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rental_agreement_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rent_period_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payable_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `paid_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payable_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_date` date NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `payment_method_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile_money_number` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('COMPLETED','PENDING','FAILED','REVERSED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'COMPLETED',
  `receipt_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `attachment_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `property_payments_receipt_number_unique` (`receipt_number`),
  KEY `property_payments_rental_agreement_id_foreign` (`rental_agreement_id`),
  KEY `property_payments_payment_method_id_foreign` (`payment_method_id`),
  KEY `property_payments_rent_period_id_foreign` (`rent_period_id`),
  KEY `property_payments_paid_by_foreign` (`paid_by`),
  KEY `property_payments_payment_date_status_rental_agreement_id_index` (`payment_date`,`status`,`rental_agreement_id`),
  KEY `property_payments_payable_type_payable_id_index` (`payable_type`,`payable_id`),
  CONSTRAINT `property_payments_paid_by_foreign` FOREIGN KEY (`paid_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `property_payments_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`) ON DELETE CASCADE,
  CONSTRAINT `property_payments_rent_period_id_foreign` FOREIGN KEY (`rent_period_id`) REFERENCES `rent_periods` (`id`) ON DELETE CASCADE,
  CONSTRAINT `property_payments_rental_agreement_id_foreign` FOREIGN KEY (`rental_agreement_id`) REFERENCES `rental_agreements` (`id`) ON DELETE CASCADE,
  CONSTRAINT `chk_payment_amount` CHECK ((`amount` > 0))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `property_payments`
--


--
-- Table structure for table `property_units`
--

CREATE TABLE `property_units` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `property_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `unit_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_type_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rent_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('vacant','occupied','maintenance') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'vacant',
  `metadata` json DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `property_units_property_id_unit_number_unique` (`property_id`,`unit_number`),
  KEY `property_units_unit_type_id_foreign` (`unit_type_id`),
  KEY `property_units_currency_id_foreign` (`currency_id`),
  CONSTRAINT `property_units_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `property_units_property_id_foreign` FOREIGN KEY (`property_id`) REFERENCES `properties` (`id`) ON DELETE CASCADE,
  CONSTRAINT `property_units_unit_type_id_foreign` FOREIGN KEY (`unit_type_id`) REFERENCES `unit_types` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `property_units`
--


--
-- Table structure for table `public_holidays`
--

CREATE TABLE `public_holidays` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `public_holidays`
--


--
-- Table structure for table `purchase_invoice_grn_matches`
--

CREATE TABLE `purchase_invoice_grn_matches` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `grn_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `matched_amount` decimal(20,2) NOT NULL DEFAULT '0.00',
  `matched_quantity` decimal(20,4) DEFAULT NULL,
  `status` enum('matched','partial','overbilled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'matched',
  `remarks` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchase_invoice_grn_matches_invoice_id_grn_id_unique` (`invoice_id`,`grn_id`),
  KEY `purchase_invoice_grn_matches_grn_id_foreign` (`grn_id`),
  CONSTRAINT `purchase_invoice_grn_matches_grn_id_foreign` FOREIGN KEY (`grn_id`) REFERENCES `goods_receipts` (`id`) ON DELETE RESTRICT,
  CONSTRAINT `purchase_invoice_grn_matches_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `purchase_invoices` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_invoice_grn_matches`
--


--
-- Table structure for table `purchase_invoice_items`
--

CREATE TABLE `purchase_invoice_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `purchase_invoice_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `purchase_order_item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `grn_item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_price` decimal(20,4) NOT NULL DEFAULT '0.0000',
  `quantity` decimal(20,4) NOT NULL DEFAULT '0.0000',
  `amount` decimal(20,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_invoice_items_purchase_invoice_id_foreign` (`purchase_invoice_id`),
  CONSTRAINT `purchase_invoice_items_purchase_invoice_id_foreign` FOREIGN KEY (`purchase_invoice_id`) REFERENCES `purchase_invoices` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_invoice_items`
--


--
-- Table structure for table `purchase_invoices`
--

CREATE TABLE `purchase_invoices` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `purchase_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_date` date NOT NULL,
  `due_date` date DEFAULT NULL,
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `total_amount` decimal(20,2) NOT NULL,
  `status` enum('pending','partially_paid','paid','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchase_invoices_invoice_number_unique` (`invoice_number`),
  KEY `purchase_invoices_purchase_order_id_foreign` (`purchase_order_id`),
  CONSTRAINT `purchase_invoices_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_invoices`
--


--
-- Table structure for table `purchase_order_items`
--

CREATE TABLE `purchase_order_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `purchase_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` decimal(20,2) NOT NULL,
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `unit_price` decimal(20,2) NOT NULL,
  `total_price` decimal(20,2) GENERATED ALWAYS AS ((`quantity` * `unit_price`)) STORED,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `status` enum('Pending','Reviewed','Approved','Rejected','Processed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `posted_to_accounts_at` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_order_items_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `purchase_order_items_unit_id_foreign` (`unit_id`),
  CONSTRAINT `purchase_order_items_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_order_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `unit_of_measures` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_order_items`
--


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

CREATE TABLE `purchase_orders` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `po_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_evaluation_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `purchase_requisition_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `po_date` date NOT NULL,
  `expected_delivery_date` date DEFAULT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `total_amount` decimal(20,2) NOT NULL DEFAULT '0.00',
  `status` enum('Pending','Processing','Completed','Reviewed','Approved','Rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchase_orders_po_number_unique` (`po_number`),
  KEY `purchase_orders_currency_id_foreign` (`currency_id`),
  KEY `purchase_orders_current_approval_level_id_foreign` (`current_approval_level_id`),
  KEY `purchase_orders_supplier_id_foreign` (`supplier_id`),
  KEY `purchase_orders_purchase_requisition_id_foreign` (`purchase_requisition_id`),
  KEY `purchase_orders_rfq_evaluation_id_foreign` (`rfq_evaluation_id`),
  CONSTRAINT `purchase_orders_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_orders_current_approval_level_id_foreign` FOREIGN KEY (`current_approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_orders_purchase_requisition_id_foreign` FOREIGN KEY (`purchase_requisition_id`) REFERENCES `purchase_requisitions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_orders_rfq_evaluation_id_foreign` FOREIGN KEY (`rfq_evaluation_id`) REFERENCES `rfq_evaluations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_orders_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `purchase_requisition_items`
--

CREATE TABLE `purchase_requisition_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requisition_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `uom_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `estimated_unit_price` decimal(20,2) NOT NULL DEFAULT '0.00',
  `estimated_total_price` decimal(20,2) GENERATED ALWAYS AS ((`quantity` * `estimated_unit_price`)) STORED,
  `specification` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `budget_item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `project_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_quantity` int DEFAULT NULL,
  `approved_cost_estimate` decimal(20,2) NOT NULL DEFAULT '0.00',
  `approved_total_cost_estimate` decimal(20,2) GENERATED ALWAYS AS ((`approved_quantity` * `approved_cost_estimate`)) STORED,
  `item_delivery_date` date DEFAULT NULL,
  `status` enum('Pending','Reviewed','Approved','Rejected','Processed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_requisition_items_project_id_foreign` (`project_id`),
  KEY `purchase_requisition_items_currency_id_foreign` (`currency_id`),
  KEY `purchase_requisition_items_requisition_id_foreign` (`requisition_id`),
  KEY `purchase_requisition_items_budget_item_id_foreign` (`budget_item_id`),
  KEY `purchase_requisition_items_uom_id_foreign` (`uom_id`),
  CONSTRAINT `purchase_requisition_items_budget_item_id_foreign` FOREIGN KEY (`budget_item_id`) REFERENCES `budget_items` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_requisition_items_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_requisition_items_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_requisition_items_requisition_id_foreign` FOREIGN KEY (`requisition_id`) REFERENCES `purchase_requisitions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_requisition_items_uom_id_foreign` FOREIGN KEY (`uom_id`) REFERENCES `unit_of_measures` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_requisition_items`
--


--
-- Table structure for table `purchase_requisitions`
--

CREATE TABLE `purchase_requisitions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `request_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `procurement_plan_item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `procurement_type` enum('Direct','Indirect') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Direct',
  `requisition_date` date NOT NULL,
  `required_by_date` date DEFAULT NULL,
  `priority` enum('Low','Medium','High') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Medium',
  `requested_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `department_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `budget_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `attachments` text COLLATE utf8mb4_unicode_ci,
  `purpose` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `special_instructions` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('Pending','Reviewed','Approved','Rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `rejection_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rejected_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchase_requisitions_request_no_unique` (`request_no`),
  KEY `purchase_requisitions_department_id_foreign` (`department_id`),
  KEY `purchase_requisitions_budget_id_foreign` (`budget_id`),
  KEY `purchase_requisitions_current_approval_level_id_foreign` (`current_approval_level_id`),
  KEY `purchase_requisitions_requested_by_foreign` (`requested_by`),
  KEY `purchase_requisitions_rejected_by_foreign` (`rejected_by`),
  KEY `purchase_requisitions_procurement_plan_item_id_foreign` (`procurement_plan_item_id`),
  CONSTRAINT `purchase_requisitions_budget_id_foreign` FOREIGN KEY (`budget_id`) REFERENCES `budgets` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_requisitions_current_approval_level_id_foreign` FOREIGN KEY (`current_approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_requisitions_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_requisitions_procurement_plan_item_id_foreign` FOREIGN KEY (`procurement_plan_item_id`) REFERENCES `procurement_plan_items` (`id`),
  CONSTRAINT `purchase_requisitions_rejected_by_foreign` FOREIGN KEY (`rejected_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_requisitions_requested_by_foreign` FOREIGN KEY (`requested_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_requisitions`
--


--
-- Table structure for table `qualifications`
--

CREATE TABLE `qualifications` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `candidate_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `institution` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `field_of_study` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `award` enum('PLE','O-Level','A-Level','Certificate','Diploma','Degree','PGD','Masters','PHD') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Degree',
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `is_completed` tinyint(1) NOT NULL DEFAULT '1',
  `attachment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `qualifications_candidate_id_foreign` (`candidate_id`),
  CONSTRAINT `qualifications_candidate_id_foreign` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `qualifications`
--


--
-- Table structure for table `quality_assessments`
--

CREATE TABLE `quality_assessments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sample_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `gross_percentage` decimal(5,2) DEFAULT NULL,
  `good_beans_percentage` decimal(5,2) DEFAULT NULL,
  `defect_percentage` decimal(5,2) DEFAULT NULL,
  `moisture_percentage` decimal(5,2) DEFAULT NULL,
  `assessed_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `current_approval_level` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remarks` text COLLATE utf8mb4_unicode_ci,
  `status` enum('draft','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `quality_assessments_sample_id_foreign` (`sample_id`),
  KEY `quality_assessments_organisation_id_foreign` (`organisation_id`),
  KEY `quality_assessments_assessed_by_foreign` (`assessed_by`),
  KEY `quality_assessments_current_approval_level_foreign` (`current_approval_level`),
  CONSTRAINT `quality_assessments_assessed_by_foreign` FOREIGN KEY (`assessed_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `quality_assessments_current_approval_level_foreign` FOREIGN KEY (`current_approval_level`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `quality_assessments_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `quality_assessments_sample_id_foreign` FOREIGN KEY (`sample_id`) REFERENCES `samples` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `quality_assessments`
--


--
-- Table structure for table `quote_lines`
--

CREATE TABLE `quote_lines` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quote_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `uom` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `tax_amount` decimal(5,2) NOT NULL DEFAULT '0.00',
  `line_total` decimal(12,2) GENERATED ALWAYS AS (((`quantity` * `unit_price`) + `tax_amount`)) STORED,
  `sort_order` int NOT NULL DEFAULT '0',
  `service_date` date DEFAULT NULL,
  `service_duration` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `warehouse_location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `quote_lines_quote_id_foreign` (`quote_id`),
  KEY `quote_lines_uom_foreign` (`uom`),
  CONSTRAINT `quote_lines_quote_id_foreign` FOREIGN KEY (`quote_id`) REFERENCES `quotes` (`id`),
  CONSTRAINT `quote_lines_uom_foreign` FOREIGN KEY (`uom`) REFERENCES `unit_of_measures` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `quote_lines`
--


--
-- Table structure for table `quotes`
--

CREATE TABLE `quotes` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `opportunity_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quotation_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `version` int NOT NULL DEFAULT '1',
  `issue_date` date NOT NULL,
  `expiry_date` date NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `subtotal` decimal(12,2) NOT NULL DEFAULT '0.00',
  `tax_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `discount_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `total_amount` decimal(12,2) GENERATED ALWAYS AS (((`subtotal` + `tax_amount`) - `discount_amount`)) STORED,
  `status` enum('draft','sent','accepted','rejected','expired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `created_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `quotes_quotation_number_unique` (`quotation_number`),
  KEY `quotes_customer_id_foreign` (`customer_id`),
  KEY `quotes_created_by_foreign` (`created_by`),
  KEY `quotes_opportunity_id_foreign` (`opportunity_id`),
  CONSTRAINT `quotes_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `employees` (`id`),
  CONSTRAINT `quotes_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `quotes_opportunity_id_foreign` FOREIGN KEY (`opportunity_id`) REFERENCES `opportunities` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `quotes`
--


--
-- Table structure for table `reconciliation_adjustments`
--

CREATE TABLE `reconciliation_adjustments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reconciliation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('bank_charge','interest_income','bank_error','book_error') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `posted_to_gl` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reconciliation_adjustments`
--


--
-- Table structure for table `reconciliation_disputes`
--

CREATE TABLE `reconciliation_disputes` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reconciliation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank_transaction_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `dispute_reason` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `dispute_type` enum('amount','date','duplicate','missing','other') COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('open','investigating','resolved','escalated') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `assigned_to` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `resolved_at` timestamp NULL DEFAULT NULL,
  `resolution_notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `reconciliation_disputes_reconciliation_id_foreign` (`reconciliation_id`),
  KEY `reconciliation_disputes_bank_transaction_id_foreign` (`bank_transaction_id`),
  KEY `reconciliation_disputes_assigned_to_foreign` (`assigned_to`),
  CONSTRAINT `reconciliation_disputes_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `reconciliation_disputes_bank_transaction_id_foreign` FOREIGN KEY (`bank_transaction_id`) REFERENCES `bank_transactions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `reconciliation_disputes_reconciliation_id_foreign` FOREIGN KEY (`reconciliation_id`) REFERENCES `reconciliations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reconciliation_disputes`
--


--
-- Table structure for table `reconciliation_items`
--

CREATE TABLE `reconciliation_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reconciliation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank_transaction_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `journal_transaction_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `match_type` enum('manual','partial') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'manual',
  `matched_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `matched_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reconciliation_items`
--


--
-- Table structure for table `reconciliation_summaries`
--

CREATE TABLE `reconciliation_summaries` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reconciliation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_transactions` int NOT NULL DEFAULT '0',
  `matched_transactions` int NOT NULL DEFAULT '0',
  `unmatched_transactions` int NOT NULL DEFAULT '0',
  `auto_matched` int NOT NULL DEFAULT '0',
  `manual_matched` int NOT NULL DEFAULT '0',
  `total_matched_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `total_unmatched_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `reconciliation_summaries_reconciliation_id_unique` (`reconciliation_id`),
  CONSTRAINT `reconciliation_summaries_reconciliation_id_foreign` FOREIGN KEY (`reconciliation_id`) REFERENCES `reconciliations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reconciliation_summaries`
--


--
-- Table structure for table `reconciliations`
--

CREATE TABLE `reconciliations` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank_account_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank_statement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `as_at_date` date NOT NULL,
  `statement_closing_balance` decimal(15,2) NOT NULL,
  `book_closing_balance` decimal(15,2) NOT NULL,
  `unpresented_cheques` decimal(15,2) NOT NULL DEFAULT '0.00',
  `deposits_in_transit` decimal(15,2) NOT NULL DEFAULT '0.00',
  `bank_adjustments` decimal(15,2) NOT NULL DEFAULT '0.00',
  `book_adjustments` decimal(15,2) NOT NULL DEFAULT '0.00',
  `reconciled_balance` decimal(15,2) NOT NULL,
  `difference` decimal(15,2) NOT NULL,
  `status` enum('draft','completed','completed-unbalanced','approved','finalized') COLLATE utf8mb4_unicode_ci DEFAULT 'draft',
  `created_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approved_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reconciliations`
--


--
-- Table structure for table `recruitment_commission_payments`
--

CREATE TABLE `recruitment_commission_payments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `commission_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_transaction_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` decimal(12,2) NOT NULL,
  `payment_date` date NOT NULL,
  `payment_method` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_reference` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruitment_commission_payments_commission_id_foreign` (`commission_id`),
  KEY `recruitment_commission_payments_invoice_id_foreign` (`invoice_id`),
  CONSTRAINT `recruitment_commission_payments_commission_id_foreign` FOREIGN KEY (`commission_id`) REFERENCES `recruitment_commissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `recruitment_commission_payments_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `recruitment_invoices` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `recruitment_commission_payments`
--


--
-- Table structure for table `recruitment_commissions`
--

CREATE TABLE `recruitment_commissions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `commission_structure_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recipient` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'User ID for recruiter, Candidate ID for candidate',
  `placement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `status` enum('pending','approved','paid','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `type` enum('placement_fee','finder_fee','referral_fee','temp_placement','renewal','bonus') COLLATE utf8mb4_unicode_ci NOT NULL,
  `payable_date` date DEFAULT NULL,
  `paid_date` date DEFAULT NULL,
  `invoice_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Invoice for commission payment',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruitment_commissions_commission_structure_id_foreign` (`commission_structure_id`),
  KEY `recruitment_commissions_placement_id_foreign` (`placement_id`),
  KEY `recruitment_commissions_invoice_id_foreign` (`invoice_id`),
  CONSTRAINT `recruitment_commissions_commission_structure_id_foreign` FOREIGN KEY (`commission_structure_id`) REFERENCES `commission_structures` (`id`) ON DELETE CASCADE,
  CONSTRAINT `recruitment_commissions_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `recruitment_invoices` (`id`) ON DELETE SET NULL,
  CONSTRAINT `recruitment_commissions_placement_id_foreign` FOREIGN KEY (`placement_id`) REFERENCES `placements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `recruitment_commissions`
--


--
-- Table structure for table `recruitment_invoice_items`
--

CREATE TABLE `recruitment_invoice_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(10,2) NOT NULL DEFAULT '1.00',
  `unit_price` decimal(12,2) NOT NULL,
  `tax_rate` decimal(5,2) NOT NULL DEFAULT '0.00',
  `total_amount` decimal(12,2) NOT NULL,
  `placement_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `commission_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruitment_invoice_items_invoice_id_foreign` (`invoice_id`),
  KEY `recruitment_invoice_items_placement_id_foreign` (`placement_id`),
  KEY `recruitment_invoice_items_commission_id_foreign` (`commission_id`),
  CONSTRAINT `recruitment_invoice_items_commission_id_foreign` FOREIGN KEY (`commission_id`) REFERENCES `recruitment_commissions` (`id`) ON DELETE SET NULL,
  CONSTRAINT `recruitment_invoice_items_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `recruitment_invoices` (`id`) ON DELETE CASCADE,
  CONSTRAINT `recruitment_invoice_items_placement_id_foreign` FOREIGN KEY (`placement_id`) REFERENCES `placements` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `recruitment_invoice_items`
--


--
-- Table structure for table `recruitment_invoices`
--

CREATE TABLE `recruitment_invoices` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_type` enum('client','candidate') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'client',
  `placement_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `candidate_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `commision_structure_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `prn` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_date` date NOT NULL,
  `due_date` date NOT NULL,
  `status` enum('draft','sent','paid','overdue','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `subtotal` decimal(12,2) NOT NULL,
  `tax_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `total_amount` decimal(12,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'USD',
  `paid_date` date DEFAULT NULL,
  `payment_method` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `document_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `recruitment_invoices_prn_unique` (`prn`),
  KEY `recruitment_invoices_placement_id_foreign` (`placement_id`),
  KEY `recruitment_invoices_company_id_foreign` (`company_id`),
  KEY `recruitment_invoices_candidate_id_foreign` (`candidate_id`),
  KEY `recruitment_invoices_commision_structure_id_foreign` (`commision_structure_id`),
  CONSTRAINT `recruitment_invoices_candidate_id_foreign` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE SET NULL,
  CONSTRAINT `recruitment_invoices_commision_structure_id_foreign` FOREIGN KEY (`commision_structure_id`) REFERENCES `commission_structures` (`id`) ON DELETE SET NULL,
  CONSTRAINT `recruitment_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE SET NULL,
  CONSTRAINT `recruitment_invoices_placement_id_foreign` FOREIGN KEY (`placement_id`) REFERENCES `placements` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `recruitment_invoices`
--


--
-- Table structure for table `recruitments`
--

CREATE TABLE `recruitments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `job_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `job_description` text COLLATE utf8mb4_unicode_ci,
  `department_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `posted_date` date NOT NULL,
  `closing_date` date NOT NULL,
  `status` enum('Open','Closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Open',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recruitments_department_id_foreign` (`department_id`),
  CONSTRAINT `recruitments_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `recruitments`
--


--
-- Table structure for table `regions`
--

CREATE TABLE `regions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `country_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `regions_country_id_foreign` (`country_id`),
  CONSTRAINT `regions_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `regions`
--

INSERT INTO `regions` VALUES ('01f7c94e-6cd4-430a-b8f3-a687046cc1c3','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Katavi',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('0b0242f2-ecea-4a2c-8a3c-3a02bbe86bf8','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Mara',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('14506a29-23e5-477a-93de-e6b236615a61','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Kigoma',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('158d4e6e-cb23-4aac-9ff9-c6c361e2e076','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Rukwa',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('1feb6e82-3c9a-489b-a72c-222d51f8eafe','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Tabora',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('2d0cdfac-85c0-4269-b8e6-b6819b43ae50','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Dodoma',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('37d269bd-0c0a-4d56-965c-a8644aa49e1d','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Mwanza',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('392d68de-b118-4571-b872-f37411e14255','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Simiyu',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('8205ee78-6445-4e6d-bad1-044a64108ac5','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Kagera',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('97a786ea-2a79-449a-8577-c7fdb17583e5','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Shinyanga',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('a2c45c2c-3636-4f00-a16e-3abb6a3a48ee','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Arusha',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('a3ae363d-1bff-4834-81e0-524917464f89','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Singida',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('b1aa6342-d7a0-42cb-aaff-64d43299b113','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Iringa',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('d29be341-9bdd-4a8d-9bd5-c73ddf4a7052','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Geita',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d300','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Mbeya',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d301','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Dar es Salaam',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d302','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Kilimanjaro',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d303','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Lindi',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d304','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Manyara',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d305','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Morogoro',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d306','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Mtwara',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d307','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Njombe',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d308','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Pemba',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d309','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Pwani',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d310','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Ruvuma',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d311','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Songwe',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL),('ee2eb422-a6c1-40a9-9c0e-eed61bb9d312','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','671a3e61-a6dd-47c3-b58c-4479b58bf3c6','Tanga',NULL,'2026-01-20 02:08:20','2026-01-20 02:08:20',NULL);

--
-- Table structure for table `reimbursement_types`
--

CREATE TABLE `reimbursement_types` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reimbursement_types`
--


--
-- Table structure for table `rent_periods`
--

CREATE TABLE `rent_periods` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rental_agreement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `period_start` date DEFAULT NULL,
  `period_end` date DEFAULT NULL,
  `due_date` date NOT NULL,
  `amount_paid` decimal(12,2) NOT NULL DEFAULT '0.00',
  `balance` decimal(12,2) NOT NULL DEFAULT '0.00',
  `auto_generated` tinyint(1) NOT NULL DEFAULT '1',
  `status` enum('pending','paid','overdue','partial','cancelled','waived') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `paid_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rent_periods_rental_agreement_id_foreign` (`rental_agreement_id`),
  KEY `rent_periods_due_date_status_rental_agreement_id_index` (`due_date`,`status`,`rental_agreement_id`),
  CONSTRAINT `rent_periods_rental_agreement_id_foreign` FOREIGN KEY (`rental_agreement_id`) REFERENCES `rental_agreements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rent_periods`
--


--
-- Table structure for table `rental_agreement_items`
--

CREATE TABLE `rental_agreement_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rental_agreement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `asset_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `daily_rate` decimal(10,2) NOT NULL,
  `weekly_rate` decimal(10,2) NOT NULL,
  `monthly_rate` decimal(10,2) NOT NULL,
  `rental_duration` int NOT NULL,
  `duration_unit` enum('Days','Weeks','Months') COLLATE utf8mb4_unicode_ci NOT NULL,
  `line_total` decimal(12,2) NOT NULL,
  `accessories_included` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rental_agreement_items_asset_id_foreign` (`asset_id`),
  KEY `rental_agreement_items_rental_agreement_id_foreign` (`rental_agreement_id`),
  CONSTRAINT `rental_agreement_items_asset_id_foreign` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rental_agreement_items_rental_agreement_id_foreign` FOREIGN KEY (`rental_agreement_id`) REFERENCES `asset_rental_agreements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_agreement_items`
--


--
-- Table structure for table `rental_agreements`
--

CREATE TABLE `rental_agreements` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `unit_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tenant_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `agent_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `security_deposit` decimal(12,2) NOT NULL DEFAULT '0.00',
  `security_deposit_status` enum('held','refunded','forfeited') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'held',
  `monthly_rent` decimal(12,2) NOT NULL,
  `rent_due_day` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1',
  `grace_period_days` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `received_security_deposit` decimal(12,2) NOT NULL DEFAULT '0.00',
  `refunded_security_deposit` decimal(12,2) NOT NULL DEFAULT '0.00',
  `late_fee_percentage` decimal(12,2) NOT NULL DEFAULT '0.00',
  `late_fee_fixed` decimal(12,2) NOT NULL DEFAULT '0.00',
  `management_fee_type` enum('percentage','fixed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percentage',
  `management_fee` decimal(5,2) NOT NULL DEFAULT '0.00',
  `status` enum('active','expired','terminated','pending') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `billing_cycle` enum('daily','weekly','monthly','yearly') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'monthly',
  `metadata` json DEFAULT NULL,
  `terms` text COLLATE utf8mb4_unicode_ci,
  `terminated_at` timestamp NULL DEFAULT NULL,
  `termination_reason` text COLLATE utf8mb4_unicode_ci,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `agreement_unit_tenant_start_unique` (`unit_id`,`tenant_id`,`start_date`),
  KEY `rental_agreements_tenant_id_foreign` (`tenant_id`),
  KEY `rental_agreements_agent_id_foreign` (`agent_id`),
  KEY `rental_agreements_status_start_date_index` (`status`,`start_date`),
  KEY `rental_agreements_monthly_rent_index` (`monthly_rent`),
  CONSTRAINT `rental_agreements_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `agents` (`id`) ON DELETE SET NULL,
  CONSTRAINT `rental_agreements_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rental_agreements_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `property_units` (`id`) ON DELETE CASCADE,
  CONSTRAINT `chk_grace_period` CHECK (((`grace_period_days` >= 0) and (`grace_period_days` <= 15))),
  CONSTRAINT `chk_rent_due_day` CHECK (((`rent_due_day` >= 1) and (`rent_due_day` <= 28)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_agreements`
--


--
-- Table structure for table `rental_customers`
--

CREATE TABLE `rental_customers` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('Individual','Business') COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `id_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `billing_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_address` text COLLATE utf8mb4_unicode_ci,
  `credit_limit` decimal(12,2) DEFAULT NULL,
  `payment_terms` enum('Prepaid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Prepaid',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_customers`
--


--
-- Table structure for table `rental_invoices`
--

CREATE TABLE `rental_invoices` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rental_agreement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `prepared_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_date` date NOT NULL,
  `due_date` date NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `tax_amount` decimal(12,2) NOT NULL,
  `total_amount` decimal(12,2) NOT NULL,
  `amount_paid` decimal(12,2) NOT NULL DEFAULT '0.00',
  `status` enum('Draft','Issued','Partially Paid','Paid','Overdue') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Draft',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `rental_invoices_invoice_number_unique` (`invoice_number`),
  KEY `rental_invoices_rental_agreement_id_foreign` (`rental_agreement_id`),
  KEY `rental_invoices_prepared_by_foreign` (`prepared_by`),
  CONSTRAINT `rental_invoices_prepared_by_foreign` FOREIGN KEY (`prepared_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rental_invoices_rental_agreement_id_foreign` FOREIGN KEY (`rental_agreement_id`) REFERENCES `asset_rental_agreements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_invoices`
--


--
-- Table structure for table `rental_payments`
--

CREATE TABLE `rental_payments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `received_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_date` date NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `payment_method_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rental_payments_invoice_id_foreign` (`invoice_id`),
  KEY `rental_payments_received_by_foreign` (`received_by`),
  KEY `rental_payments_payment_method_id_foreign` (`payment_method_id`),
  CONSTRAINT `rental_payments_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `rental_invoices` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rental_payments_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rental_payments_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_payments`
--


--
-- Table structure for table `rental_rate_cards`
--

CREATE TABLE `rental_rate_cards` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rental_type_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `daily_rate` decimal(10,2) NOT NULL,
  `weekly_rate` decimal(10,2) NOT NULL,
  `monthly_rate` decimal(10,2) NOT NULL,
  `min_period_number` int NOT NULL DEFAULT '1',
  `period` enum('Day','Week','Month','Year') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Month',
  `security_deposit` decimal(10,2) NOT NULL,
  `late_return_penalty` decimal(10,2) NOT NULL,
  `damage_waiver_fee` decimal(10,2) DEFAULT NULL,
  `delivery_charge` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rental_rate_cards_rental_type_id_foreign` (`rental_type_id`),
  CONSTRAINT `rental_rate_cards_rental_type_id_foreign` FOREIGN KEY (`rental_type_id`) REFERENCES `rental_types` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_rate_cards`
--


--
-- Table structure for table `rental_types`
--

CREATE TABLE `rental_types` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `asset_category_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `every_after` int NOT NULL,
  `period` enum('Daily','Weekly','Monthly','Annual') COLLATE utf8mb4_unicode_ci NOT NULL,
  `depreciation_rate` decimal(5,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rental_types_asset_category_id_foreign` (`asset_category_id`),
  CONSTRAINT `rental_types_asset_category_id_foreign` FOREIGN KEY (`asset_category_id`) REFERENCES `asset_categories` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rental_types`
--


--
-- Table structure for table `repair_approvals`
--

CREATE TABLE `repair_approvals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `repair_requisition_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approver_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL,
  `comments` text COLLATE utf8mb4_unicode_ci,
  `date_approved` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `repair_approvals_approval_level_id_foreign` (`approval_level_id`),
  KEY `repair_approvals_repair_requisition_id_foreign` (`repair_requisition_id`),
  KEY `repair_approvals_approver_id_foreign` (`approver_id`),
  CONSTRAINT `repair_approvals_approval_level_id_foreign` FOREIGN KEY (`approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `repair_approvals_approver_id_foreign` FOREIGN KEY (`approver_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `repair_approvals_repair_requisition_id_foreign` FOREIGN KEY (`repair_requisition_id`) REFERENCES `repair_requisitions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `repair_approvals`
--


--
-- Table structure for table `repair_requisitions`
--

CREATE TABLE `repair_requisitions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `service_form` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `log_book` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requisition_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `request_date` date NOT NULL,
  `truck_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requested_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_approval_level` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_mileage` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_quantity_fuel_used` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `request_details` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('pending','reviewed','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `rejection_comments` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `repair_requisitions_requested_by_foreign` (`requested_by`),
  KEY `repair_requisitions_truck_id_foreign` (`truck_id`),
  KEY `repair_requisitions_current_approval_level_foreign` (`current_approval_level`),
  CONSTRAINT `repair_requisitions_current_approval_level_foreign` FOREIGN KEY (`current_approval_level`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `repair_requisitions_requested_by_foreign` FOREIGN KEY (`requested_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `repair_requisitions_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `repair_requisitions`
--


--
-- Table structure for table `repayment_items`
--

CREATE TABLE `repayment_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `repayment_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `input_loan_item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount_paid` decimal(10,2) NOT NULL,
  `produce_quantity` decimal(10,2) DEFAULT NULL,
  `product_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_price` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `repayment_items_product_id_foreign` (`product_id`),
  KEY `repayment_items_repayment_id_foreign` (`repayment_id`),
  KEY `repayment_items_input_loan_item_id_foreign` (`input_loan_item_id`),
  CONSTRAINT `repayment_items_input_loan_item_id_foreign` FOREIGN KEY (`input_loan_item_id`) REFERENCES `input_loan_items` (`id`) ON DELETE CASCADE,
  CONSTRAINT `repayment_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `repayment_items_repayment_id_foreign` FOREIGN KEY (`repayment_id`) REFERENCES `repayments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `repayment_items`
--


--
-- Table structure for table `repayments`
--

CREATE TABLE `repayments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `input_loan_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `member_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `method` enum('cash','produce') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount_paid` decimal(10,2) NOT NULL,
  `paid_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `repayments_input_loan_id_foreign` (`input_loan_id`),
  KEY `repayments_member_id_foreign` (`member_id`),
  KEY `repayments_organisation_id_foreign` (`organisation_id`),
  CONSTRAINT `repayments_input_loan_id_foreign` FOREIGN KEY (`input_loan_id`) REFERENCES `input_loans` (`id`) ON DELETE CASCADE,
  CONSTRAINT `repayments_member_id_foreign` FOREIGN KEY (`member_id`) REFERENCES `members` (`id`) ON DELETE CASCADE,
  CONSTRAINT `repayments_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `repayments`
--


--
-- Table structure for table `report_layouts`
--

CREATE TABLE `report_layouts` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `report_type` enum('balance_sheet','income_statement','trial_balance','cash_flow') COLLATE utf8mb4_unicode_ci NOT NULL,
  `level` enum('category','subcategory','coa','total','header') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'coa',
  `parent_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coa_id` bigint unsigned DEFAULT NULL,
  `report_group` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `section` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `position` decimal(8,2) NOT NULL DEFAULT '0.00',
  `is_total` tinyint(1) NOT NULL DEFAULT '0',
  `total_key` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `formula` json DEFAULT NULL,
  `label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `bold` tinyint(1) NOT NULL DEFAULT '0',
  `indent_level` int NOT NULL DEFAULT '0',
  `decimal_places` int NOT NULL DEFAULT '2',
  `row_type` enum('header','group','subtotal','derived') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'group',
  `sign` tinyint NOT NULL DEFAULT '1',
  `is_visible` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `account_category_id` bigint unsigned DEFAULT NULL,
  `account_sub_category_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `report_layouts_coa_id_foreign` (`coa_id`),
  KEY `report_layouts_parent_id_foreign` (`parent_id`),
  KEY `report_layouts_organisation_id_report_type_position_index` (`organisation_id`,`report_type`,`position`),
  KEY `report_layouts_organisation_id_report_type_section_index` (`organisation_id`,`report_type`,`section`),
  KEY `report_layouts_account_category_id_foreign` (`account_category_id`),
  KEY `report_layouts_account_sub_category_id_foreign` (`account_sub_category_id`),
  CONSTRAINT `report_layouts_account_category_id_foreign` FOREIGN KEY (`account_category_id`) REFERENCES `account_categories` (`id`),
  CONSTRAINT `report_layouts_account_sub_category_id_foreign` FOREIGN KEY (`account_sub_category_id`) REFERENCES `account_sub_categories` (`id`),
  CONSTRAINT `report_layouts_coa_id_foreign` FOREIGN KEY (`coa_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL,
  CONSTRAINT `report_layouts_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `report_layouts_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `report_layouts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `report_layouts`
--

INSERT INTO `report_layouts` VALUES ('011554e6-4cd7-4e93-97a8-44e59db880d4','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','total',NULL,NULL,'Revenue','income',2.00,1,'total_income',NULL,'TOTAL Income','Main sales account',1,0,2,'subtotal',1,1,'2026-02-05 23:55:59','2026-02-05 23:55:59',NULL,NULL,NULL),('0b9581ab-ffa9-404e-a317-a87b35523655','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','total',NULL,NULL,'liabilities','liabilities',16.00,1,'total_equity_liabilities','\"{\\\"add\\\":[\\\"total_equity\\\",\\\"total_liabilities\\\"]}\"','TOTAL EQUITY & LIABILITIES','Main Asset',1,0,2,'derived',1,1,'2026-02-10 19:02:30','2026-02-10 19:02:30',NULL,NULL,NULL),('2430b764-cb4c-4bdf-b263-50b27d2115b4','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','total',NULL,NULL,'Expenses','Other',10.00,1,'profit_loss_of_the_year','\"{\\\"subtract\\\":[\\\"profit_loss_before_tax\\\",\\\"tax_costs\\\"]}\"','Profit/(Loss) for the year','Main expense account',1,0,2,'derived',1,1,'2026-02-06 00:38:25','2026-02-06 00:38:25',NULL,NULL,NULL),('2ea4958d-bd26-417c-9c98-188a3c5a9a78','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','subcategory',NULL,NULL,'Assets','assets',4.00,0,'current_assets',NULL,'Current Assets','Main Asset',1,1,2,'group',1,1,'2026-02-10 17:44:00','2026-02-10 17:44:00',NULL,NULL,2),('437e198d-80c0-46c7-ad72-bda23ec02324','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','total',NULL,NULL,'liabilities','liabilities',14.00,1,'total_current_liabilities','\"{\\\"add\\\":[\\\"current_liabilities\\\"]}\"','Total Current Liabilities','Main Asset',1,2,2,'derived',1,1,'2026-02-10 19:00:53','2026-02-10 19:00:53',NULL,NULL,NULL),('4f5f0c3b-934e-4f99-a5fd-5f9aa00584cf','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','subcategory',NULL,NULL,'Assets','assets',2.00,0,'non_current_assets',NULL,'Non-Current Assets','Main Asset',1,1,2,'group',1,1,'2026-02-10 13:44:32','2026-02-10 13:44:32',NULL,NULL,1),('5c6fd45f-1041-449b-b65f-ab7a070fb5aa','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','total',NULL,NULL,'Expenses','expense',5.00,1,'gross_profit','\"{\\\"subtract\\\":[\\\"total_income\\\",\\\"total_expenses\\\"]}\"','Profit/Loss','Main expense account',1,0,2,'derived',1,1,'2026-02-06 00:12:33','2026-02-06 00:12:33',NULL,NULL,NULL),('66d6287c-a158-4d5c-a57f-400e93d5ef06','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','category',NULL,NULL,'Revenue','income',1.00,0,NULL,NULL,'Sales Revenue','Main sales account',0,0,2,'header',1,1,'2026-02-05 23:39:12','2026-02-05 23:39:12',NULL,4,NULL),('883b0393-396b-4be1-b32b-f8c0f5717151','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','header',NULL,NULL,'Assets','assets',1.00,0,NULL,NULL,'ASSETS','Main Asset',1,0,2,'header',1,1,'2026-02-10 13:42:00','2026-02-10 13:42:00',NULL,NULL,NULL),('883b0393-396b-4be1-b32b-f8c0f5717152','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','header',NULL,NULL,'liabilities','liabilities',7.00,0,NULL,NULL,'EQUITY AND LIABILITIES','Main liabilities',1,0,2,'header',1,1,'2026-02-10 13:42:00','2026-02-10 13:42:00',NULL,NULL,NULL),('883b0393-396b-4be1-b32b-f8c0f5717153','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','category',NULL,NULL,'equity','equity',8.00,0,'equity',NULL,'Equity','Main equity',1,1,2,'group',1,1,'2026-02-10 13:42:00','2026-02-10 13:42:00',NULL,3,NULL),('883b0393-396b-4be1-b32b-f8c0f5717154','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','category',NULL,NULL,'liability','liability',10.00,0,'liability',NULL,'Liability','Main liability',1,1,2,'header',1,1,'2026-02-10 13:42:00','2026-02-10 13:42:00',NULL,NULL,NULL),('883b0393-396b-4be1-b32b-f8c0f5717155','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','subcategory',NULL,NULL,'liability','liability',11.00,0,'long_term_liabilities',NULL,'Long-Time Liabilities','Long-Time Liabilities',1,1,2,'group',1,1,'2026-02-10 13:42:00','2026-02-10 13:42:00',NULL,NULL,13),('900f13d6-5c69-4c9a-9a6a-db319963efd2','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','subcategory',NULL,NULL,'liabilities','liabilities',13.00,0,'current_liabilities',NULL,'Current liabilities','Main Asset',1,0,2,'group',1,1,'2026-02-10 19:03:44','2026-02-10 19:03:44',NULL,NULL,14),('a89caaf7-0f45-4389-907e-c707c3468158','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','total',NULL,NULL,'Expenses','expense',4.00,1,'total_expenses',NULL,'Total Expenses','Main expense account',1,1,2,'subtotal',1,1,'2026-02-06 00:01:55','2026-02-06 00:01:55',NULL,NULL,NULL),('c88356f9-2712-4d43-932e-c4725e5346c1','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','category',NULL,NULL,'Expenses','expense',2.00,0,NULL,NULL,'Expenses','Main expense account',1,0,2,'header',1,1,'2026-02-05 23:58:44','2026-02-05 23:58:44',NULL,5,NULL),('ca0275b4-2f17-45ec-86ab-f1cbc73f208a','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','total',NULL,NULL,'Expenses','Other',8.00,1,'profit_loss_before_tax','\"{\\\"add\\\":[\\\"gross_profit\\\",\\\"other_income\\\"]}\"','Profit/Loss before tax','Main expense account',1,0,2,'derived',1,1,'2026-02-06 00:26:20','2026-02-06 00:26:20',NULL,NULL,NULL),('d114a66d-c19a-41ea-be53-1d239911d62c','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','total',NULL,NULL,'liabilities','liabilities',15.00,1,'total_liabilities','\"{\\\"add\\\":[\\\"total_current_liabilities\\\",\\\"total_long_term_liabilities\\\"]}\"','Total Liabilities','Main Asset',1,2,2,'derived',1,1,'2026-02-10 19:01:42','2026-02-10 19:01:42',NULL,NULL,NULL),('d1f52096-b03d-4541-85cb-594fff8eea7f','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','total',NULL,NULL,'Total','Other',12.00,1,'total_profit_and_other_comprehensive_income','\"{\\\"add\\\":[\\\"profit_loss_of_the_year\\\",\\\"revaluation_gain\\\"]}\"','Total Profit and Other Comprehensive Income','Main expense account',1,0,2,'derived',1,1,'2026-02-06 00:49:49','2026-02-06 00:49:49',NULL,NULL,NULL),('d460ddee-943d-40a2-881d-df4d50c7cd21','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','subcategory',NULL,NULL,'Other Income','Income',7.00,1,'other_income',NULL,'Other Income','Other Income',1,0,2,'header',1,1,'2026-02-06 00:35:57','2026-02-06 00:35:57',NULL,NULL,26),('d460ddee-943d-40a2-881d-df4d50c7cd29','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','subcategory',NULL,NULL,'Tax','Tax',9.00,1,'tax_costs',NULL,'Tax Costs','Main expense account',1,0,2,'header',-1,1,'2026-02-06 00:35:57','2026-02-06 00:35:57',NULL,NULL,34),('d661aa69-8df2-4dc5-84bd-409b6d713b54','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','total',NULL,NULL,'Assets','assets',6.00,0,'total_assets','\"{\\\"add\\\":[\\\"total_non_current_assets\\\",\\\"total_current_assets\\\"]}\"','TOTAL ASSETS','Main Asset',1,0,2,'derived',1,1,'2026-02-10 17:55:03','2026-02-10 17:55:03',NULL,NULL,NULL),('d912ef22-db07-4f0c-bd8d-3fba8b3cef9e','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','income_statement','subcategory',NULL,NULL,'Comprehensive','Other',11.00,0,'revaluation_gain',NULL,'Mapato mengine ya kina','Main expense account',1,0,2,'header',1,1,'2026-02-06 00:48:02','2026-02-06 00:48:02',NULL,NULL,27),('dc0bbc92-c2f2-4e99-93d2-8ae3bae8e171','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','total',NULL,NULL,'equity','equity',9.00,0,'total_equity','\"{\\\"add\\\":[\\\"equity\\\"]}\"','Total Equity','Main Asset',1,1,2,'derived',1,1,'2026-02-10 18:10:03','2026-02-10 18:10:03',NULL,NULL,22),('dc7017d7-8b6f-4081-be3e-2cf79db582af','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','total',NULL,NULL,'Assets','assets',3.00,1,'total_non_current_assets','\"{\\\"add\\\":[\\\"non_current_assets\\\"]}\"','Total Non-Current Assets','Main Asset',1,1,2,'derived',1,1,'2026-02-10 13:48:54','2026-02-10 13:48:54',NULL,NULL,NULL),('f84275c9-20ba-4e69-9f0d-9a1a044f8040','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','total',NULL,NULL,'Assets','assets',5.00,1,'total_current_assets','\"{\\\"add\\\":[\\\"current_assets\\\"]}\"','Total Current Assets','Main Asset',1,1,2,'derived',1,1,'2026-02-10 17:50:56','2026-02-10 17:50:56',NULL,NULL,NULL),('fc738708-2a5f-433a-8753-cda80bc3ddca','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','balance_sheet','total',NULL,NULL,'liabilities','liabilities',12.00,1,'total_long_term_liabilities','\"{\\\"add\\\":[\\\"long_term_liabilities\\\"]}\"','Total Long Term Liabilities','Main Asset',1,2,2,'derived',1,1,'2026-02-10 18:59:37','2026-02-10 18:59:37',NULL,NULL,NULL);

--
-- Table structure for table `requisition_deliveries`
--

CREATE TABLE `requisition_deliveries` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fulfillment_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `delivery_method` enum('pickup','internal','external') COLLATE utf8mb4_unicode_ci NOT NULL,
  `tracking_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivered_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `received_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivery_date` datetime DEFAULT NULL,
  `delivery_notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `requisition_deliveries_fulfillment_id_foreign` (`fulfillment_id`),
  KEY `requisition_deliveries_delivered_by_foreign` (`delivered_by`),
  KEY `requisition_deliveries_received_by_foreign` (`received_by`),
  CONSTRAINT `requisition_deliveries_delivered_by_foreign` FOREIGN KEY (`delivered_by`) REFERENCES `employees` (`id`),
  CONSTRAINT `requisition_deliveries_fulfillment_id_foreign` FOREIGN KEY (`fulfillment_id`) REFERENCES `requisition_fulfillments` (`id`),
  CONSTRAINT `requisition_deliveries_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `requisition_deliveries`
--


--
-- Table structure for table `requisition_full_fillments`
--

CREATE TABLE `requisition_full_fillments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `store_requisition_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fulfilled_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fulfillment_date` date NOT NULL,
  `status` enum('Pending','Partial','Completed','Cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `requisition_full_fillments_store_requisition_id_foreign` (`store_requisition_id`),
  KEY `requisition_full_fillments_fulfilled_by_foreign` (`fulfilled_by`),
  CONSTRAINT `requisition_full_fillments_fulfilled_by_foreign` FOREIGN KEY (`fulfilled_by`) REFERENCES `employees` (`id`),
  CONSTRAINT `requisition_full_fillments_store_requisition_id_foreign` FOREIGN KEY (`store_requisition_id`) REFERENCES `store_requisitions` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `requisition_full_fillments`
--


--
-- Table structure for table `requisition_retirements`
--

CREATE TABLE `requisition_retirements` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cash_requisition_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `retired_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `attachments` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `requisition_retirements_cash_requisition_id_foreign` (`cash_requisition_id`),
  KEY `requisition_retirements_retired_by_foreign` (`retired_by`),
  CONSTRAINT `requisition_retirements_cash_requisition_id_foreign` FOREIGN KEY (`cash_requisition_id`) REFERENCES `cash_requisitions` (`id`),
  CONSTRAINT `requisition_retirements_retired_by_foreign` FOREIGN KEY (`retired_by`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `requisition_retirements`
--


--
-- Table structure for table `resumes`
--

CREATE TABLE `resumes` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `candidate_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `resumes_candidate_id_foreign` (`candidate_id`),
  CONSTRAINT `resumes_candidate_id_foreign` FOREIGN KEY (`candidate_id`) REFERENCES `candidates` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `resumes`
--


--
-- Table structure for table `return_items`
--

CREATE TABLE `return_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `return_request_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_line_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `restocking_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `refund_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `condition` enum('NEW','OPENED','DAMAGED','USED') COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('PENDING','RECEIVED','INSPECTED','PROCESSED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PENDING',
  `return_date` date DEFAULT NULL,
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `return_items_return_request_id_foreign` (`return_request_id`),
  KEY `return_items_order_line_id_foreign` (`order_line_id`),
  CONSTRAINT `return_items_order_line_id_foreign` FOREIGN KEY (`order_line_id`) REFERENCES `order_lines` (`id`) ON DELETE CASCADE,
  CONSTRAINT `return_items_return_request_id_foreign` FOREIGN KEY (`return_request_id`) REFERENCES `return_requests` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `return_items`
--


--
-- Table structure for table `return_orders`
--

CREATE TABLE `return_orders` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rma_number` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `percentage` decimal(10,2) NOT NULL,
  `calculated_amount` decimal(20,2) NOT NULL,
  `paid_amount` decimal(20,2) NOT NULL,
  `status` enum('requested','pending_approval','approved','rejected','received','inspected','completed','closed','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `return_orders`
--


--
-- Table structure for table `return_requests`
--

CREATE TABLE `return_requests` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `return_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipment_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sale_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reason` enum('DAMAGED','WRONG_ITEM','UNWANTED','OTHER') COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('REQUESTED','APPROVED','REJECTED','PROCESSING','COMPLETED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REQUESTED',
  `request_date` date NOT NULL,
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approved_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `approval_date` date DEFAULT NULL,
  `approval_note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `return_requests_shipment_id_foreign` (`shipment_id`),
  KEY `return_requests_sale_order_id_foreign` (`sale_order_id`),
  KEY `return_requests_customer_id_foreign` (`customer_id`),
  KEY `return_requests_approved_by_foreign` (`approved_by`),
  CONSTRAINT `return_requests_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `return_requests_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `return_requests_sale_order_id_foreign` FOREIGN KEY (`sale_order_id`) REFERENCES `sale_orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `return_requests_shipment_id_foreign` FOREIGN KEY (`shipment_id`) REFERENCES `shipments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `return_requests`
--


--
-- Table structure for table `return_shipments`
--

CREATE TABLE `return_shipments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `return_request_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tracking_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `truck_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_method` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_date` date NOT NULL,
  `received_date` date DEFAULT NULL,
  `received_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `return_shipments_return_request_id_foreign` (`return_request_id`),
  KEY `return_shipments_truck_id_foreign` (`truck_id`),
  KEY `return_shipments_received_by_foreign` (`received_by`),
  CONSTRAINT `return_shipments_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `return_shipments_return_request_id_foreign` FOREIGN KEY (`return_request_id`) REFERENCES `return_requests` (`id`) ON DELETE CASCADE,
  CONSTRAINT `return_shipments_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `return_shipments`
--


--
-- Table structure for table `rfq_evaluations`
--

CREATE TABLE `rfq_evaluations` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_response_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `evaluation_criteria_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `score` decimal(5,2) DEFAULT NULL,
  `selected` tinyint(1) NOT NULL DEFAULT '0',
  `evaluation_notes` text COLLATE utf8mb4_unicode_ci,
  `evaluated_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rfq_evaluations_rfq_id_foreign` (`rfq_id`),
  KEY `rfq_evaluations_evaluation_criteria_id_foreign` (`evaluation_criteria_id`),
  KEY `rfq_evaluations_rfq_response_id_foreign` (`rfq_response_id`),
  KEY `rfq_evaluations_evaluated_by_foreign` (`evaluated_by`),
  CONSTRAINT `rfq_evaluations_evaluated_by_foreign` FOREIGN KEY (`evaluated_by`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `rfq_evaluations_evaluation_criteria_id_foreign` FOREIGN KEY (`evaluation_criteria_id`) REFERENCES `evaluation_criterias` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rfq_evaluations_rfq_id_foreign` FOREIGN KEY (`rfq_id`) REFERENCES `rfqs` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rfq_evaluations_rfq_response_id_foreign` FOREIGN KEY (`rfq_response_id`) REFERENCES `rfq_responses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rfq_evaluations`
--


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

CREATE TABLE `rfq_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` decimal(15,2) NOT NULL,
  `unit_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `unit_price` decimal(15,2) DEFAULT NULL,
  `technical_specifications` text COLLATE utf8mb4_unicode_ci,
  `item_description` text COLLATE utf8mb4_unicode_ci,
  `delivery_schedule` text COLLATE utf8mb4_unicode_ci,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rfq_items_rfq_id_foreign` (`rfq_id`),
  KEY `rfq_items_item_id_foreign` (`item_id`),
  KEY `rfq_items_unit_id_foreign` (`unit_id`),
  CONSTRAINT `rfq_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rfq_items_rfq_id_foreign` FOREIGN KEY (`rfq_id`) REFERENCES `rfqs` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rfq_items_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `unit_of_measures` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `rfq_response_items`
--

CREATE TABLE `rfq_response_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_response_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quoted_price` decimal(15,2) NOT NULL,
  `lead_time_days` int DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `rfq_response_items_rfq_response_id_rfq_item_id_unique` (`rfq_response_id`,`rfq_item_id`),
  KEY `rfq_response_items_rfq_item_id_foreign` (`rfq_item_id`),
  CONSTRAINT `rfq_response_items_rfq_item_id_foreign` FOREIGN KEY (`rfq_item_id`) REFERENCES `rfq_items` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rfq_response_items_rfq_response_id_foreign` FOREIGN KEY (`rfq_response_id`) REFERENCES `rfq_responses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rfq_response_items`
--


--
-- Table structure for table `rfq_responses`
--

CREATE TABLE `rfq_responses` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_supplier_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `response_date` date DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `attachment` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rfq_responses_rfq_id_foreign` (`rfq_id`),
  KEY `rfq_responses_rfq_supplier_id_foreign` (`rfq_supplier_id`),
  CONSTRAINT `rfq_responses_rfq_id_foreign` FOREIGN KEY (`rfq_id`) REFERENCES `rfqs` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rfq_responses_rfq_supplier_id_foreign` FOREIGN KEY (`rfq_supplier_id`) REFERENCES `rfq_suppliers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rfq_responses`
--


--
-- Table structure for table `rfq_suppliers`
--

CREATE TABLE `rfq_suppliers` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `response_deadline` date DEFAULT NULL,
  `status` enum('invited','responded','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'invited',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `rfq_suppliers_rfq_id_foreign` (`rfq_id`),
  CONSTRAINT `rfq_suppliers_rfq_id_foreign` FOREIGN KEY (`rfq_id`) REFERENCES `rfqs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rfq_suppliers`
--


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

CREATE TABLE `rfqs` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_type` enum('Open','Selective','Single Source') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Open',
  `rfq_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `delivery_requirements` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `special_instructions` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_terms` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rfq_date` date NOT NULL,
  `issue_date` date NOT NULL,
  `delivery_date` date NOT NULL,
  `submission_deadline` date NOT NULL,
  `created_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requisition_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('draft','sent','responses_received','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `rfqs_rfq_number_unique` (`rfq_number`),
  KEY `rfqs_requisition_id_foreign` (`requisition_id`),
  CONSTRAINT `rfqs_requisition_id_foreign` FOREIGN KEY (`requisition_id`) REFERENCES `purchase_requisitions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` bigint unsigned NOT NULL,
  `role_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`),
  CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` VALUES (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1),(11,1),(12,1),(13,1),(14,1),(15,1),(16,1),(17,1),(18,1),(19,1),(20,1),(21,1),(22,1),(23,1),(24,1),(25,1),(26,1),(27,1),(28,1),(29,1),(30,1),(31,1),(32,1),(33,1),(34,1),(35,1),(36,1),(37,1),(38,1),(39,1),(40,1),(41,1),(42,1),(43,1),(44,1),(45,1),(46,1),(47,1),(48,1),(49,1),(50,1),(51,1),(52,1),(53,1),(54,1),(55,1),(56,1),(57,1),(58,1),(59,1),(60,1),(61,1),(62,1),(63,1),(64,1),(65,1),(66,1),(67,1),(68,1),(69,1),(70,1),(71,1),(72,1),(73,1),(74,1),(75,1),(76,1),(77,1),(78,1),(79,1),(80,1),(81,1),(82,1),(83,1),(84,1),(85,1),(86,1),(87,1),(88,1),(89,1),(90,1),(91,1),(92,1),(93,1),(94,1),(95,1),(96,1),(97,1),(98,1),(99,1),(100,1),(101,1),(102,1),(103,1),(104,1),(105,1),(106,1),(107,1),(108,1),(109,1),(110,1),(111,1),(112,1),(113,1),(114,1),(115,1),(116,1),(117,1),(118,1),(119,1),(120,1),(121,1),(122,1),(123,1),(124,1),(125,1),(126,1),(127,1),(128,1),(129,1),(130,1),(131,1),(132,1),(133,1),(134,1),(135,1),(136,1),(137,1),(138,1),(139,1),(140,1),(141,1),(142,1),(143,1),(144,1),(145,1),(146,1),(147,1),(148,1),(149,1),(150,1),(151,1),(152,1),(153,1),(154,1),(155,1),(156,1),(157,1),(158,1),(159,1),(160,1),(161,1),(162,1),(163,1),(164,1),(165,1),(166,1),(167,1),(168,1),(169,1),(170,1),(171,1),(172,1),(173,1),(174,1),(175,1),(176,1),(177,1),(178,1),(179,1),(180,1),(181,1),(182,1),(183,1),(184,1),(185,1),(186,1),(187,1),(191,1),(192,1),(193,1),(194,1),(195,1),(196,1),(197,1),(198,1),(199,1),(200,1),(201,1),(202,1),(203,1),(204,1),(205,1),(206,1),(207,1),(208,1),(209,1),(210,1),(211,1),(212,1),(213,1),(214,1),(215,1),(216,1),(217,1),(218,1),(219,1),(220,1),(221,1),(222,1),(223,1),(224,1),(225,1),(226,1),(227,1),(228,1),(229,1),(230,1),(231,1),(232,1),(233,1),(234,1),(235,1),(236,1),(237,1),(238,1),(239,1),(240,1),(241,1),(242,1),(243,1),(244,1),(245,1),(246,1),(247,1),(248,1),(249,1),(250,1),(251,1),(252,1),(253,1),(254,1),(255,1),(256,1),(257,1),(258,1),(259,1),(260,1),(261,1),(262,1),(263,1),(264,1),(265,1),(266,1),(267,1),(268,1),(269,1),(270,1),(271,1),(272,1),(273,1),(274,1),(275,1),(276,1),(277,1),(278,1),(279,1),(280,1),(281,1),(282,1),(283,1),(284,1),(285,1),(286,1),(287,1),(288,1),(289,1),(290,1),(291,1),(292,1),(293,1),(294,1),(295,1),(296,1),(297,1),(298,1),(299,1),(300,1),(301,1),(302,1),(303,1),(304,1),(305,1),(306,1),(307,1),(308,1),(309,1),(310,1),(311,1),(312,1),(313,1),(314,1),(315,1),(316,1),(317,1),(318,1),(319,1),(320,1),(321,1),(322,1),(323,1),(324,1),(325,1),(326,1),(327,1),(328,1),(329,1),(330,1),(331,1),(332,1),(333,1),(334,1),(335,1),(336,1),(337,1),(338,1),(339,1),(340,1),(341,1),(342,1),(343,1),(344,1),(345,1),(346,1),(347,1),(348,1),(349,1),(350,1),(351,1),(352,1),(353,1),(354,1),(355,1),(356,1),(357,1),(358,1),(359,1),(360,1),(361,1),(362,1),(363,1),(364,1),(365,1),(366,1),(367,1),(368,1),(369,1),(370,1),(371,1),(372,1),(373,1),(374,1),(375,1),(376,1),(377,1),(378,1),(379,1),(380,1),(381,1),(382,1),(383,1),(384,1),(385,1),(386,1),(387,1),(388,1),(389,1),(390,1),(391,1),(392,1),(393,1),(394,1),(395,1),(396,1),(397,1),(398,1),(399,1),(400,1),(401,1),(402,1),(403,1),(404,1),(405,1),(406,1),(407,1),(408,1),(409,1),(410,1),(411,1),(412,1),(413,1),(414,1),(415,1),(416,1),(417,1),(418,1),(419,1),(420,1),(421,1),(422,1),(423,1),(424,1),(425,1),(426,1),(427,1),(428,1),(429,1),(430,1),(431,1),(432,1),(433,1),(434,1),(435,1),(436,1),(437,1),(438,1),(439,1),(440,1),(441,1),(442,1),(443,1),(444,1),(445,1),(446,1),(447,1),(448,1),(449,1),(450,1),(451,1),(452,1),(453,1),(454,1),(455,1),(456,1),(457,1),(458,1),(459,1),(460,1),(461,1),(462,1),(463,1),(464,1),(465,1),(466,1),(467,1),(1,2),(2,2),(3,2),(4,2),(5,2),(6,2),(7,2),(8,2),(9,2),(10,2),(11,2),(12,2),(13,2),(14,2),(15,2),(16,2),(17,2),(18,2),(19,2),(20,2),(21,2),(22,2),(23,2),(24,2),(25,2),(26,2),(27,2),(28,2),(29,2),(30,2),(31,2),(32,2),(33,2),(34,2),(35,2),(36,2),(37,2),(38,2),(39,2),(40,2),(41,2),(42,2),(43,2),(44,2),(45,2),(46,2),(47,2),(48,2),(49,2),(50,2),(51,2),(52,2),(53,2),(54,2),(55,2),(56,2),(57,2),(58,2),(59,2),(60,2),(61,2),(62,2),(63,2),(64,2),(65,2),(66,2),(67,2),(68,2),(69,2),(70,2),(71,2),(72,2),(73,2),(74,2),(75,2),(76,2),(77,2),(78,2),(79,2),(80,2),(81,2),(82,2),(83,2),(84,2),(85,2),(86,2),(87,2),(88,2),(89,2),(90,2),(91,2),(92,2),(93,2),(94,2),(95,2),(96,2),(97,2),(98,2),(99,2),(100,2),(101,2),(102,2),(103,2),(104,2),(105,2),(106,2),(107,2),(108,2),(109,2),(110,2),(111,2),(112,2),(113,2),(114,2),(115,2),(116,2),(117,2),(118,2),(119,2),(120,2),(121,2),(122,2),(123,2),(124,2),(125,2),(126,2),(127,2),(128,2),(129,2),(130,2),(131,2),(132,2),(133,2),(134,2),(135,2),(136,2),(137,2),(138,2),(139,2),(140,2),(141,2),(142,2),(143,2),(144,2),(145,2),(146,2),(147,2),(148,2),(149,2),(150,2),(151,2),(152,2),(153,2),(154,2),(155,2),(156,2),(157,2),(158,2),(159,2),(160,2),(161,2),(162,2),(163,2),(164,2),(165,2),(166,2),(167,2),(168,2),(169,2),(170,2),(171,2),(172,2),(173,2),(174,2),(175,2),(176,2),(177,2),(178,2),(179,2),(180,2),(181,2),(182,2),(183,2),(184,2),(185,2),(186,2),(187,2),(191,2),(193,2),(194,2),(195,2),(196,2),(198,2),(200,2),(201,2),(202,2),(203,2),(204,2),(205,2),(206,2),(207,2),(208,2),(209,2),(210,2),(211,2),(212,2),(213,2),(214,2),(215,2),(216,2),(217,2),(218,2),(219,2),(220,2),(221,2),(222,2),(223,2),(224,2),(225,2),(226,2),(227,2),(228,2),(229,2),(230,2),(231,2),(232,2),(233,2),(234,2),(235,2),(236,2),(237,2),(238,2),(239,2),(240,2),(241,2),(242,2),(243,2),(244,2),(245,2),(246,2),(247,2),(248,2),(249,2),(250,2),(251,2),(252,2),(253,2),(254,2),(255,2),(256,2),(257,2),(258,2),(259,2),(260,2),(261,2),(262,2),(263,2),(264,2),(265,2),(266,2),(267,2),(268,2),(269,2),(270,2),(271,2),(272,2),(273,2),(274,2),(275,2),(276,2),(277,2),(278,2),(279,2),(280,2),(281,2),(282,2),(283,2),(284,2),(285,2),(286,2),(287,2),(288,2),(289,2),(290,2),(291,2),(292,2),(293,2),(294,2),(295,2),(296,2),(297,2),(298,2),(299,2),(300,2),(301,2),(302,2),(303,2),(304,2),(305,2),(306,2),(307,2),(308,2),(309,2),(310,2),(311,2),(312,2),(313,2),(314,2),(315,2),(316,2),(317,2),(318,2),(319,2),(320,2),(321,2),(322,2),(323,2),(324,2),(325,2),(326,2),(327,2),(328,2),(329,2),(330,2),(331,2),(332,2),(333,2),(334,2),(335,2),(336,2),(337,2),(338,2),(339,2),(340,2),(341,2),(342,2),(343,2),(344,2),(345,2),(346,2),(347,2),(348,2),(349,2),(350,2),(351,2),(352,2),(353,2),(354,2),(355,2),(356,2),(357,2),(358,2),(359,2),(360,2),(361,2),(362,2),(363,2),(364,2),(365,2),(366,2),(367,2),(368,2),(369,2),(370,2),(371,2),(372,2),(373,2),(374,2),(375,2),(376,2),(377,2),(378,2),(379,2),(380,2),(381,2),(382,2),(383,2),(384,2),(385,2),(386,2),(387,2),(388,2),(389,2),(390,2),(391,2),(392,2),(393,2),(394,2),(395,2),(396,2),(397,2),(398,2),(399,2),(400,2),(401,2),(402,2),(403,2),(404,2),(405,2),(406,2),(407,2),(408,2),(409,2),(410,2),(411,2),(412,2),(413,2),(414,2),(415,2),(416,2),(417,2),(418,2),(419,2),(420,2),(421,2),(422,2),(423,2),(424,2),(425,2),(426,2),(427,2),(428,2),(429,2),(430,2),(431,2),(432,2),(433,2),(434,2),(435,2),(436,2),(437,2),(438,2),(439,2),(440,2),(441,2),(442,2),(443,2),(444,2),(445,2),(446,2),(447,2),(448,2),(449,2),(450,2),(451,2),(452,2),(453,2),(92,3),(93,3),(94,3),(95,3),(96,3),(97,3),(98,3),(99,3),(100,3),(101,3),(102,3),(103,3),(104,3),(105,3),(106,3),(128,3),(129,3),(130,3),(131,3),(132,3),(133,3),(134,3),(135,3),(136,3),(137,3),(138,3),(139,3),(140,3),(141,3),(142,3),(143,3),(144,3),(145,3),(146,3),(147,3),(148,3),(149,3),(150,3),(151,3),(152,3),(153,3),(154,3),(155,3),(156,3),(157,3),(158,3),(159,3),(160,3),(161,3),(162,3),(163,3),(164,3),(165,3),(166,3),(167,3),(168,3),(169,3),(170,3),(171,3),(172,3),(173,3),(174,3),(175,3),(176,3),(177,3),(178,3),(179,3),(180,3),(181,3),(182,3),(183,3),(184,3),(202,3),(203,3),(204,3),(205,3),(206,3),(207,3),(208,3),(209,3),(210,3),(211,3),(212,3),(213,3),(214,3),(215,3),(254,3),(255,3),(256,3),(257,3),(258,3),(259,3),(260,3),(261,3),(262,3),(263,3),(264,3),(265,3),(266,3),(267,3),(268,3),(269,3),(270,3),(271,3),(272,3),(273,3),(274,3),(275,3),(276,3),(277,3),(278,3),(279,3),(280,3),(281,3),(282,3),(283,3),(284,3),(285,3),(286,3),(287,3),(288,3),(289,3),(290,3),(291,3),(292,3),(293,3),(294,3),(295,3),(296,3),(297,3),(298,3),(299,3),(300,3),(301,3),(302,3),(303,3),(304,3),(305,3),(306,3),(355,3),(356,3),(357,3),(358,3),(359,3),(360,3),(361,3),(362,3),(363,3),(364,3),(365,3),(366,3),(367,3),(368,3),(369,3),(370,3),(371,3),(372,3),(373,3),(374,3),(375,3),(376,3),(377,3),(378,3),(379,3),(380,3),(381,3),(382,3),(383,3),(384,3),(385,3),(386,3),(387,3),(388,3),(389,3),(390,3),(391,3),(392,3),(393,3),(394,3),(395,3),(396,3),(397,3),(398,3),(399,3),(400,3),(401,3),(402,3),(403,3),(404,3),(405,3),(406,3),(407,3),(408,3),(409,3),(410,3),(411,3),(412,3),(413,3),(414,3),(415,3),(416,3),(417,3),(418,3),(419,3),(420,3),(421,3),(422,3),(423,3),(424,3),(425,3),(426,3),(427,3),(428,3),(429,3),(430,3),(431,3),(432,3),(433,3),(434,3),(435,3),(436,3),(437,3),(438,3),(439,3),(440,3),(441,3),(442,3),(443,3),(444,3),(445,3),(446,3),(447,3),(448,3),(449,3),(450,3),(451,3),(452,3),(453,3),(1,4),(2,4),(3,4),(4,4),(5,4),(6,4),(7,4),(8,4),(9,4),(10,4),(11,4),(12,4),(13,4),(14,4),(15,4),(16,4),(17,4),(18,4),(19,4),(20,4),(21,4),(22,4),(23,4),(24,4),(25,4),(26,4),(27,4),(28,4),(29,4),(30,4),(31,4),(32,4),(33,4),(34,4),(35,4),(36,4),(37,4),(38,4),(39,4),(40,4),(41,4),(42,4),(43,4),(44,4),(45,4),(46,4),(47,4),(48,4),(49,4),(50,4),(51,4),(52,4),(53,4),(54,4),(55,4),(56,4),(57,4),(58,4),(59,4),(60,4),(61,4),(62,4),(63,4),(64,4),(65,4),(66,4),(67,4),(68,4),(69,4),(70,4),(71,4),(72,4),(73,4),(74,4),(75,4),(76,4),(77,4),(78,4),(79,4),(80,4),(81,4),(82,4),(83,4),(84,4),(85,4),(86,4),(87,4),(88,4),(89,4),(90,4),(91,4),(92,4),(93,4),(94,4),(95,4),(96,4),(97,4),(98,4),(99,4),(100,4),(101,4),(102,4),(103,4),(104,4),(105,4),(106,4),(107,4),(108,4),(109,4),(110,4),(111,4),(112,4),(113,4),(114,4),(115,4),(116,4),(117,4),(118,4),(119,4),(120,4),(121,4),(122,4),(123,4),(124,4),(125,4),(126,4),(127,4),(185,4),(196,4),(198,4),(202,4),(203,4),(204,4),(205,4),(206,4),(207,4),(208,4),(209,4),(210,4),(211,4),(212,4),(213,4),(214,4),(215,4),(216,4),(217,4),(218,4),(219,4),(220,4),(221,4),(222,4),(223,4),(224,4),(225,4),(226,4),(227,4),(228,4),(229,4),(230,4),(231,4),(232,4),(233,4),(234,4),(235,4),(236,4),(237,4),(238,4),(239,4),(240,4),(241,4),(242,4),(243,4),(244,4),(245,4),(246,4),(247,4),(248,4),(249,4),(250,4),(251,4),(252,4),(253,4),(254,4),(255,4),(256,4),(257,4),(258,4),(259,4),(260,4),(261,4),(262,4),(263,4),(264,4),(265,4),(266,4),(267,4),(268,4),(269,4),(270,4),(271,4),(272,4),(273,4),(274,4),(275,4),(276,4),(277,4),(278,4),(279,4),(280,4),(281,4),(282,4),(283,4),(284,4),(285,4),(286,4),(287,4),(288,4),(289,4),(290,4),(291,4),(292,4),(293,4),(294,4),(295,4),(296,4),(297,4),(298,4),(299,4),(300,4),(301,4),(302,4),(303,4),(304,4),(305,4),(306,4),(307,4),(308,4),(309,4),(310,4),(311,4),(312,4),(313,4),(314,4),(315,4),(316,4),(317,4),(318,4),(319,4),(320,4),(321,4),(322,4),(323,4),(324,4),(325,4),(326,4),(327,4),(328,4),(329,4),(330,4),(355,4),(356,4),(357,4),(358,4),(359,4),(360,4),(361,4),(362,4),(363,4),(364,4),(365,4),(366,4),(367,4),(368,4),(369,4),(370,4),(371,4),(372,4),(373,4),(374,4),(375,4),(376,4),(377,4),(378,4),(379,4),(380,4),(381,4),(382,4),(383,4),(384,4),(385,4),(386,4),(387,4),(388,4),(389,4),(390,4),(391,4),(392,4),(393,4),(394,4),(395,4),(396,4),(397,4),(398,4),(399,4),(400,4),(401,4),(402,4),(403,4),(404,4),(405,4),(406,4),(407,4),(408,4),(409,4),(410,4),(411,4),(412,4),(413,4),(414,4),(415,4),(416,4),(417,4),(418,4),(419,4),(420,4),(421,4),(422,4),(423,4),(424,4),(425,4),(426,4),(427,4),(428,4),(429,4),(430,4),(431,4),(432,4),(433,4),(434,4),(435,4),(436,4),(437,4),(438,4),(439,4),(440,4),(441,4),(442,4),(443,4),(444,4),(445,4),(446,4),(447,4),(448,4),(449,4),(450,4),(451,4),(452,4),(453,4),(1,5),(2,5),(3,5),(4,5),(5,5),(6,5),(7,5),(8,5),(9,5),(10,5),(11,5),(12,5),(13,5),(14,5),(15,5),(16,5),(17,5),(18,5),(19,5),(20,5),(21,5),(22,5),(23,5),(24,5),(25,5),(26,5),(27,5),(28,5),(29,5),(30,5),(31,5),(32,5),(33,5),(34,5),(35,5),(36,5),(37,5),(38,5),(39,5),(40,5),(41,5),(42,5),(43,5),(44,5),(45,5),(46,5),(47,5),(48,5),(49,5),(50,5),(51,5),(52,5),(53,5),(54,5),(55,5),(56,5),(57,5),(58,5),(59,5),(60,5),(61,5),(62,5),(63,5),(64,5),(65,5),(66,5),(67,5),(68,5),(69,5),(70,5),(71,5),(72,5),(73,5),(74,5),(75,5),(76,5),(77,5),(78,5),(79,5),(80,5),(81,5),(82,5),(83,5),(84,5),(85,5),(86,5),(87,5),(88,5),(89,5),(90,5),(91,5),(92,5),(93,5),(94,5),(95,5),(96,5),(97,5),(98,5),(99,5),(100,5),(101,5),(102,5),(103,5),(104,5),(105,5),(106,5),(107,5),(108,5),(109,5),(110,5),(111,5),(112,5),(113,5),(114,5),(115,5),(116,5),(117,5),(118,5),(119,5),(120,5),(121,5),(122,5),(123,5),(124,5),(125,5),(126,5),(127,5),(128,5),(129,5),(130,5),(131,5),(132,5),(133,5),(134,5),(135,5),(136,5),(137,5),(138,5),(139,5),(140,5),(141,5),(142,5),(143,5),(144,5),(145,5),(146,5),(147,5),(148,5),(149,5),(150,5),(151,5),(152,5),(153,5),(154,5),(155,5),(156,5),(157,5),(158,5),(159,5),(160,5),(161,5),(162,5),(163,5),(164,5),(165,5),(166,5),(167,5),(168,5),(169,5),(170,5),(171,5),(172,5),(173,5),(174,5),(175,5),(176,5),(177,5),(178,5),(179,5),(180,5),(181,5),(182,5),(183,5),(184,5),(185,5),(186,5),(187,5),(191,5),(192,5),(193,5),(194,5),(195,5),(196,5),(198,5),(200,5),(202,5),(203,5),(204,5),(205,5),(206,5),(207,5),(208,5),(209,5),(210,5),(211,5),(212,5),(213,5),(214,5),(215,5),(216,5),(217,5),(218,5),(219,5),(220,5),(221,5),(222,5),(223,5),(224,5),(225,5),(226,5),(227,5),(228,5),(229,5),(230,5),(231,5),(232,5),(233,5),(234,5),(235,5),(236,5),(237,5),(238,5),(239,5),(240,5),(241,5),(242,5),(243,5),(244,5),(245,5),(246,5),(247,5),(248,5),(249,5),(250,5),(251,5),(252,5),(253,5),(254,5),(255,5),(256,5),(257,5),(258,5),(259,5),(260,5),(261,5),(262,5),(263,5),(264,5),(265,5),(266,5),(267,5),(268,5),(269,5),(270,5),(271,5),(272,5),(273,5),(274,5),(275,5),(276,5),(277,5),(278,5),(279,5),(280,5),(281,5),(282,5),(283,5),(284,5),(285,5),(286,5),(287,5),(288,5),(289,5),(290,5),(291,5),(292,5),(293,5),(294,5),(295,5),(296,5),(297,5),(298,5),(299,5),(300,5),(301,5),(302,5),(303,5),(304,5),(305,5),(306,5),(307,5),(308,5),(309,5),(313,5),(314,5),(320,5),(323,5),(327,5),(331,5),(332,5),(333,5),(334,5),(335,5),(336,5),(337,5),(338,5),(339,5),(340,5),(341,5),(342,5),(343,5),(344,5),(345,5),(346,5),(347,5),(348,5),(349,5),(350,5),(351,5),(352,5),(353,5),(354,5),(355,5),(356,5),(357,5),(358,5),(359,5),(360,5),(361,5),(363,5),(364,5),(365,5),(366,5),(367,5),(368,5),(369,5),(370,5),(371,5),(372,5),(373,5),(374,5),(375,5),(376,5),(377,5),(378,5),(379,5),(380,5),(381,5),(382,5),(383,5),(384,5),(385,5),(386,5),(387,5),(388,5),(389,5),(390,5),(391,5),(392,5),(393,5),(394,5),(395,5),(396,5),(397,5),(398,5),(399,5),(400,5),(401,5),(402,5),(403,5),(404,5),(405,5),(406,5),(407,5),(408,5),(409,5),(410,5),(411,5),(412,5),(413,5),(414,5),(415,5),(416,5),(417,5),(418,5),(419,5),(420,5),(421,5),(422,5),(423,5),(424,5),(425,5),(426,5),(427,5),(428,5),(429,5),(430,5),(431,5),(432,5),(433,5),(434,5),(435,5),(436,5),(437,5),(438,5),(439,5),(440,5),(441,5),(442,5),(443,5),(444,5),(445,5),(446,5),(447,5),(448,5),(449,5),(450,5),(451,5),(452,5),(453,5),(185,6),(186,6),(187,6),(188,6),(189,6),(190,6),(191,6),(192,6),(193,6),(194,6),(195,6),(196,6),(197,6),(198,6),(199,6),(200,6),(201,6),(331,6),(332,6),(333,6),(334,6),(335,6),(336,6),(337,6),(338,6),(339,6),(340,6),(341,6),(342,6),(343,6),(344,6),(345,6),(346,6),(347,6),(348,6),(349,6),(350,6),(351,6),(352,6),(353,6),(354,6),(357,6),(358,6),(359,6),(360,6),(361,6),(362,6),(363,6),(364,6),(365,6),(366,6),(367,6),(368,6),(369,6),(370,6),(371,6),(372,6),(373,6),(374,6),(375,6),(376,6),(377,6),(378,6),(379,6),(380,6),(381,6),(382,6),(383,6),(384,6),(385,6),(386,6),(387,6),(388,6),(389,6),(390,6),(391,6),(392,6),(393,6),(394,6),(395,6),(93,7),(94,7),(95,7),(96,7),(97,7),(98,7),(99,7),(100,7),(101,7),(102,7),(103,7),(104,7),(105,7),(106,7),(216,7),(217,7),(218,7),(219,7),(220,7),(221,7),(222,7),(223,7),(224,7),(225,7),(226,7),(227,7),(228,7),(229,7),(230,7),(231,7),(232,7),(233,7),(234,7),(235,7),(236,7),(237,7),(238,7),(239,7),(240,7),(241,7),(242,7),(243,7),(244,7),(245,7),(246,7),(247,7),(248,7),(249,7),(250,7),(251,7),(252,7),(253,7),(307,7),(308,7),(309,7),(310,7),(357,7),(358,7),(359,7),(360,7),(361,7),(362,7),(363,7),(364,7),(365,7),(366,7),(367,7),(368,7),(369,7),(370,7),(371,7),(372,7),(373,7),(374,7),(375,7),(376,7),(377,7),(378,7),(379,7),(380,7),(381,7),(382,7),(383,7),(384,7),(385,7),(386,7),(387,7),(388,7),(389,7),(390,7),(391,7),(392,7),(393,7),(394,7),(395,7),(1,8),(2,8),(3,8),(4,8),(5,8),(6,8),(7,8),(8,8),(9,8),(10,8),(11,8),(12,8),(13,8),(14,8),(15,8),(16,8),(17,8),(18,8),(19,8),(20,8),(21,8),(22,8),(23,8),(24,8),(25,8),(26,8),(27,8),(28,8),(29,8),(30,8),(31,8),(32,8),(33,8),(34,8),(35,8),(36,8),(37,8),(38,8),(39,8),(40,8),(41,8),(42,8),(43,8),(44,8),(45,8),(46,8),(47,8),(48,8),(49,8),(50,8),(51,8),(52,8),(53,8),(54,8),(55,8),(56,8),(57,8),(58,8),(59,8),(60,8),(61,8),(62,8),(63,8),(64,8),(65,8),(66,8),(67,8),(68,8),(69,8),(70,8),(71,8),(72,8),(73,8),(74,8),(75,8),(76,8),(77,8),(78,8),(79,8),(80,8),(81,8),(82,8),(83,8),(84,8),(85,8),(86,8),(87,8),(88,8),(89,8),(90,8),(91,8),(92,8),(93,8),(94,8),(95,8),(96,8),(97,8),(98,8),(99,8),(100,8),(101,8),(102,8),(103,8),(104,8),(105,8),(106,8),(107,8),(108,8),(109,8),(110,8),(111,8),(112,8),(113,8),(114,8),(115,8),(116,8),(117,8),(118,8),(119,8),(120,8),(121,8),(122,8),(123,8),(124,8),(125,8),(126,8),(127,8),(128,8),(129,8),(130,8),(131,8),(132,8),(133,8),(134,8),(135,8),(136,8),(137,8),(138,8),(139,8),(140,8),(141,8),(142,8),(143,8),(144,8),(145,8),(146,8),(147,8),(148,8),(149,8),(150,8),(151,8),(152,8),(153,8),(154,8),(155,8),(156,8),(157,8),(158,8),(159,8),(160,8),(161,8),(162,8),(163,8),(164,8),(165,8),(166,8),(167,8),(168,8),(169,8),(170,8),(171,8),(172,8),(173,8),(174,8),(175,8),(176,8),(177,8),(178,8),(179,8),(180,8),(181,8),(182,8),(183,8),(184,8),(185,8),(186,8),(187,8),(188,8),(189,8),(190,8),(191,8),(192,8),(193,8),(194,8),(195,8),(196,8),(197,8),(198,8),(199,8),(200,8),(201,8),(202,8),(203,8),(204,8),(205,8),(206,8),(207,8),(208,8),(209,8),(210,8),(211,8),(212,8),(213,8),(214,8),(215,8),(216,8),(217,8),(218,8),(219,8),(220,8),(221,8),(222,8),(223,8),(224,8),(225,8),(226,8),(227,8),(228,8),(229,8),(230,8),(231,8),(232,8),(233,8),(234,8),(235,8),(236,8),(237,8),(238,8),(239,8),(240,8),(241,8),(242,8),(243,8),(244,8),(245,8),(246,8),(247,8),(248,8),(249,8),(250,8),(251,8),(252,8),(253,8),(254,8),(255,8),(256,8),(257,8),(258,8),(259,8),(260,8),(261,8),(262,8),(263,8),(264,8),(265,8),(266,8),(267,8),(268,8),(269,8),(270,8),(271,8),(272,8),(273,8),(274,8),(275,8),(276,8),(277,8),(278,8),(279,8),(280,8),(281,8),(282,8),(283,8),(284,8),(285,8),(286,8),(287,8),(288,8),(289,8),(290,8),(291,8),(292,8),(293,8),(294,8),(295,8),(296,8),(297,8),(298,8),(299,8),(300,8),(301,8),(302,8),(303,8),(304,8),(305,8),(306,8),(307,8),(308,8),(309,8),(310,8),(311,8),(312,8),(313,8),(314,8),(315,8),(316,8),(317,8),(318,8),(319,8),(320,8),(321,8),(322,8),(323,8),(324,8),(325,8),(326,8),(327,8),(328,8),(329,8),(330,8),(331,8),(332,8),(333,8),(334,8),(335,8),(336,8),(337,8),(338,8),(339,8),(340,8),(341,8),(342,8),(343,8),(344,8),(345,8),(346,8),(347,8),(348,8),(349,8),(350,8),(351,8),(352,8),(353,8),(354,8),(355,8),(356,8),(357,8),(358,8),(359,8),(360,8),(361,8),(362,8),(363,8),(364,8),(365,8),(366,8),(367,8),(368,8),(369,8),(370,8),(371,8),(372,8),(373,8),(374,8),(375,8),(376,8),(377,8),(378,8),(379,8),(380,8),(381,8),(382,8),(383,8),(384,8),(385,8),(386,8),(387,8),(388,8),(389,8),(390,8),(391,8),(392,8),(393,8),(394,8),(395,8),(396,8),(397,8),(398,8),(399,8),(400,8),(401,8),(402,8),(403,8),(404,8),(405,8),(406,8),(407,8),(408,8),(409,8),(410,8),(411,8),(412,8),(413,8),(414,8),(415,8),(416,8),(417,8),(418,8),(419,8),(420,8),(421,8),(422,8),(423,8),(424,8),(425,8),(426,8),(427,8),(428,8),(429,8),(430,8),(431,8),(432,8),(433,8),(434,8),(435,8),(436,8),(437,8),(438,8),(439,8),(440,8),(441,8),(442,8),(443,8),(444,8),(445,8),(446,8),(447,8),(448,8),(449,8),(450,8),(451,8),(452,8),(453,8),(454,8),(455,8),(456,8),(457,8),(458,8),(459,8),(460,8),(461,8),(462,8),(463,8),(464,8),(465,8),(466,8),(467,8);

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `branch_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` VALUES (1,'ac7e5b0f-d0dd-44a4-913c-6d365861fad6','07ed4bf3-eea2-489d-8b80-c379e67636e9','super_user','api','2026-01-20 02:08:21','2026-01-20 02:08:21'),(2,'ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'General Manager','api','2026-01-20 15:05:05','2026-01-20 15:05:05'),(3,'ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'Procurement & Supply Officer','api','2026-01-20 15:08:57','2026-01-20 15:08:57'),(4,'ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'Chief Accountant','api','2026-01-20 15:14:18','2026-01-20 15:14:18'),(5,'ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'Chief Internal Auditor','api','2026-01-20 15:14:52','2026-01-20 15:14:52'),(6,'ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'HR & ADM Manager','api','2026-01-20 15:15:40','2026-01-20 15:15:40'),(7,'ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'Operation & Transport Manager','api','2026-01-20 15:16:10','2026-01-20 15:16:10'),(8,'ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'IT_Ofiicer','api','2026-01-20 15:16:45','2026-01-20 15:16:45'),(9,'ac7e5b0f-d0dd-44a4-913c-6d365861fad6',NULL,'Other office_Staff','api','2026-01-21 09:29:42','2026-01-21 12:34:36');

--
-- Table structure for table `salary_structure_allowances`
--

CREATE TABLE `salary_structure_allowances` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `salary_structure_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `allowance_type_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` decimal(20,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `salary_structure_allowances_salary_structure_id_foreign` (`salary_structure_id`),
  KEY `salary_structure_allowances_allowance_type_id_foreign` (`allowance_type_id`),
  CONSTRAINT `salary_structure_allowances_allowance_type_id_foreign` FOREIGN KEY (`allowance_type_id`) REFERENCES `allowance_types` (`id`) ON DELETE CASCADE,
  CONSTRAINT `salary_structure_allowances_salary_structure_id_foreign` FOREIGN KEY (`salary_structure_id`) REFERENCES `salary_structures` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `salary_structure_allowances`
--


--
-- Table structure for table `salary_structure_deductions`
--

CREATE TABLE `salary_structure_deductions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `salary_structure_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deduction_type_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` decimal(20,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `salary_structure_deductions_salary_structure_id_foreign` (`salary_structure_id`),
  KEY `salary_structure_deductions_deduction_type_id_foreign` (`deduction_type_id`),
  CONSTRAINT `salary_structure_deductions_deduction_type_id_foreign` FOREIGN KEY (`deduction_type_id`) REFERENCES `deduction_types` (`id`) ON DELETE CASCADE,
  CONSTRAINT `salary_structure_deductions_salary_structure_id_foreign` FOREIGN KEY (`salary_structure_id`) REFERENCES `salary_structures` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `salary_structure_deductions`
--


--
-- Table structure for table `salary_structures`
--

CREATE TABLE `salary_structures` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `basic_pay` decimal(20,2) NOT NULL,
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `salary_structures`
--

INSERT INTO `salary_structures` VALUES ('00d87fe1-dc7d-4efa-8d5f-1d6968629570','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCUSS – A2',360000.00,NULL,'2026-01-20 12:32:44','2026-01-20 12:34:21','2026-01-20 12:34:21'),('0761baec-c2b4-46fa-b480-0ac5d7a36806','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-JML',334368.00,'Joseph Masanilo Lugembe','2026-01-20 13:50:05','2026-01-20 13:50:05',NULL),('079dbf55-261d-409b-8fab-884d15b48b0b','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-MNJ',334368.00,'Malaba Nyanga Jayoga','2026-01-20 13:07:57','2026-01-20 13:07:57',NULL),('097cfb86-381a-4e26-b266-267eea6be00b','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-MMKMBL',334368.00,'Marco Mazoya Kambilo','2026-01-20 13:53:12','2026-03-28 08:55:46',NULL),('0b4c3c30-afcb-4cf4-ba03-79fe8d409d7d','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-TEM',1094888.00,'Thomas Ernest Merengo','2026-01-20 12:35:54','2026-01-20 13:58:55',NULL),('110cfbfe-01ce-4213-bf58-e6f129b93be7','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-FLK',448058.00,'Francis Lolela Kilala','2026-01-20 12:45:40','2026-01-20 13:59:29',NULL),('120bed8b-2edc-42aa-acd0-e86c14548389','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-CWS',371520.00,'Charles William Sumbula','2026-01-20 13:01:33','2026-01-20 14:00:10',NULL),('13854cf4-61d0-49d8-9873-770fb08ec699','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-JM',334368.00,'Joseph Manyilizu','2026-01-20 13:51:40','2026-01-20 13:51:40',NULL),('1e51402f-9eea-4eeb-b46b-297252481909','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCUSS – JSCH',250000.00,'Joyce Sichembe','2026-03-28 11:02:34','2026-03-28 11:02:34',NULL),('2327a03e-796f-4ba3-b6db-0ae5854f2df9','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-DS',299925.00,'Daniel Simbila','2026-01-20 13:58:30','2026-01-20 13:58:30',NULL),('2f86156e-7bfd-47d7-9f37-1707f347045c','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-AMS',580500.00,'Amiri Mwarabu Salum','2026-01-20 13:56:10','2026-01-20 13:56:10',NULL),('34c5305c-997b-42d3-9424-6e2c5419eacf','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-WTG',657627.00,'Wilson Titus Gatani','2026-01-20 12:40:35','2026-01-20 14:00:26',NULL),('3515acea-bf22-4b66-ac10-16c0cb8e288f','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-NMN',334368.00,'Ngassa Machimu Ngassa','2026-01-20 13:07:00','2026-03-28 08:53:33','2026-03-28 08:53:33'),('3d560a52-5d03-4618-9470-47101e4b4a2f','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-CMM',550333.00,'Celina Michael Matembe','2026-01-20 12:42:48','2026-01-20 14:00:46',NULL),('4352b5b9-ec63-4591-b617-9c09d9106ce1','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-SC',334368.00,'Stephano Chalya','2026-01-20 13:47:12','2026-01-20 13:47:12',NULL),('4c595f75-34aa-4f7f-9cad-893b884b0d9f','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-NMN',334368.00,'Ngassa Machimu Ngassa','2026-01-20 13:04:54','2026-01-20 14:01:35',NULL),('50ddf3de-259b-43ec-88b5-da62b3b36202','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-RMM',939181.00,'Rachel Matondo Mahona','2026-01-20 12:41:08','2026-01-20 14:02:01',NULL),('5363e2b7-8e9c-4e4a-9404-561a224e3449','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-RKK',657627.00,'Ramadhan Khamis Katto','2026-01-20 12:46:11','2026-01-20 14:02:28',NULL),('581994b7-54e7-4b1b-9055-7a3f7cfd2b83','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-JYP',334368.00,'Jacob Yona Petro','2026-01-20 13:42:46','2026-01-20 13:43:23',NULL),('5dce9633-606f-464b-b036-ef7fb3d271e3','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-RNK',616781.00,'Robert Nathan Katumbi','2026-01-20 12:47:07','2026-01-20 14:02:54',NULL),('6498fbe8-3bfc-43dc-a1cf-7e46c115f165','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-EDM',290250.00,'Esther Damas Manyama','2026-01-20 13:02:47','2026-01-20 14:07:39',NULL),('69675274-50af-45de-ad94-8f4f6bd85cac','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-ENJ',334368.00,'Emmanuel Ng\'wala Jidamabi','2026-01-20 13:04:26','2026-01-20 13:05:34',NULL),('6a22adb0-c0ce-4de1-871d-df76c1cf2615','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-JKK',334368.00,'James Kadesha Kumalija','2026-01-20 13:03:25','2026-01-20 14:03:48',NULL),('6dc66e08-eed7-4f3b-aab2-b305731c9994','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-PYP',334368.00,'Petro Yona Petro','2026-01-20 13:44:10','2026-01-20 13:44:10',NULL),('6e91af17-5625-46cb-9d99-ab2919c5a364','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-DNK',334368.00,'Dashi Nshoka Kwangu','2026-01-20 13:02:14','2026-01-20 14:04:29',NULL),('6f018a2a-8ea6-44ed-b170-77abc89e6e0e','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-HHK',435375.00,'Happiness Henry Kabogo','2026-01-20 12:42:17','2026-01-20 14:05:04',NULL),('8322b7b1-5702-47d3-a43d-3de3aef60a66','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-ASM',653208.00,'Amon Stephen Mahimbo','2026-01-20 12:43:21','2026-01-20 14:05:47',NULL),('84fd0360-5326-4ad4-b595-7c038c8480ab','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCUSS-JMPW',350000.00,'John Mipawa','2026-01-21 12:33:29','2026-03-28 10:12:24',NULL),('852659e9-c33f-4c6b-9453-63cecc33a75c','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-ESN',751429.00,'Edson Sang\'udi Ngulimi','2026-01-20 13:00:41','2026-01-20 14:07:55',NULL),('85e80c2a-78aa-4e17-9e27-7078dd0f3828','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-LS',299925.00,'Luponya Shimba','2026-01-20 13:57:45','2026-01-20 13:57:45',NULL),('8ddb04cc-6604-41d9-87b3-dfff8b1b2dd7','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-SNM',334368.00,'Silvester Ngusa Malegi','2026-01-20 13:50:51','2026-01-20 13:50:51',NULL),('8ef3f8a5-a0e4-46bc-8aa0-9d44327eb345','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-ML',334368.00,'Mkonga Luhende','2026-01-20 13:49:03','2026-01-20 13:49:03',NULL),('a2b2775f-fc34-41fd-863b-84d9b5b45f2e','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCUSS – A3',380000.00,NULL,'2026-01-20 12:33:11','2026-01-20 12:34:25','2026-01-20 12:34:25'),('a821e962-9e0e-4722-8c1e-79350346d1f9','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-SRL',334368.00,'Sande Robert Luhende','2026-01-20 13:41:50','2026-01-20 13:41:50',NULL),('a88e79ac-b1fc-41ab-a4e3-38448714f332','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-BM',334368.00,'Benard Maduhu','2026-01-20 13:53:43','2026-01-20 13:53:43',NULL),('ad0c4a32-2ba7-4f1f-9e40-4a591be9d1d7','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-WK',334368.00,'William Kitebi','2026-01-20 13:52:14','2026-01-20 13:52:14',NULL),('af406ee8-b97f-4226-8e04-22c3eeb96fae','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCUSS – B1',400000.00,NULL,'2026-01-20 12:33:43','2026-01-20 12:34:28','2026-01-20 12:34:28'),('b053c22f-567a-45fa-8d19-7ee142b28fa1','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-AJM',1400000.00,'Alpha Joab Makasi','2026-01-20 12:43:45','2026-01-20 14:08:22',NULL),('bd17fdd3-2034-4281-b505-7da70c675772','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-LPW',334368.00,'Leonard P. Watosha','2026-01-20 13:54:36','2026-01-20 13:54:36',NULL),('c9eff2c4-3d4f-4567-bf8b-434c6ab1a53b','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-MMKNJ',657627.00,'Masele Michael Kunji','2026-01-20 12:41:45','2026-03-28 08:56:04',NULL),('d467b827-7437-4e02-a490-9bc0cba83ca1','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCUSS – A1',350000.00,NULL,'2026-01-20 12:32:17','2026-01-20 12:34:30','2026-01-20 12:34:30'),('dab4f876-0adf-436c-bc41-1b7c74998bee','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-JJB',1094888.00,'Joseph Julius Bukombe','2026-01-20 12:39:38','2026-01-20 14:09:00',NULL),('e4656a0f-be6b-4c49-9b97-49cf1128e46d','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-JMF',334368.00,'Juma Mussa Fikiri','2026-01-20 13:55:17','2026-01-20 13:55:17',NULL),('e518599c-0c07-4947-980f-154cdb9049e9','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-KPM',657627.00,'Kelvin Peter Mrope','2026-01-20 12:35:09','2026-01-20 14:09:15',NULL),('e799ec36-ce06-4337-b794-550323754ff6','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCUSS–KHK',350000.00,'Kheri Hassan Kakolwa','2026-01-21 12:33:00','2026-01-21 12:33:48',NULL),('f0901525-1ef8-449a-9963-e696ebbc7e7a','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCUSS – HSS',250000.00,'Happiness Simon Seleman','2026-03-28 11:03:26','2026-03-28 11:14:59',NULL),('f8d52eea-84e1-4772-9432-0a8230a20d94','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','SRCU-ESN',751429.00,NULL,'2026-01-20 12:44:23','2026-01-20 12:45:12','2026-01-20 12:45:12');

--
-- Table structure for table `sale_commissions`
--

CREATE TABLE `sale_commissions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `returned_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sales_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `percentage` decimal(10,2) NOT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `calculated_amount` decimal(20,2) NOT NULL,
  `paid_amount` decimal(20,2) NOT NULL,
  `status` enum('paid','pending') COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_commissions`
--


--
-- Table structure for table `sale_contracts`
--

CREATE TABLE `sale_contracts` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `opportunity_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quote_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contract_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `version` int NOT NULL DEFAULT '1',
  `status` enum('draft','active','expired','terminated','renewed') COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `contract_value` decimal(15,2) NOT NULL,
  `currency` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_schedule` json DEFAULT NULL,
  `signed_at` date NOT NULL,
  `terminated_at` date DEFAULT NULL,
  `terms_and_conditions` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `special_conditions` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `document_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_info` json NOT NULL,
  `signatory_info` json NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_contracts_order_id_foreign` (`order_id`),
  CONSTRAINT `sale_contracts_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `sale_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_contracts`
--


--
-- Table structure for table `sale_invoices`
--

CREATE TABLE `sale_invoices` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `party_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `party_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sale_order_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `invoice_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `issue_date` date NOT NULL,
  `due_date` date NOT NULL,
  `status` enum('draft','posted','paid','partially_paid','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tax_total` decimal(20,2) NOT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `total_amount` decimal(20,2) NOT NULL,
  `invoice_amount` decimal(20,2) GENERATED ALWAYS AS ((`total_amount` + `tax_total`)) STORED,
  `amount_paid` decimal(20,2) NOT NULL DEFAULT '0.00',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `payment_instructions` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reason_for_canceling` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sale_invoices_invoice_number_unique` (`invoice_number`),
  KEY `sale_invoices_party_type_party_id_index` (`party_type`,`party_id`),
  KEY `sale_invoices_sale_order_id_index` (`sale_order_id`),
  KEY `sale_invoices_status_index` (`status`),
  KEY `sale_invoices_created_by_foreign` (`created_by`),
  CONSTRAINT `sale_invoices_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sale_invoices_sale_order_id_foreign` FOREIGN KEY (`sale_order_id`) REFERENCES `sale_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_invoices`
--


--
-- Table structure for table `sale_orders`
--

CREATE TABLE `sale_orders` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quote_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `current_approval_level` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `so_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `version` int NOT NULL DEFAULT '1',
  `order_type` enum('service','item','custom') COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_date` date NOT NULL,
  `sent_at` date DEFAULT NULL,
  `accepted_at` date DEFAULT NULL,
  `rejected_at` date DEFAULT NULL,
  `reviewed_at` date DEFAULT NULL,
  `discount_type` decimal(20,2) NOT NULL DEFAULT '0.00',
  `discount_value` decimal(20,2) NOT NULL DEFAULT '0.00',
  `discount_amount` decimal(20,2) NOT NULL DEFAULT '0.00',
  `shipping_amount` decimal(20,2) NOT NULL DEFAULT '0.00',
  `total_amount` decimal(20,2) NOT NULL DEFAULT '0.00',
  `expected_delivery_date` date DEFAULT NULL,
  `special_instructions` text COLLATE utf8mb4_unicode_ci,
  `status` enum('Draft','Pending','Reviewed','Approved','Rejected','In_Progress','Completed','Cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `rejection_reason` text COLLATE utf8mb4_unicode_ci,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sale_orders_so_number_unique` (`so_number`),
  KEY `sale_orders_quote_id_foreign` (`quote_id`),
  KEY `sale_orders_customer_id_foreign` (`customer_id`),
  KEY `sale_orders_current_approval_level_foreign` (`current_approval_level`),
  CONSTRAINT `sale_orders_current_approval_level_foreign` FOREIGN KEY (`current_approval_level`) REFERENCES `approval_levels` (`id`),
  CONSTRAINT `sale_orders_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `sale_orders_quote_id_foreign` FOREIGN KEY (`quote_id`) REFERENCES `quotes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_orders`
--


--
-- Table structure for table `sales`
--

CREATE TABLE `sales` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `warehouse_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cashier_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cashier_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `currency_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `amount` decimal(10,2) NOT NULL,
  `discount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `payment_status` enum('paid','pending','partial','credit','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `reversed` tinyint(1) NOT NULL DEFAULT '0',
  `payment_method_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sale_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `unique_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transaction_reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `reversed_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reversal_date` date DEFAULT NULL,
  `reversal_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_currency_id_foreign` (`currency_id`),
  KEY `sales_warehouse_id_foreign` (`warehouse_id`),
  KEY `sales_customer_id_foreign` (`customer_id`),
  KEY `sales_payment_method_id_foreign` (`payment_method_id`),
  CONSTRAINT `sales_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  CONSTRAINT `sales_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `sales_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`),
  CONSTRAINT `sales_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales`
--


--
-- Table structure for table `sales_items`
--

CREATE TABLE `sales_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sale_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `uom_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(12,4) NOT NULL,
  `exchange_rate` decimal(12,6) NOT NULL DEFAULT '1.000000',
  `unit_price` decimal(10,2) NOT NULL,
  `subtotal` decimal(10,2) NOT NULL,
  `tax` decimal(10,2) NOT NULL DEFAULT '0.00',
  `discount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `unique_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_items_uom_id_foreign` (`uom_id`),
  KEY `sales_items_sale_id_foreign` (`sale_id`),
  KEY `sales_items_item_id_foreign` (`item_id`),
  CONSTRAINT `sales_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sales_items_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sales_items_uom_id_foreign` FOREIGN KEY (`uom_id`) REFERENCES `unit_of_measures` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sales_items`
--


--
-- Table structure for table `sample_approvals`
--

CREATE TABLE `sample_approvals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approvable_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approvable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approved_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `remarks` text COLLATE utf8mb4_unicode_ci,
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sample_approvals_organisation_id_foreign` (`organisation_id`),
  KEY `sample_approvals_approved_by_foreign` (`approved_by`),
  KEY `sample_approvals_level_id_foreign` (`level_id`),
  KEY `sample_approvals_approvable_id_approvable_type_index` (`approvable_id`,`approvable_type`),
  CONSTRAINT `sample_approvals_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sample_approvals_level_id_foreign` FOREIGN KEY (`level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sample_approvals_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sample_approvals`
--


--
-- Table structure for table `sample_weighings`
--

CREATE TABLE `sample_weighings` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sample_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `weight` decimal(10,2) NOT NULL,
  `uom_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `weighed_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `current_approval_level` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remarks` text COLLATE utf8mb4_unicode_ci,
  `status` enum('pending','under_review','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sample_weighings_sample_id_foreign` (`sample_id`),
  KEY `sample_weighings_organisation_id_foreign` (`organisation_id`),
  KEY `sample_weighings_uom_id_foreign` (`uom_id`),
  KEY `sample_weighings_weighed_by_foreign` (`weighed_by`),
  KEY `sample_weighings_current_approval_level_foreign` (`current_approval_level`),
  CONSTRAINT `sample_weighings_current_approval_level_foreign` FOREIGN KEY (`current_approval_level`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sample_weighings_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sample_weighings_sample_id_foreign` FOREIGN KEY (`sample_id`) REFERENCES `samples` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sample_weighings_uom_id_foreign` FOREIGN KEY (`uom_id`) REFERENCES `unit_of_measures` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sample_weighings_weighed_by_foreign` FOREIGN KEY (`weighed_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sample_weighings`
--


--
-- Table structure for table `samples`
--

CREATE TABLE `samples` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_taken` date NOT NULL,
  `sample_quantity` decimal(10,2) NOT NULL,
  `sample_uom_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `picked_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `units` int NOT NULL DEFAULT '1',
  `unit_uom_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sample_round` int NOT NULL DEFAULT '1',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `unique_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','in_process','assessed','weighed','approved','payment_completed','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `samples_organisation_id_foreign` (`organisation_id`),
  KEY `samples_supplier_id_foreign` (`supplier_id`),
  KEY `samples_sample_uom_id_foreign` (`sample_uom_id`),
  KEY `samples_unit_uom_id_foreign` (`unit_uom_id`),
  KEY `samples_picked_by_foreign` (`picked_by`),
  CONSTRAINT `samples_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `samples_picked_by_foreign` FOREIGN KEY (`picked_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `samples_sample_uom_id_foreign` FOREIGN KEY (`sample_uom_id`) REFERENCES `unit_of_measures` (`id`) ON DELETE CASCADE,
  CONSTRAINT `samples_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `samples_unit_uom_id_foreign` FOREIGN KEY (`unit_uom_id`) REFERENCES `unit_of_measures` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `samples`
--


--
-- Table structure for table `seasonal_pricing`
--

CREATE TABLE `seasonal_pricing` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rental_type_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `season_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `rate_multiplier` decimal(5,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `seasonal_pricing_rental_type_id_foreign` (`rental_type_id`),
  CONSTRAINT `seasonal_pricing_rental_type_id_foreign` FOREIGN KEY (`rental_type_id`) REFERENCES `rental_types` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `seasonal_pricing`
--


--
-- Table structure for table `sectors`
--

CREATE TABLE `sectors` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sector_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sectors`
--


--
-- Table structure for table `segments`
--

CREATE TABLE `segments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `segments`
--


--
-- Table structure for table `service_items`
--

CREATE TABLE `service_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cost_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `selling_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `service_items`
--


--
-- Table structure for table `services`
--

CREATE TABLE `services` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(8,2) NOT NULL DEFAULT '0.00',
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `services`
--

INSERT INTO `services` VALUES ('19e6b303-d50d-47fb-a697-4c53f2db665d','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Recruitment',0.00,'Recruitment Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('416afa15-9e39-4d6f-b994-a6f99822a2dc','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Requisitions',0.00,'Requisitions Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('5a40b104-ec35-436d-803b-219017431cb2','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Accounting',0.00,'Accounting Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('68460011-b08d-40d5-9826-6539fe4796fc','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Procurement',0.00,'Procurement Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('71fe893c-3956-48f3-bbe8-60b5add3869c','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Investment',0.00,'Investment Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('7db34290-b914-448d-9aa2-571b84feb2ce','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Budget',0.00,'Budget Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('8429eeb5-59b4-48c2-8398-f842642129c3','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','CRM',0.00,'Customer Relationship Management','2026-01-20 02:08:20','2026-01-20 02:08:20'),('87a193ec-15d5-49df-af89-da2ae5f8ba5e','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Manufacturing',0.00,'Manufacturing Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('b619fe61-9283-4619-aef6-ff5116bfa9b6','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Sales',0.00,'Sales Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('b912970f-dbfe-4cfc-89fc-84a48244a5b7','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Assets',0.00,'Assets Management Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('bf24daaa-4483-4ab0-a265-98d0ef7d9b03','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Branches',0.00,'Branch Management Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('ca5b6609-7812-4a3a-b003-b22a5648aee8','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Projects',0.00,'Projects Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('dfa6194d-6eca-4e6f-a295-b47f5c91cb08','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Reports',0.00,'Reporting Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('f10a0335-9f50-486d-b354-f67efa44593a','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Human Resource',0.00,'HR Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('f72aacbd-f4ee-47cd-8e4c-34c4ea772ed3','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Inventory',0.00,'Inventory Module','2026-01-20 02:08:20','2026-01-20 02:08:20'),('ffba6077-da72-4120-984c-d48972f4f568','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Settings',0.00,'Settings Module','2026-01-20 02:08:20','2026-01-20 02:08:20');

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

CREATE TABLE `settings` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `logo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `purchase_requisition_tc` text COLLATE utf8mb4_unicode_ci,
  `customer_requisition_tc` text COLLATE utf8mb4_unicode_ci,
  `invoice_tc` text COLLATE utf8mb4_unicode_ci,
  `grn_count` int NOT NULL DEFAULT '0',
  `invoice_count` int NOT NULL DEFAULT '0',
  `delivery_note_count` int NOT NULL DEFAULT '0',
  `purchase_requisition_count` int NOT NULL DEFAULT '0',
  `customer_requisition_count` int NOT NULL DEFAULT '0',
  `grn_prefix` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivery_note_prefix` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `invoice_prefix` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `purchase_requisition_prefix` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `customer_requisition_prefix` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bills_of_material_code_prefix` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `next_bills_of_material_code` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `routing_code` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `settlement_payments`
--

CREATE TABLE `settlement_payments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `settlement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `date_paid` date DEFAULT NULL,
  `remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('active','reversed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `settlement_payments_settlement_id_foreign` (`settlement_id`),
  CONSTRAINT `settlement_payments_settlement_id_foreign` FOREIGN KEY (`settlement_id`) REFERENCES `item_settlements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settlement_payments`
--


--
-- Table structure for table `shift_schedules`
--

CREATE TABLE `shift_schedules` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shift_date` date NOT NULL,
  `shift_start` time NOT NULL,
  `shift_end` time NOT NULL,
  `shift_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `shift_schedules_employee_id_foreign` (`employee_id`),
  CONSTRAINT `shift_schedules_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shift_schedules`
--


--
-- Table structure for table `shipment_packages`
--

CREATE TABLE `shipment_packages` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipment_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_package_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `position` int NOT NULL,
  `tracking_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('IN_WAREHOUSE','IN_TRANSIT','DELIVERED','RETURNED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'IN_WAREHOUSE',
  PRIMARY KEY (`id`),
  KEY `shipment_packages_shipment_id_foreign` (`shipment_id`),
  KEY `shipment_packages_order_package_id_foreign` (`order_package_id`),
  CONSTRAINT `shipment_packages_order_package_id_foreign` FOREIGN KEY (`order_package_id`) REFERENCES `order_packages` (`id`) ON DELETE CASCADE,
  CONSTRAINT `shipment_packages_shipment_id_foreign` FOREIGN KEY (`shipment_id`) REFERENCES `shipments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shipment_packages`
--


--
-- Table structure for table `shipments`
--

CREATE TABLE `shipments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipment_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sale_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `truck_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `received_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tracking_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tracking_url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `estimated_delivery_date` date NOT NULL,
  `actual_delivery_date` date DEFAULT NULL,
  `shipping_date` date NOT NULL,
  `shipping_cost` decimal(15,2) NOT NULL DEFAULT '0.00',
  `insurance_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `status` enum('processing','picked_up','in_transit','out_for_delivery','delivered','returned') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'processing',
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `shipments_sale_order_id_foreign` (`sale_order_id`),
  KEY `shipments_truck_id_foreign` (`truck_id`),
  KEY `shipments_received_by_foreign` (`received_by`),
  CONSTRAINT `shipments_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `shipments_sale_order_id_foreign` FOREIGN KEY (`sale_order_id`) REFERENCES `sale_orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `shipments_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shipments`
--


--
-- Table structure for table `skills`
--

CREATE TABLE `skills` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `skills_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `skills`
--


--
-- Table structure for table `special_collected_weights`
--

CREATE TABLE `special_collected_weights` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `farmerUid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `productUid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `gradeUid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `warehouseUid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `buyerUid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `gradePriceUid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `memberType` enum('MEMBER','NON-MEMBER') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'MEMBER',
  `batchRef` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bags` int NOT NULL,
  `moistureInPercent` decimal(10,2) NOT NULL,
  `grossWeight` decimal(10,2) NOT NULL,
  `packageWeight` decimal(10,2) NOT NULL,
  `netWeight` decimal(10,2) NOT NULL,
  `receiptNo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `receiptDate` date NOT NULL,
  `clerkName` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `referenceNumber` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `isFinalCollection` tinyint(1) NOT NULL DEFAULT '0',
  `collectionPhaseType` enum('FINAL') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'FINAL',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `special_collected_weights`
--


--
-- Table structure for table `stock_movements`
--

CREATE TABLE `stock_movements` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `inventory_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` enum('sale','purchase','transfer_in','transfer_out','return','writeoff','manufacturing','donations','consumption','milling') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'purchase',
  `quantity` decimal(10,2) NOT NULL,
  `warehouse_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` enum('in','out') COLLATE utf8mb4_unicode_ci NOT NULL,
  `picked_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `received_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivered_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `donated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `returned_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivery_remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `movement_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `movement_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','received','moved','reversed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'received',
  `unique_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stock_movements_source_type_source_id_index` (`source_type`,`source_id`),
  KEY `stock_movements_item_id_foreign` (`item_id`),
  KEY `stock_movements_inventory_id_foreign` (`inventory_id`),
  KEY `stock_movements_warehouse_id_foreign` (`warehouse_id`),
  CONSTRAINT `stock_movements_inventory_id_foreign` FOREIGN KEY (`inventory_id`) REFERENCES `inventories` (`id`) ON DELETE CASCADE,
  CONSTRAINT `stock_movements_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE,
  CONSTRAINT `stock_movements_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `stock_movements`
--


--
-- Table structure for table `storage_quotas`
--

CREATE TABLE `storage_quotas` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quota_holder_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quota_holder_id` bigint unsigned NOT NULL,
  `quota_limit` bigint NOT NULL DEFAULT '0',
  `used_space` bigint NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `storage_quotas_quota_holder_id_quota_holder_type_unique` (`quota_holder_id`,`quota_holder_type`),
  KEY `storage_quotas_quota_holder_type_quota_holder_id_index` (`quota_holder_type`,`quota_holder_id`),
  KEY `storage_quotas_organisation_id_index` (`organisation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `storage_quotas`
--


--
-- Table structure for table `store_requisition_approvals`
--

CREATE TABLE `store_requisition_approvals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `store_requisition_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `store_requisition_item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approver_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approved_quantity` decimal(10,2) NOT NULL,
  `date_approved` date NOT NULL,
  `status` enum('Approved','Rejected') COLLATE utf8mb4_unicode_ci NOT NULL,
  `comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `store_requisition_approvals_approval_level_id_foreign` (`approval_level_id`),
  KEY `store_requisition_approvals_store_requisition_id_foreign` (`store_requisition_id`),
  KEY `store_requisition_approvals_store_requisition_item_id_foreign` (`store_requisition_item_id`),
  KEY `store_requisition_approvals_approver_id_foreign` (`approver_id`),
  CONSTRAINT `store_requisition_approvals_approval_level_id_foreign` FOREIGN KEY (`approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `store_requisition_approvals_approver_id_foreign` FOREIGN KEY (`approver_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `store_requisition_approvals_store_requisition_id_foreign` FOREIGN KEY (`store_requisition_id`) REFERENCES `store_requisitions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `store_requisition_approvals_store_requisition_item_id_foreign` FOREIGN KEY (`store_requisition_item_id`) REFERENCES `store_requisition_items` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `store_requisition_approvals`
--


--
-- Table structure for table `store_requisition_items`
--

CREATE TABLE `store_requisition_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `store_requisition_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `uom_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `warehouse_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `requested_quantity` decimal(12,3) NOT NULL,
  `approved_quantity` decimal(12,3) DEFAULT NULL,
  `issued_quantity` decimal(12,3) DEFAULT NULL,
  `specification` text COLLATE utf8mb4_unicode_ci,
  `purpose` text COLLATE utf8mb4_unicode_ci,
  `status` enum('Pending','Approved','Partially_Approved','Rejected','Issued','Partially_Issued','Cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `store_requisition_items_store_requisition_id_foreign` (`store_requisition_id`),
  KEY `store_requisition_items_item_id_foreign` (`item_id`),
  KEY `store_requisition_items_uom_id_foreign` (`uom_id`),
  KEY `store_requisition_items_warehouse_id_foreign` (`warehouse_id`),
  CONSTRAINT `store_requisition_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `store_requisition_items_store_requisition_id_foreign` FOREIGN KEY (`store_requisition_id`) REFERENCES `store_requisitions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `store_requisition_items_uom_id_foreign` FOREIGN KEY (`uom_id`) REFERENCES `unit_of_measures` (`id`),
  CONSTRAINT `store_requisition_items_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `store_requisition_items`
--


--
-- Table structure for table `store_requisitions`
--

CREATE TABLE `store_requisitions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `department_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requisition_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `requested_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_approval_level` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `request_date` date NOT NULL,
  `required_date` date DEFAULT NULL,
  `priority` enum('Low','Medium','High') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Medium',
  `status` enum('Pending','Reviewed','Approved','Rejected','Fulfilled','Closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `purpose` text COLLATE utf8mb4_unicode_ci,
  `rejection_reason` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `store_requisitions_requisition_no_unique` (`requisition_no`),
  KEY `store_requisitions_current_approval_level_foreign` (`current_approval_level`),
  KEY `store_requisitions_department_id_foreign` (`department_id`),
  KEY `store_requisitions_requested_by_foreign` (`requested_by`),
  CONSTRAINT `store_requisitions_current_approval_level_foreign` FOREIGN KEY (`current_approval_level`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `store_requisitions_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
  CONSTRAINT `store_requisitions_requested_by_foreign` FOREIGN KEY (`requested_by`) REFERENCES `employees` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `store_requisitions`
--


--
-- Table structure for table `subscription_states`
--

CREATE TABLE `subscription_states` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `grace_period` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subscription_states_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `subscription_states`
--


--
-- Table structure for table `successors`
--

CREATE TABLE `successors` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `member_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nin` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `firstName` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lastName` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `middleName` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` enum('MALE','FEMALE') COLLATE utf8mb4_unicode_ci NOT NULL,
  `dateOfBirth` date DEFAULT NULL,
  `phoneNumber` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `referenceNumber` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `relationshipType` enum('son','Mother','Father','Daughter','Brother','Sister','Uncle','Aunt','Nephew','Niece','Cousin','Gandfather','Grandmother','Grandson','Granddaughter','Husband','Wife','Spouse','Partner','Fiance','Friend','Neighbour','Colleague') COLLATE utf8mb4_unicode_ci NOT NULL,
  `nationality` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `successors`
--


--
-- Table structure for table `supplier_documents`
--

CREATE TABLE `supplier_documents` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiry_date` date DEFAULT NULL,
  `is_verified` tinyint(1) NOT NULL DEFAULT '0',
  `verified_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supplier_documents_supplier_id_document_type_index` (`supplier_id`,`document_type`),
  CONSTRAINT `supplier_documents_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `supplier_documents`
--


--
-- Table structure for table `supplier_loan_approvals`
--

CREATE TABLE `supplier_loan_approvals` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `loan_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approval_level_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approved_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `approved_amount` decimal(15,2) DEFAULT NULL,
  `decision` enum('approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL,
  `remarks` text COLLATE utf8mb4_unicode_ci,
  `approved_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supplier_loan_approvals_loan_id_foreign` (`loan_id`),
  KEY `supplier_loan_approvals_approval_level_id_foreign` (`approval_level_id`),
  KEY `supplier_loan_approvals_approved_by_foreign` (`approved_by`),
  CONSTRAINT `supplier_loan_approvals_approval_level_id_foreign` FOREIGN KEY (`approval_level_id`) REFERENCES `approval_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_loan_approvals_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_loan_approvals_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `supplier_loans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `supplier_loan_approvals`
--


--
-- Table structure for table `supplier_loan_repayment_schedules`
--

CREATE TABLE `supplier_loan_repayment_schedules` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `loan_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `due_date` date NOT NULL,
  `principal_amount` decimal(15,2) NOT NULL,
  `interest_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `interest_paid` decimal(15,2) NOT NULL DEFAULT '0.00',
  `principal_paid` decimal(15,2) NOT NULL DEFAULT '0.00',
  `total_amount` decimal(15,2) GENERATED ALWAYS AS ((`principal_amount` + `interest_amount`)) STORED,
  `amount_paid` decimal(15,2) GENERATED ALWAYS AS ((`principal_paid` + `interest_paid`)) STORED,
  `balance` decimal(15,2) GENERATED ALWAYS AS ((`total_amount` - `amount_paid`)) STORED,
  `status` enum('pending','paid','overdue') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `paid_at` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supplier_loan_repayment_schedules_loan_id_foreign` (`loan_id`),
  CONSTRAINT `supplier_loan_repayment_schedules_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `supplier_loans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `supplier_loan_repayment_schedules`
--


--
-- Table structure for table `supplier_loan_repayments`
--

CREATE TABLE `supplier_loan_repayments` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `loan_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `method` enum('cash','produce') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount_paid` decimal(15,2) NOT NULL,
  `paid_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supplier_loan_repayments_loan_id_foreign` (`loan_id`),
  KEY `supplier_loan_repayments_supplier_id_foreign` (`supplier_id`),
  KEY `supplier_loan_repayments_organisation_id_foreign` (`organisation_id`),
  CONSTRAINT `supplier_loan_repayments_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `supplier_loans` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_loan_repayments_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_loan_repayments_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `supplier_loan_repayments`
--


--
-- Table structure for table `supplier_loans`
--

CREATE TABLE `supplier_loans` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_approval_level` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `requested_amount` decimal(15,2) NOT NULL,
  `interest_rate` decimal(10,2) NOT NULL DEFAULT '0.00',
  `installments` int NOT NULL,
  `approved_amount` decimal(15,2) DEFAULT NULL,
  `disbursed_amount` decimal(15,2) DEFAULT NULL,
  `total_paid` decimal(15,2) DEFAULT NULL,
  `balance` decimal(15,2) GENERATED ALWAYS AS ((`disbursed_amount` - `total_paid`)) STORED,
  `loan_reference` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `purpose` text COLLATE utf8mb4_unicode_ci,
  `requested_at` date NOT NULL,
  `disbursed_date` date DEFAULT NULL,
  `expected_repayment_date` date DEFAULT NULL,
  `status` enum('pending','reviewed','approved','rejected','disbursed','partially_paid','cleared','defaulted') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `supplier_loans_loan_reference_unique` (`loan_reference`),
  KEY `supplier_loans_supplier_id_foreign` (`supplier_id`),
  KEY `supplier_loans_organisation_id_foreign` (`organisation_id`),
  KEY `supplier_loans_created_by_foreign` (`created_by`),
  KEY `supplier_loans_current_approval_level_foreign` (`current_approval_level`),
  CONSTRAINT `supplier_loans_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_loans_current_approval_level_foreign` FOREIGN KEY (`current_approval_level`) REFERENCES `approval_levels` (`id`) ON DELETE SET NULL,
  CONSTRAINT `supplier_loans_organisation_id_foreign` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_loans_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `supplier_loans`
--


--
-- Table structure for table `supplier_repayment_items`
--

CREATE TABLE `supplier_repayment_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `repayment_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_delivery_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount_paid` decimal(15,2) NOT NULL,
  `produce_quantity` decimal(15,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supplier_repayment_items_repayment_id_foreign` (`repayment_id`),
  KEY `supplier_repayment_items_item_id_foreign` (`item_id`),
  CONSTRAINT `supplier_repayment_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE SET NULL,
  CONSTRAINT `supplier_repayment_items_repayment_id_foreign` FOREIGN KEY (`repayment_id`) REFERENCES `supplier_loan_repayments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `supplier_repayment_items`
--


--
-- Table structure for table `suppliers`
--

CREATE TABLE `suppliers` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `supplier_type` enum('Individual','Company','Government') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Company',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contact_person_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_person` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `postal_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `registration_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_registration_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_identification_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credit_limit` decimal(20,2) NOT NULL DEFAULT '0.00',
  `current_balance` decimal(20,2) NOT NULL DEFAULT '0.00',
  `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('inactive','active') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `bank_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_account_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_account_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_branch` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `suppliers`
--


--
-- Table structure for table `tags`
--

CREATE TABLE `tags` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `color` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#cccccc',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tags`
--


--
-- Table structure for table `taxes`
--

CREATE TABLE `taxes` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `taxes`
--


--
-- Table structure for table `tenant_invoices`
--

CREATE TABLE `tenant_invoices` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rental_agreement_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rent_period_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `invoice_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invoice_date` date NOT NULL,
  `due_date` date NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `balance` decimal(12,2) NOT NULL,
  `status` enum('pending','paid','overdue','partial') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `metadata` json DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tenant_invoices_invoice_number_unique` (`invoice_number`),
  KEY `tenant_invoices_rental_agreement_id_foreign` (`rental_agreement_id`),
  KEY `tenant_invoices_rent_period_id_foreign` (`rent_period_id`),
  CONSTRAINT `tenant_invoices_rent_period_id_foreign` FOREIGN KEY (`rent_period_id`) REFERENCES `rent_periods` (`id`) ON DELETE CASCADE,
  CONSTRAINT `tenant_invoices_rental_agreement_id_foreign` FOREIGN KEY (`rental_agreement_id`) REFERENCES `rental_agreements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tenant_invoices`
--


--
-- Table structure for table `tenants`
--

CREATE TABLE `tenants` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_security_deposit_paid` tinyint(1) NOT NULL DEFAULT '0',
  `balance` decimal(12,2) NOT NULL DEFAULT '0.00',
  `metadata` json DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tenants_balance_index` (`balance`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tenants`
--


--
-- Table structure for table `termination_reasons`
--

CREATE TABLE `termination_reasons` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reason_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `termination_reasons`
--


--
-- Table structure for table `timesheets`
--

CREATE TABLE `timesheets` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `clock_in` time NOT NULL,
  `clock_out` time NOT NULL,
  `hours_worked` decimal(5,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `timesheets_employee_id_foreign` (`employee_id`),
  CONSTRAINT `timesheets_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `timesheets`
--


--
-- Table structure for table `tools`
--

CREATE TABLE `tools` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `calibration_date` date NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tools`
--


--
-- Table structure for table `training_programs`
--

CREATE TABLE `training_programs` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `program_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `training_programs`
--


--
-- Table structure for table `transfer_deliveries`
--

CREATE TABLE `transfer_deliveries` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `transfer_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `truck_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `driver_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dispatched_at` timestamp NULL DEFAULT NULL,
  `delivered_at` timestamp NULL DEFAULT NULL,
  `delivery_note_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `offloaded_confirmed` tinyint(1) NOT NULL DEFAULT '0',
  `status` enum('pending','in_transit','delivered','confirmed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `proof_of_delivery` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivery_cordinates` text COLLATE utf8mb4_unicode_ci,
  `received_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transfer_deliveries_transfer_id_foreign` (`transfer_id`),
  KEY `transfer_deliveries_truck_id_foreign` (`truck_id`),
  KEY `transfer_deliveries_driver_id_foreign` (`driver_id`),
  KEY `transfer_deliveries_received_by_foreign` (`received_by`),
  CONSTRAINT `transfer_deliveries_driver_id_foreign` FOREIGN KEY (`driver_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transfer_deliveries_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `employees` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transfer_deliveries_transfer_id_foreign` FOREIGN KEY (`transfer_id`) REFERENCES `input_transfers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transfer_deliveries_truck_id_foreign` FOREIGN KEY (`truck_id`) REFERENCES `trucks` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transfer_deliveries`
--


--
-- Table structure for table `transfer_item_deliveries`
--

CREATE TABLE `transfer_item_deliveries` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `transfer_item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `delivery_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity_delivered` decimal(10,2) NOT NULL,
  `remarks` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transfer_item_deliveries_transfer_item_id_foreign` (`transfer_item_id`),
  KEY `transfer_item_deliveries_delivery_id_foreign` (`delivery_id`),
  CONSTRAINT `transfer_item_deliveries_delivery_id_foreign` FOREIGN KEY (`delivery_id`) REFERENCES `transfer_deliveries` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transfer_item_deliveries_transfer_item_id_foreign` FOREIGN KEY (`transfer_item_id`) REFERENCES `transfer_items` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transfer_item_deliveries`
--


--
-- Table structure for table `transfer_items`
--

CREATE TABLE `transfer_items` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `input_transfer_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `inventory_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity_delivered` decimal(10,2) DEFAULT NULL,
  `status` enum('pending','delivered','damaged','missing') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `item_remarks` text COLLATE utf8mb4_unicode_ci,
  `confirmed_at` timestamp NULL DEFAULT NULL,
  `confirmed_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transfer_items_input_transfer_id_foreign` (`input_transfer_id`),
  KEY `transfer_items_item_id_foreign` (`item_id`),
  KEY `transfer_items_inventory_id_foreign` (`inventory_id`),
  KEY `transfer_items_confirmed_by_foreign` (`confirmed_by`),
  CONSTRAINT `transfer_items_confirmed_by_foreign` FOREIGN KEY (`confirmed_by`) REFERENCES `employees` (`id`) ON DELETE SET NULL,
  CONSTRAINT `transfer_items_input_transfer_id_foreign` FOREIGN KEY (`input_transfer_id`) REFERENCES `input_transfers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transfer_items_inventory_id_foreign` FOREIGN KEY (`inventory_id`) REFERENCES `inventories` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transfer_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transfer_items`
--


--
-- Table structure for table `trucks`
--

CREATE TABLE `trucks` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `license_plate` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `capacity` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `capacity_uom` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('available','unavailable') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'available',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `trucks`
--


--
-- Table structure for table `unit_of_measures`
--

CREATE TABLE `unit_of_measures` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `abbreviation` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `unit_of_measures`
--

INSERT INTO `unit_of_measures` VALUES ('13c7b1b9-8ac1-49c5-8249-d9b0a2b08a1e','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Milliliter','mL','Volume',0,'2026-03-10 21:55:10','2026-03-10 21:55:10'),('27f8c911-c43f-4f59-8a89-f35724d8d150','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Tonne','t','Weight',0,'2026-03-10 21:55:10','2026-03-10 21:55:10'),('29cf2d1e-beee-40ef-a522-9ccca2e440a1','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Gram','g','Weight',0,'2026-03-10 21:55:10','2026-03-10 21:55:10'),('37fa4be3-d261-4ef5-9ba9-b79c6f9492f1','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Liter','L','Volume',0,'2026-03-10 21:55:10','2026-03-10 21:55:10'),('5fb8130d-2758-4db1-8308-a28a66025c76','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Bottle','Bottle','Weight',0,'2026-03-10 21:55:10','2026-03-10 21:55:10'),('784c5149-f382-48da-9cf2-5bf7c099f219','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Box','Box','Container',0,'2026-03-10 21:55:10','2026-03-10 21:55:10'),('94011a71-8d4e-49c5-b0b5-e933ddb69258','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Mesh Bag','Mesh','Weight',0,'2026-03-10 21:55:10','2026-03-10 21:55:10'),('942d3187-4716-421d-a85b-7359b751711d','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Meter','m','Length',0,'2026-03-10 21:55:10','2026-03-10 21:55:10'),('a2b0b0f3-8a6f-4bd5-b718-503396fafd3a','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Bag','bag','Weight',0,'2026-03-10 21:55:10','2026-03-10 21:55:10'),('eddf2dfe-f98e-49b2-beac-6d6281349d3c','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','Kilogram','kg','Weight',1,'2026-03-10 21:55:10','2026-03-10 21:55:10');

--
-- Table structure for table `unit_types`
--

CREATE TABLE `unit_types` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `unit_types`
--


--
-- Table structure for table `uom_conversions`
--

CREATE TABLE `uom_conversions` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `from_uom_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `to_uom_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `factor` decimal(24,12) NOT NULL,
  `created_by` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uom_conv_unique` (`organisation_id`,`from_uom_id`,`to_uom_id`),
  KEY `uom_conversions_from_uom_id_foreign` (`from_uom_id`),
  KEY `uom_conversions_to_uom_id_foreign` (`to_uom_id`),
  CONSTRAINT `uom_conversions_from_uom_id_foreign` FOREIGN KEY (`from_uom_id`) REFERENCES `unit_of_measures` (`id`) ON DELETE CASCADE,
  CONSTRAINT `uom_conversions_to_uom_id_foreign` FOREIGN KEY (`to_uom_id`) REFERENCES `unit_of_measures` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `uom_conversions`
--


--
-- Table structure for table `variant_attributes`
--

CREATE TABLE `variant_attributes` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_variant_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `attribute_value_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `variant_attributes`
--


--
-- Table structure for table `vaults`
--

CREATE TABLE `vaults` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `vault_location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vaults`
--


--
-- Table structure for table `vendor_performance`
--

CREATE TABLE `vendor_performance` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `vendor_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `purchase_order_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `delivery_timeliness_score` decimal(3,1) NOT NULL,
  `quality_score` decimal(3,1) NOT NULL,
  `pricing_score` decimal(3,1) NOT NULL,
  `comments` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vendor_performance_vendor_id_foreign` (`vendor_id`),
  KEY `vendor_performance_purchase_order_id_foreign` (`purchase_order_id`),
  CONSTRAINT `vendor_performance_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`),
  CONSTRAINT `vendor_performance_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `suppliers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vendor_performance`
--


--
-- Table structure for table `wards`
--

CREATE TABLE `wards` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `district_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `wards_district_id_foreign` (`district_id`),
  CONSTRAINT `wards_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `wards`
--


--
-- Table structure for table `warehouse_user`
--

CREATE TABLE `warehouse_user` (
  `warehouse_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`warehouse_id`,`employee_id`),
  KEY `warehouse_user_employee_id_foreign` (`employee_id`),
  CONSTRAINT `warehouse_user_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `warehouse_user_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `warehouse_user`
--


--
-- Table structure for table `warehouses`
--

CREATE TABLE `warehouses` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `warehouse_type` enum('only_store','sales_store') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'only_store' COMMENT 'Only store keeps items, The sales store can be used',
  `location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `longtitude` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latitude` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `warehouses`
--

INSERT INTO `warehouses` VALUES ('3b1afc86-9bee-41af-98a9-546bc6b3b003','ac7e5b0f-d0dd-44a4-913c-6d365861fad6','test','sales_store','kira',NULL,NULL,'2026-03-26 02:25:13','2026-03-26 02:25:13');

--
-- Table structure for table `work_experience`
--

CREATE TABLE `work_experience` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `employee_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `job_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `company_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `job_description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `work_experience_employee_id_foreign` (`employee_id`),
  CONSTRAINT `work_experience_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `work_experience`
--


--
-- Table structure for table `work_stations`
--

CREATE TABLE `work_stations` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `organisation_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `process_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `work_stations`
--



