-- Table structure for table `utils_document`
--

CREATE TABLE `utils_document` (
  `id` bigint NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `thumbnail` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` int UNSIGNED NOT NULL,
  `mime_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_public` tinyint(1) NOT NULL,
  `uploaded_by` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `uploaded_by_id` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ;

-- --------------------------------------------------------

--
-- Table structure for table `utils_documentshare`
--

CREATE TABLE `utils_documentshare` (
  `id` bigint NOT NULL,
  `shared_at` datetime(6) NOT NULL,
  `message` longtext COLLATE utf8mb4_unicode_ci,
  `is_read` tinyint(1) NOT NULL,
  `document` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shared_by` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shared_with` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shared_with_id` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `document_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `utils_documenttag`
--

CREATE TABLE `utils_documenttag` (
  `id` bigint NOT NULL,
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `created_by` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `utils_document_tags`
--

CREATE TABLE `utils_document_tags` (
  `id` bigint NOT NULL,
  `document` bigint DEFAULT NULL,
  `documenttag` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `utils_notification`
--

CREATE TABLE `utils_notification` (
  `id` char(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notification_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `read_at` datetime(6) DEFAULT NULL,
  `action_url` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expires_at` datetime(6) DEFAULT NULL,
  `icon` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loan_app_id` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `related_loan_id` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loan_id` char(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `action_required` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Whether this notification requires immediate action',
  `alert_data` json DEFAULT NULL COMMENT 'Additional alert data in JSON format'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `utils_notification`
--

INSERT INTO `utils_notification` (`id`, `notification_type`, `title`, `message`, `priority`, `created_at`, `read_at`, `action_url`, `expires_at`, `icon`, `user`, `user_id`, `loan_app_id`, `related_loan_id`, `loan_id`, `action_required`, `alert_data`) VALUES
('01dadd81ecdf45258ab0ad1d1a3af332', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by MARGARET WAMBUI KAMAU', 'medium', '2025-10-14 14:19:59.382035', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('02399575a5e74849b456e4d68466938a', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 59,066.67', 'medium', '2025-11-07 09:47:42.494174', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('02a53fd462a841de9dcbda2b85a5f023', 'payment_received', 'Payment Received', 'Your payment of KES 900.00 for loan LOAN-000053 has been received. Outstanding balance: KES 13,535.67', 'medium', '2025-11-17 21:01:05.338372', NULL, '/loans/bdff1ce1-8aeb-42b8-ba90-68421f2e73c1/', NULL, 'fa-money-bill', NULL, '346db61857324d05bf43bb69aa145d83', NULL, NULL, NULL, 0, '{}'),
('0967b7acf51b47cbb5b4b87e45d49bcb', 'payment_received', 'Payment Received', 'Your payment of KES 1.00 for loan LOAN-000026 has been received. Outstanding balance: KES 1,219.00', 'medium', '2025-11-05 08:59:04.334874', NULL, '/loans/fba983d3-53a2-4a72-8945-da7df2da0f29/', NULL, 'fa-money-bill', NULL, '8b1bce3d286744498fdbeb27fca0819c', NULL, NULL, NULL, 0, '{}'),
('0c05235ae8c943069d189a99e2474c68', 'payment_received', 'Payment Received', 'Your payment of KES 1,080.00 for loan LOAN-000016 has been received. Outstanding balance: KES 132,453.33', 'medium', '2025-11-19 10:29:48.080683', NULL, '/loans/089a2cef-c223-42f5-b036-3977291bcad0/', NULL, 'fa-money-bill', NULL, 'abf9e646f39b46acbc2b606adef31b77', NULL, NULL, NULL, 0, '{}'),
('0c3fd1d4c63a44d9964e805a02b3ae4e', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000048 has been received. Outstanding balance: KES 196,968.33', 'medium', '2025-11-13 12:42:30.936478', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('0f69a7d59d464987b3d71db8eb68874f', 'system_maintenance', 'New Imara Loan Application', 'A new Imara loan application has been submitted by TUK TUK KTWB500Y', 'medium', '2025-11-07 09:44:53.133000', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, '{}'),
('0fb3344bc0a54d458f3b1a029a44a81f', 'payment_received', 'Payment Received', 'Your payment of KES 1,000.00 for loan LOAN-000058 has been received. Outstanding balance: KES 15,630.00', 'medium', '2025-11-18 20:32:14.072398', NULL, '/loans/8d5796d4-95b4-4f56-b233-5a916aba06b1/', NULL, 'fa-money-bill', NULL, '2a75f8e73f4f4b41a4aa50094ecf81b3', NULL, NULL, NULL, 0, '{}'),
('138eb6b25c77437282c96a3995c2649b', 'payment_received', 'Payment Received', 'Your payment of KES 450.00 for loan LOAN-000062 has been received. Outstanding balance: KES 11,750.00', 'medium', '2025-11-19 12:37:27.906629', NULL, '/loans/a0e21f46-11f9-4b2c-bcdc-f403ecbb41ed/', NULL, 'fa-money-bill', NULL, '4996522235a247ce98d506ff09ab7e0b', NULL, NULL, NULL, 0, '{}'),
('1c42ade099b84a278a311f0c3bc2b8c9', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by HASSAN DIKO', 'medium', '2025-10-20 17:35:54.717963', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('1dc5dd5e50634d8492c9f9b88d9335c7', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by Phin Client', 'medium', '2025-11-10 14:39:42.630058', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, '{}'),
('200be8ea13774a6e97316e9228b36786', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by HARON GITAU MBAU', 'medium', '2025-09-25 09:46:05.873565', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('29a55f8b100349f7b82277a215652626', 'payment_received', 'Client Payment Received', 'DUNCAN MUGAMBI KITHINJI made a payment of KES 450.00 for loan LOAN-000062', 'low', '2025-11-19 12:37:27.909336', NULL, '/loans/a0e21f46-11f9-4b2c-bcdc-f403ecbb41ed/', NULL, 'fa-money-bill', NULL, 'ef87276bae7a4a2cbc72305a20e2916e', NULL, NULL, NULL, 0, '{}'),
('2ba50951371a46aaae39591a658602e9', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by KELVIN MURIITHI MAINA', 'medium', '2025-10-16 17:46:01.426716', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('2fa52baeae854eb19ba0a324dc33418a', 'payment_received', 'Payment Received', 'Your payment of KES 500.00 for loan LOAN-000018 has been received. Outstanding balance: KES 182,381.50', 'medium', '2025-11-18 22:02:15.071692', NULL, '/loans/b7b2e3eb-302a-4410-b0e0-929178ac3695/', NULL, 'fa-money-bill', NULL, '9971f8e9a0c948608b5df206ee289c22', NULL, NULL, NULL, 0, '{}'),
('30c7ef9fc4a84aceb9b1e2754d1a28b8', 'payment_received', 'Payment Received', 'Your payment of KES 535.00 for loan LOAN-000064 has been received. Outstanding balance: KES 183,145.00', 'medium', '2025-11-19 10:24:01.397007', NULL, '/loans/cfd3893d-f102-4937-ae0d-3980e85ec7a7/', NULL, 'fa-money-bill', NULL, '217788378274446995234310446f3c5a', NULL, NULL, NULL, 0, '{}'),
('332cb74384364078ac517d5f9eeecb14', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000055 has been received. Outstanding balance: KES 32,967.80', 'medium', '2025-11-18 23:17:26.779196', NULL, '/loans/faf4cf99-c260-48eb-a1c8-5e0e95767427/', NULL, 'fa-money-bill', NULL, 'ba88a11eb4074d7ca76e2e459f9ac07e', NULL, NULL, NULL, 0, '{}'),
('33771e8c34f345ca88c7496d5f6a8154', 'payment_received', 'Payment Received', 'Your payment of KES 540.00 for loan LOAN-000016 has been received. Outstanding balance: KES 134,613.33', 'medium', '2025-11-13 08:14:07.733663', NULL, '/loans/089a2cef-c223-42f5-b036-3977291bcad0/', NULL, 'fa-money-bill', NULL, 'abf9e646f39b46acbc2b606adef31b77', NULL, NULL, NULL, 0, '{}'),
('341ce8c36a254e22bbb1c9a34f18202f', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 57,666.67', 'medium', '2025-11-12 09:43:19.923382', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('367a5db358174e7f86c45822b217d1ad', 'payment_received', 'Client Payment Received', 'Phin Client made a payment of KES 1.00 for loan LOAN-000026', 'low', '2025-11-05 12:07:32.093773', NULL, '/loans/fba983d3-53a2-4a72-8945-da7df2da0f29/', NULL, 'fa-money-bill', NULL, '733e1e7a62274214a66b73afe62b4eff', NULL, NULL, NULL, 0, '{}'),
('381e7a39766649a09ea3a437cf6cecab', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by MARY NDUKU MUIRURI', 'medium', '2025-09-20 09:20:56.956869', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('3cc0b6fb530d401bb56bf9c7b2ae86d2', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by THOMAS NJOROGE WANYORO', 'medium', '2025-09-09 16:33:44.598571', '2025-09-10 08:25:18.660154', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('3e87ded998124707a7b585494c804081', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by PETER KIBUTHA KAMAU', 'medium', '2025-11-09 17:45:16.765655', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, '{}'),
('3fc127f277ec45a483e25efa1ee92c1a', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by STEPHEN KIAI MUGAMBI', 'medium', '2025-09-26 09:37:37.438586', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('425d3e45a25c4edf9a6953cf6bd5d5c7', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by william muguna mthare', 'medium', '2025-10-27 17:29:13.751819', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('42bfd622929c44c7af58d421a8f1d5b6', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000055 has been received. Outstanding balance: KES 37,167.80', 'medium', '2025-11-17 23:32:39.098724', NULL, '/loans/faf4cf99-c260-48eb-a1c8-5e0e95767427/', NULL, 'fa-money-bill', NULL, 'ba88a11eb4074d7ca76e2e459f9ac07e', NULL, NULL, NULL, 0, '{}'),
('4315f97749ef4e37bd633d5b6622fea8', 'system_maintenance', 'New Mwamba Loan Application', 'A new Mwamba loan application has been submitted by JOSEPH MURIGI GATHUA', 'medium', '2025-10-21 09:32:53.322149', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('4355d881118d4679bf55f86771ba06d2', 'payment_received', 'Payment Received', 'Your payment of KES 600.00 for loan LOAN-000048 has been received. Outstanding balance: KES 197,668.33', 'medium', '2025-11-11 22:16:00.469439', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('45fa15c5c7b2482abc369041ad416d09', 'system_maintenance', 'New Imara Loan Application', 'A new Imara loan application has been submitted by WILSON MAINA WAMUGUNDA', 'medium', '2025-09-25 08:49:04.899903', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('468c7368168a4eeeadeb8a81aeaf9d9d', 'system_maintenance', 'New Imara Loan Application', 'A new Imara loan application has been submitted by TITUS RIITHO WAIRURA', 'medium', '2025-09-25 10:49:44.225735', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('4906e1e5a4254d568d3a220dd6cc9b53', 'payment_received', 'Payment Received', 'Your payment of KES 1,070.00 for loan LOAN-000064 has been received. Outstanding balance: KES 181,005.00', 'medium', '2025-11-19 10:25:12.945108', NULL, '/loans/cfd3893d-f102-4937-ae0d-3980e85ec7a7/', NULL, 'fa-money-bill', NULL, '217788378274446995234310446f3c5a', NULL, NULL, NULL, 0, '{}'),
('4998e6a6c375452897ebebb9e9ce62bf', 'payment_received', 'Payment Received', 'Your payment of KES 535.00 for loan LOAN-000064 has been received. Outstanding balance: KES 184,215.00', 'medium', '2025-11-19 10:23:29.841965', NULL, '/loans/cfd3893d-f102-4937-ae0d-3980e85ec7a7/', NULL, 'fa-money-bill', NULL, '217788378274446995234310446f3c5a', NULL, NULL, NULL, 0, '{}'),
('4a0b0e9eb9c542189d2699a4914b9790', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 56,966.67', 'medium', '2025-11-13 09:44:58.775017', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('4b2c93a581d24f64b82a96cebf9294d1', 'payment_received', 'Payment Received', 'Your payment of KES 500.00 for loan LOAN-000018 has been received. Outstanding balance: KES 183,381.50', 'medium', '2025-11-14 22:00:35.402237', NULL, '/loans/b7b2e3eb-302a-4410-b0e0-929178ac3695/', NULL, 'fa-money-bill', NULL, '9971f8e9a0c948608b5df206ee289c22', NULL, NULL, NULL, 0, '{}'),
('4c1ccae6745f49aa83ba4e1ec3b7fd84', 'payment_received', 'Payment Received', 'Your payment of KES 800.00 for loan LOAN-000018 has been received. Outstanding balance: KES 184,781.50', 'medium', '2025-11-11 22:12:15.407063', NULL, '/loans/b7b2e3eb-302a-4410-b0e0-929178ac3695/', NULL, 'fa-money-bill', NULL, '9971f8e9a0c948608b5df206ee289c22', NULL, NULL, NULL, 0, '{}'),
('4cd9806f7bdc44758fd2ad10b52d86c5', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by JAMES CHEGE MWANGI', 'medium', '2025-09-05 08:06:51.276332', '2025-09-05 08:17:57.640652', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('4d758f2947cb4dadb261ed5acb06c38b', 'payment_received', 'Payment Received', 'Your payment of KES 563.00 for loan LOAN-000018 has been received. Outstanding balance: KES 185,881.50', 'medium', '2025-11-08 22:10:26.534797', NULL, '/loans/b7b2e3eb-302a-4410-b0e0-929178ac3695/', NULL, 'fa-money-bill', NULL, '9971f8e9a0c948608b5df206ee289c22', NULL, NULL, NULL, 0, '{}'),
('4f366b01e41e4606987952b379b50247', 'payment_received', 'Payment Received', 'Your payment of KES 200.00 for loan LOAN-000059 has been received. Outstanding balance: KES 21,629.46', 'medium', '2025-11-18 08:57:58.307463', NULL, '/loans/0ae916b5-da19-4a1e-89c2-4f91ed6d6378/', NULL, 'fa-money-bill', NULL, 'a4485033f8e94dc493781d9772e92140', NULL, NULL, NULL, 0, '{}'),
('4fd1adbde3994bb690ea3ce49d64a04a', 'payment_received', 'Payment Received', 'Your payment of KES 500.00 for loan LOAN-000018 has been received. Outstanding balance: KES 183,881.50', 'medium', '2025-11-13 21:51:16.250978', NULL, '/loans/b7b2e3eb-302a-4410-b0e0-929178ac3695/', NULL, 'fa-money-bill', NULL, '9971f8e9a0c948608b5df206ee289c22', NULL, NULL, NULL, 0, '{}'),
('5145c789f0bf4e77830b3efc48b76869', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by MARTIN GITONGA NTHIGA', 'medium', '2025-09-25 08:14:05.717096', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('57369c972155413e90c0cb79c0630d98', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by THATHI LAVUTA', 'medium', '2025-09-09 08:02:02.225260', '2025-09-09 08:27:52.938578', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('5b916197c8fe4c33ab052dfe8957dc24', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by HASSAN DIKO', 'medium', '2025-10-20 17:39:26.995798', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('5c74f2d787904d1b8b863b5bee93d614', 'system_maintenance', 'New Boost Loan', 'A new Boost loan has been recorded for FRANCIS KIARIE NJAMBI', 'medium', '2025-08-08 17:43:00.982110', '2025-08-14 01:00:40.013685', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('5ca655e0684643eba0dc2b72fdb3412a', 'payment_received', 'Payment Received', 'Your payment of KES 1,500.00 for loan LOAN-000048 has been received. Outstanding balance: KES 198,268.33', 'medium', '2025-11-09 20:53:23.368112', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('620cbc8748a54436844dcd781a7b5285', 'payment_received', 'Payment Received', 'Your payment of KES 500.00 for loan LOAN-000064 has been received. Outstanding balance: KES 184,750.00', 'medium', '2025-11-19 10:23:15.502213', NULL, '/loans/cfd3893d-f102-4937-ae0d-3980e85ec7a7/', NULL, 'fa-money-bill', NULL, '217788378274446995234310446f3c5a', NULL, NULL, NULL, 0, '{}'),
('62b76a836ad94ee5907ea8a8f211d9df', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000048 has been received. Outstanding balance: KES 194,118.33', 'medium', '2025-11-18 13:02:59.431191', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('64627e4befeb45338b93b124618c0dd4', 'payment_received', 'Payment Received', 'Your payment of KES 1,080.00 for loan LOAN-000028 has been received. Outstanding balance: KES 11,120.00', 'medium', '2025-11-08 08:42:32.201330', NULL, '/loans/06ae17ec-f08f-45a6-aaa7-7219dbd7a08e/', NULL, 'fa-money-bill', NULL, 'abf9e646f39b46acbc2b606adef31b77', NULL, NULL, NULL, 0, '{}'),
('64af0f216cdd43e283ae56d2d6b03825', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by HARON GITAU MBAU', 'medium', '2025-09-25 14:22:49.528498', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('6a8d93b7d8324c79848cfbf956fc4e23', 'payment_received', 'Payment Received', 'Your payment of KES 540.00 for loan LOAN-000016 has been received. Outstanding balance: KES 134,073.33', 'medium', '2025-11-15 13:13:41.151024', NULL, '/loans/089a2cef-c223-42f5-b036-3977291bcad0/', NULL, 'fa-money-bill', NULL, 'abf9e646f39b46acbc2b606adef31b77', NULL, NULL, NULL, 0, '{}'),
('6b2d4778d8fa4298a4bbdee5e9825c10', 'payment_received', 'Payment Received', 'Your payment of KES 540.00 for loan LOAN-000016 has been received. Outstanding balance: KES 133,533.33', 'medium', '2025-11-17 23:16:30.439160', NULL, '/loans/089a2cef-c223-42f5-b036-3977291bcad0/', NULL, 'fa-money-bill', NULL, 'abf9e646f39b46acbc2b606adef31b77', NULL, NULL, NULL, 0, '{}'),
('6fcdd185dad84e27804b7c66965d0469', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000048 has been received. Outstanding balance: KES 196,268.33', 'medium', '2025-11-16 09:50:59.209792', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('7083395165004b23aa806b2a07972eef', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by HASSAN DIKO', 'medium', '2025-10-17 12:00:12.853644', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('7425ec60fd18426e9b06976b1d90d009', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by DAVID KIBE GACHUGU', 'medium', '2025-10-09 09:40:57.051448', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('752315a615e74ee5b1460430b64cf0f4', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by SAMUEL GATHINJI KABUNYI', 'medium', '2025-09-25 15:10:39.376358', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('75b7fd29064d4ab4bfb56ba634233978', 'payment_received', 'Client Payment Received', 'PETER KIBUTHA KAMAU made a payment of KES 700.00 for loan LOAN-000055', 'low', '2025-11-17 23:32:39.101331', NULL, '/loans/faf4cf99-c260-48eb-a1c8-5e0e95767427/', NULL, 'fa-money-bill', NULL, 'ef87276bae7a4a2cbc72305a20e2916e', NULL, NULL, NULL, 0, '{}'),
('77d3daba73d543c68e174fe79bd498f1', 'payment_received', 'Client Payment Received', 'SIMON KURIA MWANGI made a payment of KES 900.00 for loan LOAN-000053', 'low', '2025-11-17 21:01:05.342310', NULL, '/loans/bdff1ce1-8aeb-42b8-ba90-68421f2e73c1/', NULL, 'fa-money-bill', NULL, 'ef87276bae7a4a2cbc72305a20e2916e', NULL, NULL, NULL, 0, '{}'),
('78e22531e799495fafe23f7434109f8e', 'payment_received', 'Payment Received', 'Your payment of KES 500.00 for loan LOAN-000018 has been received. Outstanding balance: KES 182,881.50', 'medium', '2025-11-16 21:12:37.244320', NULL, '/loans/b7b2e3eb-302a-4410-b0e0-929178ac3695/', NULL, 'fa-money-bill', NULL, '9971f8e9a0c948608b5df206ee289c22', NULL, NULL, NULL, 0, '{}'),
('7d395c9d85054dd0930d5b9fcc503470', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by JOSEPH KARIUKI KAMAU', 'medium', '2025-10-21 08:59:35.990994', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('7d5f955789e84324bdc9f626ad9f41a1', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by SIMON KURIA MWANGI', 'medium', '2025-09-24 07:41:51.397893', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('83afc0c2cc9049c9b0b9c0781515a0b7', 'system_maintenance', 'New Boost Loan', 'A new Boost loan has been recorded for GEOFREY MURIUKI NJERU', 'medium', '2025-08-07 08:19:11.262817', '2025-08-14 01:00:40.013685', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('840cf257875b4a4a945d0660d6227c79', 'payment_received', 'Payment Received', 'Your payment of KES 1,000.00 for loan LOAN-000058 has been received. Outstanding balance: KES 16,630.00', 'medium', '2025-11-17 21:15:04.431144', NULL, '/loans/8d5796d4-95b4-4f56-b233-5a916aba06b1/', NULL, 'fa-money-bill', NULL, '2a75f8e73f4f4b41a4aa50094ecf81b3', NULL, NULL, NULL, 0, '{}'),
('8476d9442ff24866bec263f26a5e6311', 'system_maintenance', 'New Imara Loan Application', 'A new Imara loan application has been submitted by JAMES NGUGI NJOROGE', 'medium', '2025-11-07 08:38:04.668397', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, '{}'),
('84f700633f8c4662a3d6a34ef8e3e906', 'system_maintenance', 'New Imara Loan Application', 'A new Imara loan application has been submitted by Phin Client', 'medium', '2025-10-02 03:17:29.657598', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('8a0100de897f41a4ae179d8b79e45c5b', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by Phin Client', 'medium', '2025-10-10 10:38:04.412881', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('8b1073be817e43618ecaa7c91533924c', 'payment_received', 'Payment Received', 'Your payment of KES 535.00 for loan LOAN-000064 has been received. Outstanding balance: KES 180,470.00', 'medium', '2025-11-19 10:26:11.243026', NULL, '/loans/cfd3893d-f102-4937-ae0d-3980e85ec7a7/', NULL, 'fa-money-bill', NULL, '217788378274446995234310446f3c5a', NULL, NULL, NULL, 0, '{}'),
('8bc116d0c012444cb639f9e54c01b782', 'payment_received', 'Payment Received', 'Your payment of KES 750.00 for loan LOAN-000048 has been received. Outstanding balance: KES 195,518.33', 'medium', '2025-11-16 13:21:41.204428', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('8da4982b662f441cb72270ac78af0b78', 'payment_received', 'Payment Received', 'Your payment of KES 535.00 for loan LOAN-000064 has been received. Outstanding balance: KES 182,610.00', 'medium', '2025-11-19 10:24:26.947130', NULL, '/loans/cfd3893d-f102-4937-ae0d-3980e85ec7a7/', NULL, 'fa-money-bill', NULL, '217788378274446995234310446f3c5a', NULL, NULL, NULL, 0, '{}'),
('8e8aebd822414f318779514bf43ce83b', 'payment_received', 'Client Payment Received', 'Phin Client made a payment of KES 1.00 for loan LOAN-000026', 'low', '2025-11-01 09:42:37.345134', NULL, '/loans/fba983d3-53a2-4a72-8945-da7df2da0f29/', NULL, 'fa-money-bill', NULL, '733e1e7a62274214a66b73afe62b4eff', NULL, NULL, NULL, 0, NULL),
('8eb42462120d4477b7646ab421f08fcb', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by SIMON KURIA MWANGI', 'medium', '2025-09-11 10:51:19.441601', '2025-09-11 13:28:17.293374', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('917e3282fbee447e899b6b22508eda53', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by SIMON KURIA MWANGI', 'medium', '2025-09-24 07:44:14.764079', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('9245390a3a6946c1b5dc0b8737f17e16', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by WAMBUA NDUNGE', 'medium', '2025-09-19 09:30:00.328757', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('96e176bbe58740848e5e9d8317209366', 'payment_received', 'Client Payment Received', 'HARON GITAU MBAU made a payment of KES 1,000.00 for loan LOAN-000058', 'low', '2025-11-18 20:32:14.076513', NULL, '/loans/8d5796d4-95b4-4f56-b233-5a916aba06b1/', NULL, 'fa-money-bill', NULL, 'ef87276bae7a4a2cbc72305a20e2916e', NULL, NULL, NULL, 0, '{}'),
('a21d11cf24734ea3b7b5fe77572479dc', 'payment_received', 'Payment Received', 'Your payment of KES 300.00 for loan LOAN-000018 has been received. Outstanding balance: KES 186,444.50', 'medium', '2025-11-07 22:12:51.083324', NULL, '/loans/b7b2e3eb-302a-4410-b0e0-929178ac3695/', NULL, 'fa-money-bill', NULL, '9971f8e9a0c948608b5df206ee289c22', NULL, NULL, NULL, 0, '{}'),
('a3c03db60a22448fb45d0806dbc71edf', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 58,366.67', 'medium', '2025-11-10 08:11:43.614896', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('a55a8701ca7a45f4964386b110342de1', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 56,266.67', 'medium', '2025-11-14 13:37:37.564956', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('a7dc9e99b9e4480d9f3f824a864b0fe7', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 55,566.67', 'medium', '2025-11-17 08:36:13.493764', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('aa95178793b24f0a9db514ea54f94ce4', 'payment_received', 'Payment Received', 'Your payment of KES 540.00 for loan LOAN-000059 has been received. Outstanding balance: KES 11,660.00', 'medium', '2025-11-13 06:40:17.910241', NULL, '/loans/84b9b80a-75fb-448a-a6c1-4222be8c15c8/', NULL, 'fa-money-bill', NULL, 'abf9e646f39b46acbc2b606adef31b77', NULL, NULL, NULL, 0, '{}'),
('abb01183d0cb4515bc728dc34806b6ed', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by ERICK MUTUKU KIOKO', 'medium', '2025-10-27 12:54:07.293278', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('ac1aa973ad8b45818ac5e0a6f293360b', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by SIMON KURIA MWANGI', 'medium', '2025-10-01 07:59:47.231055', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('ac4ad6e5ea1b4ce0855de029d383b64c', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000048 has been received. Outstanding balance: KES 194,818.33', 'medium', '2025-11-17 08:44:59.598834', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('ad37a38a35414c4abfb416824265c3d2', 'payment_received', 'Payment Received', 'Your payment of KES 400.00 for loan LOAN-000018 has been received. Outstanding balance: KES 184,381.50', 'medium', '2025-11-12 22:14:02.276413', NULL, '/loans/b7b2e3eb-302a-4410-b0e0-929178ac3695/', NULL, 'fa-money-bill', NULL, '9971f8e9a0c948608b5df206ee289c22', NULL, NULL, NULL, 0, '{}'),
('afee6c1b56c64cfabe22166cf0b01104', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by Phin Client', 'medium', '2025-10-08 06:25:06.322219', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('b037bd706a574d25993d7b71dc78ab02', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 61,466.67', 'medium', '2025-11-07 09:45:59.169923', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('b2f78aadd3394bbe9e92f59104ece61b', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by JOHN MWANGI KAMAU', 'medium', '2025-09-11 08:13:01.924924', '2025-09-11 08:15:01.354113', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('b98504e8f7c14cd7bc5b19fa1d9a96e0', 'payment_received', 'Payment Received', 'Your payment of KES 300.00 for loan LOAN-000052 has been received. Outstanding balance: KES 59,766.67', 'medium', '2025-11-07 09:47:05.076186', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('ba00eea43b3346d5bc64ca0c32a740e7', 'payment_received', 'Payment Received', 'Your payment of KES 1.00 for loan LOAN-000026 has been received. Outstanding balance: KES 1,220.00', 'medium', '2025-10-08 07:03:46.674347', NULL, '/loans/fba983d3-53a2-4a72-8945-da7df2da0f29/', NULL, 'fa-money-bill', NULL, '8b1bce3d286744498fdbeb27fca0819c', NULL, NULL, NULL, 0, NULL),
('bf0957e9859c499ba60cd71ea611bbdb', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by WAMBUA NDUNGE', 'medium', '2025-09-19 09:32:18.761405', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('c10f17cd653f40eca90d8ef0d63cef68', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000048 has been received. Outstanding balance: KES 191,518.33', 'medium', '2025-11-19 17:06:46.249835', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('c16c9a0c13694cbc9f19287ef4831894', 'payment_received', 'Payment Received', 'Your payment of KES 1.00 for loan LOAN-000026 has been received. Outstanding balance: KES 1,218.00', 'medium', '2025-11-05 12:07:32.087603', NULL, '/loans/fba983d3-53a2-4a72-8945-da7df2da0f29/', NULL, 'fa-money-bill', NULL, '8b1bce3d286744498fdbeb27fca0819c', NULL, NULL, NULL, 0, '{}'),
('c1e8ba2846294c7fa83fbf35b6f248cc', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by FRANCIS KIARIE NJAMBI', 'medium', '2025-09-16 07:35:05.304349', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('c3c5d8e1ad0c4cce8a0be4046616297e', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 60,766.67', 'medium', '2025-11-07 09:46:20.043668', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('c3eb8a7653424b3db552d9e8d00a8fee', 'payment_received', 'Payment Received', 'Your payment of KES 535.00 for loan LOAN-000064 has been received. Outstanding balance: KES 183,680.00', 'medium', '2025-11-19 10:23:43.786501', NULL, '/loans/cfd3893d-f102-4937-ae0d-3980e85ec7a7/', NULL, 'fa-money-bill', NULL, '217788378274446995234310446f3c5a', NULL, NULL, NULL, 0, '{}'),
('c5252f6c75914334b7c32cb9c01d17a8', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by PETER WAWERU NJIRAINI', 'medium', '2025-09-26 09:08:30.727669', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('c82ca5d3b444452aa68869c733f6357c', 'payment_received', 'Client Payment Received', 'PETER KIBUTHA KAMAU made a payment of KES 700.00 for loan LOAN-000055', 'low', '2025-11-18 23:17:26.782223', NULL, '/loans/faf4cf99-c260-48eb-a1c8-5e0e95767427/', NULL, 'fa-money-bill', NULL, 'ef87276bae7a4a2cbc72305a20e2916e', NULL, NULL, NULL, 0, '{}'),
('c9d6c48ad259430fae3975e0c25711b1', 'system_maintenance', 'New Boost Loan', 'A new Boost loan has been recorded for WEBSTAR MANYARA OMWERI', 'medium', '2025-08-05 09:48:52.317643', '2025-08-14 01:00:40.013685', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('ce843e4cbd9b4beaa0fd45140649db1d', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by GEOFREY MURIUKI NJERU', 'medium', '2025-10-10 18:14:42.640166', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('d2b42b40e73740d7928854f44af7e1f5', 'payment_received', 'Client Payment Received', 'Phin Client made a payment of KES 1.00 for loan LOAN-000026', 'low', '2025-11-05 08:59:04.338370', NULL, '/loans/fba983d3-53a2-4a72-8945-da7df2da0f29/', NULL, 'fa-money-bill', NULL, '733e1e7a62274214a66b73afe62b4eff', NULL, NULL, NULL, 0, '{}'),
('d44586b84aa64509bb82b1eefacd0d0e', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000048 has been received. Outstanding balance: KES 192,218.33', 'medium', '2025-11-19 10:28:48.891122', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('d4d13b45a1424c2eb8af705bf3c20db7', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 54,866.67', 'medium', '2025-11-19 08:54:38.875473', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('d563ab8407284fd084895601767c7a5a', 'payment_received', 'Client Payment Received', 'HARON GITAU MBAU made a payment of KES 1,000.00 for loan LOAN-000058', 'low', '2025-11-17 21:15:04.434050', NULL, '/loans/8d5796d4-95b4-4f56-b233-5a916aba06b1/', NULL, 'fa-money-bill', NULL, 'ef87276bae7a4a2cbc72305a20e2916e', NULL, NULL, NULL, 0, '{}'),
('d756c7db9f934d139e814baf2cf8631f', 'payment_received', 'Payment Received', 'Your payment of KES 1.00 for loan LOAN-000026 has been received. Outstanding balance: KES 1,220.00', 'medium', '2025-11-01 09:42:37.339492', NULL, '/loans/fba983d3-53a2-4a72-8945-da7df2da0f29/', NULL, 'fa-money-bill', NULL, '8b1bce3d286744498fdbeb27fca0819c', NULL, NULL, NULL, 0, NULL),
('d7826ee60f3d4f66a0cfc5d44a299611', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by FAITH MWENDE NZAU', 'medium', '2025-10-27 13:57:28.249854', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('d79a96f46d564c12932392b356e8fa55', 'payment_received', 'Payment Received', 'Your payment of KES 1,200.00 for loan LOAN-000048 has been received. Outstanding balance: KES 192,918.33', 'medium', '2025-11-19 10:28:23.748876', NULL, '/loans/175224a8-5e87-4ef1-81b5-196f46ab537a/', NULL, 'fa-money-bill', NULL, 'd88abf0a9c7b4014af792dce366e827d', NULL, NULL, NULL, 0, '{}'),
('dc5e6e9a815b4cdf911e572eeeef9b27', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by KELVIN MURIITHI MAINA', 'medium', '2025-09-20 21:38:04.594168', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('dd9ebf1816d644da8c9c7f9eb2c33036', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by WAMBUA NDUNGE', 'medium', '2025-09-25 12:30:29.015959', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('de344e3973234c85bde019472ec73305', 'payment_received', 'Payment Received', 'Your payment of KES 535.00 for loan LOAN-000064 has been received. Outstanding balance: KES 182,075.00', 'medium', '2025-11-19 10:24:47.120710', NULL, '/loans/cfd3893d-f102-4937-ae0d-3980e85ec7a7/', NULL, 'fa-money-bill', NULL, '217788378274446995234310446f3c5a', NULL, NULL, NULL, 0, '{}'),
('df16ab408daa4531824d5713c2806306', 'payment_received', 'Payment Received', 'Your payment of KES 300.00 for loan LOAN-000015 has been received. Outstanding balance: KES 11,864.00', 'medium', '2025-11-18 22:48:15.812364', NULL, '/loans/3a3e8016-5318-459d-b868-4afb0803592e/', NULL, 'fa-money-bill', NULL, 'b4f282b1904945a89f7eec9ae8135aa4', NULL, NULL, NULL, 0, '{}'),
('dfdc1784870643548ab3b6a9bc967473', 'payment_received', 'Payment Received', 'Your payment of KES 700.00 for loan LOAN-000052 has been received. Outstanding balance: KES 60,066.67', 'medium', '2025-11-07 09:46:47.901528', NULL, '/loans/1e14794c-ca07-4c8f-9eed-15b52b2fc21b/', NULL, 'fa-money-bill', NULL, '417bed4993224a689253689fd86a2d1a', NULL, NULL, NULL, 0, '{}'),
('e197dc93862a4426a0b4afa285149917', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by DAVID KIBE GACHUGU', 'medium', '2025-10-10 16:59:19.867973', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('e52c2e3af59340f0ab3e960f8e528e81', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by Phin Client', 'medium', '2025-10-10 10:32:11.393896', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('e5f9f255b4764716b515e4726f471fe7', 'payment_received', 'Payment Received', 'Your payment of KES 300.00 for loan LOAN-000018 has been received. Outstanding balance: KES 185,581.50', 'medium', '2025-11-09 22:11:54.078558', NULL, '/loans/b7b2e3eb-302a-4410-b0e0-929178ac3695/', NULL, 'fa-money-bill', NULL, '9971f8e9a0c948608b5df206ee289c22', NULL, NULL, NULL, 0, '{}'),
('e8730c01e3e740988ef6474b91accebb', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by WILSON MAINA WAMUGUNDA', 'medium', '2025-10-09 07:34:31.387219', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('eabf79eab58d4915876223a9177605f1', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by JOYCE NJERI KURIA', 'medium', '2025-09-24 08:57:52.519490', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('ed07b3715313417c9c4da91031c89d73', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by Phin Client', 'medium', '2025-10-10 14:04:45.636033', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('ed67e64e7e0d4187bdb828bb2887ba20', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by Phin Client', 'medium', '2025-10-10 10:36:50.103160', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('f043924f5af74310873b8f027435f406', 'system_maintenance', 'New Boost Loan Application', 'A new Boost loan application has been submitted by ALICE WANJIKU', 'medium', '2025-09-29 07:49:57.701959', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('f20c4d796a0345649663f971976e6c2b', 'payment_received', 'Payment Received', 'Your payment of KES 535.00 for loan LOAN-000064 has been received. Outstanding balance: KES 179,935.00', 'medium', '2025-11-19 10:29:17.057150', NULL, '/loans/cfd3893d-f102-4937-ae0d-3980e85ec7a7/', NULL, 'fa-money-bill', NULL, '217788378274446995234310446f3c5a', NULL, NULL, NULL, 0, '{}'),
('f75965aaa2f945cf84ab28d3ea277437', 'system_maintenance', 'New Boost Loan', 'A new Boost loan has been recorded for STEPHEN KURIA MWANGI', 'medium', '2025-08-20 18:24:33.927041', '2025-08-22 08:40:57.512453', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('f7c59f8160454302b9ad773a700eb20c', 'payment_received', 'Client Payment Received', 'MARTIN GITONGA NTHIGA made a payment of KES 300.00 for loan LOAN-000015', 'low', '2025-11-18 22:48:15.817578', NULL, '/loans/3a3e8016-5318-459d-b868-4afb0803592e/', NULL, 'fa-money-bill', NULL, 'ef87276bae7a4a2cbc72305a20e2916e', NULL, NULL, NULL, 0, '{}'),
('f91744eb2b2b45198fe035d2a08fb341', 'system_maintenance', 'New Boost Plus Loan Application', 'A new Boost Plus loan application has been submitted by FRANCIS KIARIE NJAMBI', 'medium', '2025-09-16 07:37:14.784071', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL),
('f9ff0570d38a484198d8efcbba67b402', 'system_maintenance', 'New Imara Loan Application', 'A new Imara loan application has been submitted by Phin Client', 'medium', '2025-09-16 05:02:10.486484', '2025-11-10 23:24:55.054025', NULL, NULL, 'fa-bell', NULL, NULL, NULL, NULL, NULL, 0, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `utils_systemsetting`
--

CREATE TABLE `utils_systemsetting` (
  `id` bigint NOT NULL,
  `key` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci,
  `is_public` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `utils_systemsetting`
--

INSERT INTO `utils_systemsetting` (`id`, `key`, `value`, `category`, `description`, `is_public`, `created_at`, `updated_at`) VALUES
(1, 'max_loan_amount', '500000', 'loan', 'Maximum loan amount allowed', 1, '2025-07-31 23:24:09.122319', '2025-07-31 23:24:09.122343'),
(2, 'min_loan_amount', '1000', 'loan', 'Minimum loan amount allowed', 1, '2025-07-31 23:24:09.123613', '2025-07-31 23:24:09.123624'),
(3, 'default_interest_rate', '15.0', 'loan', 'Default interest rate percentage', 1, '2025-07-31 23:24:09.125100', '2025-07-31 23:24:09.125111'),
(4, 'processing_fee_percentage', '3.0', 'loan', 'Processing fee percentage', 1, '2025-07-31 23:24:09.126223', '2025-07-31 23:24:09.126233'),
(5, 'late_payment_penalty', '0.0', 'loan', 'Late payment penalty percentage', 1, '2025-07-31 23:24:09.127283', '2025-10-10 18:33:08.981206'),
(8, 'session_timeout_minutes', '60', 'system', 'Session timeout in minutes', 1, '2025-07-31 23:24:09.130505', '2025-07-31 23:24:09.130514'),
(9, 'max_login_attempts', '5', 'system', 'Maximum login attempts before lockout', 1, '2025-07-31 23:24:09.131554', '2025-07-31 23:24:09.131563'),
(10, 'email_notifications_enabled', 'true', 'notification', 'Enable email notifications', 1, '2025-07-31 23:24:09.132809', '2025-07-31 23:24:09.132822'),
(11, 'sms_notifications_enabled', 'true', 'notification', 'Enable SMS notifications', 1, '2025-07-31 23:24:09.133943', '2025-07-31 23:24:09.133953'),
(12, 'push_notifications_enabled', 'false', 'notification', 'Enable push notifications', 1, '2025-07-31 23:24:09.135017', '2025-07-31 23:24:09.135026'),
(13, 'boost_duration_months', '1', 'loan', 'Boost loan duration in months', 1, '2025-08-01 01:20:59.632571', '2025-08-11 11:45:48.873685'),
(14, 'boost_interest_rate', '20.0', 'loan', 'Boost monthly interest rate (%)', 1, '2025-08-01 01:20:59.633738', '2025-08-11 11:45:48.874866'),
(15, 'boost_processing_fee', '2.0', 'loan', 'Boost processing fee (%)', 1, '2025-08-01 01:20:59.634831', '2025-09-09 23:01:18.831213'),
(16, 'boost_repayment_methods', '[\"daily\", \"weekly\", \"monthly\"]', 'loan', 'Boost available repayment methods', 1, '2025-08-01 01:20:59.635973', '2025-08-11 11:45:48.877021'),
(17, 'boost_min_amount', '1000', 'loan', 'Boost minimum loan amount', 1, '2025-08-01 01:20:59.637068', '2025-08-11 11:45:48.878087'),
(18, 'boost_max_amount', '50000', 'loan', 'Boost maximum loan amount', 1, '2025-08-01 01:20:59.638193', '2025-08-11 11:45:48.879153'),
(19, 'mwamba_duration_months', '3', 'loan', 'Mwamba loan duration in months', 1, '2025-08-01 01:20:59.639299', '2025-08-11 11:45:48.883396'),
(20, 'mwamba_interest_rate', '10.0', 'loan', 'Mwamba monthly interest rate (%)', 1, '2025-08-01 01:20:59.640418', '2025-09-09 08:44:23.584361'),
(21, 'mwamba_processing_fee', '5.0', 'loan', 'Mwamba processing fee (%)', 1, '2025-08-01 01:20:59.641467', '2025-08-11 11:45:48.885533'),
(22, 'mwamba_repayment_methods', '[\"weekly\", \"monthly\"]', 'loan', 'Mwamba available repayment methods', 1, '2025-08-01 01:20:59.642530', '2025-08-11 11:45:48.886581'),
(23, 'mwamba_min_amount', '20000.0', 'loan', 'Mwamba minimum loan amount', 1, '2025-08-01 01:20:59.643604', '2025-09-29 07:44:33.594341'),
(24, 'mwamba_max_amount', '250000.0', 'loan', 'Mwamba maximum loan amount', 1, '2025-08-01 01:20:59.644674', '2025-09-19 07:41:23.818523'),
(25, 'imara_duration_months', '6', 'loan', 'Imara loan duration in months', 1, '2025-08-01 01:20:59.645767', '2025-08-11 11:45:48.892965'),
(26, 'imara_interest_rate', '2.0', 'loan', 'Imara monthly interest rate (%)', 1, '2025-08-01 01:20:59.646882', '2025-09-25 08:40:17.853406'),
(27, 'imara_processing_fee', '0.0', 'loan', 'Imara processing fee (%)', 1, '2025-08-01 01:20:59.648021', '2025-09-25 08:40:41.796168'),
(28, 'imara_repayment_methods', '[\"monthly\"]', 'loan', 'Imara available repayment methods', 1, '2025-08-01 01:20:59.649139', '2025-08-11 11:45:48.896147'),
(29, 'imara_min_amount', '5000.0', 'loan', 'Imara minimum loan amount', 1, '2025-08-01 01:20:59.650260', '2025-09-25 08:40:27.759639'),
(30, 'imara_max_amount', '500000', 'loan', 'Imara maximum loan amount', 1, '2025-08-01 01:20:59.651322', '2025-08-11 11:45:48.898274'),
(31, 'max_file_size_mb', '10', 'document', 'Maximum file upload size in MB', 1, '2025-08-01 02:20:39.786676', '2025-08-01 02:20:39.786715'),
(32, 'allowed_file_types', '.pdf,.doc,.docx,.jpg,.jpeg,.png', 'document', 'Allowed file types for uploads', 1, '2025-08-01 02:20:39.788337', '2025-08-11 08:25:39.548190'),
(33, 'require_kyc_documents', 'true', 'document', 'Whether KYC documents are required', 1, '2025-08-01 02:20:39.793414', '2025-08-01 02:20:39.793435'),
(34, 'auto_approval_min_score', '80', 'loan', 'Minimum credit score for auto-approval', 1, '2025-08-03 04:29:46.026033', '2025-08-03 04:29:46.026045'),
(35, 'auto_approval_max_amount', '25000', 'loan', 'Maximum amount for auto-approval', 1, '2025-08-03 04:29:46.027122', '2025-08-03 04:29:46.027132'),
(36, 'rollover_fee_percentage', '10.0', 'loan', 'Default rollover fee percentage', 1, '2025-08-04 04:12:56.802441', '2025-08-04 04:12:56.802457'),
(37, 'max_rollover_count', '3', 'loan', 'Maximum number of rollovers allowed', 1, '2025-08-04 04:12:56.803529', '2025-08-04 04:12:56.803539'),
(38, 'max_rollover_days', '30', 'loan', 'Maximum days for rollover extension', 1, '2025-08-04 04:12:56.804508', '2025-08-04 04:12:56.804517'),
(39, 'rollover_approval_required', 'true', 'loan', 'Whether rollovers require manual approval', 1, '2025-08-04 04:12:56.805699', '2025-08-04 04:12:56.805718'),
(40, 'boost_rollover_fee', '10.0', 'loan', 'Boost rollover fee percentage', 1, '2025-08-04 04:12:57.031836', '2025-08-11 11:45:48.880208'),
(41, 'boost_max_rollovers', '3', 'loan', 'Maximum number of rollovers for Boost', 1, '2025-08-04 04:12:57.032975', '2025-08-11 11:45:48.881262'),
(42, 'boost_rollover_days', '30', 'loan', 'Maximum rollover days for Boost', 1, '2025-08-04 04:12:57.034106', '2025-08-11 11:45:48.882327'),
(43, 'mwamba_rollover_fee', '10.0', 'loan', 'Mwamba rollover fee percentage', 1, '2025-08-04 04:12:57.041629', '2025-08-11 11:45:48.889776'),
(44, 'mwamba_max_rollovers', '2', 'loan', 'Maximum number of rollovers for Mwamba', 1, '2025-08-04 04:12:57.042789', '2025-08-11 11:45:48.890843'),
(45, 'mwamba_rollover_days', '90', 'loan', 'Maximum rollover days for Mwamba', 1, '2025-08-04 04:12:57.043854', '2025-08-11 11:45:48.891926'),
(46, 'imara_rollover_fee', '10.0', 'loan', 'Imara rollover fee percentage', 1, '2025-08-04 04:12:57.051375', '2025-08-11 11:45:48.899338'),
(47, 'imara_max_rollovers', '1', 'loan', 'Maximum number of rollovers for Imara', 1, '2025-08-04 04:12:57.052488', '2025-08-11 11:45:48.900407'),
(48, 'imara_rollover_days', '180', 'loan', 'Maximum rollover days for Imara', 1, '2025-08-04 04:12:57.053600', '2025-08-11 11:45:48.901482'),
(49, 'user_registration_enabled', 'true', 'user_management', 'Allow new user registration', 1, '2025-09-01 06:16:52.215712', '2025-09-01 06:16:52.215730'),
(50, 'user_email_verification_required', 'true', 'user_management', 'Require email verification for new users', 1, '2025-09-01 06:16:52.216851', '2025-09-01 06:16:52.216862'),
(51, 'user_phone_verification_required', 'true', 'user_management', 'Require phone verification for new users', 1, '2025-09-01 06:16:52.217772', '2025-09-01 06:16:52.217781'),
(52, 'user_profile_image_enabled', 'true', 'user_management', 'Enable profile image uploads', 1, '2025-09-01 06:16:52.218646', '2025-09-01 06:16:52.218655'),
(53, 'user_profile_image_max_size', '5', 'user_management', 'Maximum profile image size in MB', 1, '2025-09-01 06:16:52.219524', '2025-09-01 06:16:52.219533'),
(54, 'user_session_timeout', '3600', 'user_management', 'User session timeout in seconds', 1, '2025-09-01 06:16:52.220415', '2025-09-01 06:16:52.220424'),
(55, 'user_password_reset_enabled', 'true', 'user_management', 'Enable password reset functionality', 1, '2025-09-01 06:16:52.221276', '2025-09-01 06:16:52.221284'),
(56, 'user_account_lockout_enabled', 'true', 'user_management', 'Enable account lockout after failed attempts', 1, '2025-09-01 06:16:52.222157', '2025-09-01 06:16:52.222165'),
(57, 'user_max_login_attempts', '5', 'user_management', 'Maximum login attempts before lockout', 1, '2025-09-01 06:16:52.223053', '2025-09-01 06:16:52.223062'),
(58, 'user_lockout_duration', '1800', 'user_management', 'Account lockout duration in seconds', 1, '2025-09-01 06:16:52.223936', '2025-09-01 06:16:52.223944'),
(59, 'staff_dashboard_enabled', 'true', 'staff_management', 'Enable staff dashboard', 1, '2025-09-01 06:16:52.226197', '2025-09-01 06:16:52.226206'),
(60, 'staff_profile_management', 'true', 'staff_management', 'Allow staff profile management', 1, '2025-09-01 06:16:52.227101', '2025-09-01 06:16:52.227110'),
(61, 'staff_permission_inheritance', 'true', 'staff_management', 'Enable permission inheritance', 1, '2025-09-01 06:16:52.227986', '2025-09-01 06:16:52.227994'),
(62, 'staff_activity_logging', 'true', 'staff_management', 'Log staff activities', 1, '2025-09-01 06:16:52.228855', '2025-09-01 06:16:52.228863'),
(63, 'staff_performance_tracking', 'true', 'staff_management', 'Track staff performance', 1, '2025-09-01 06:16:52.229704', '2025-09-01 06:16:52.229712'),
(64, 'staff_workload_balancing', 'true', 'staff_management', 'Enable workload balancing', 1, '2025-09-01 06:16:52.230585', '2025-09-01 06:16:52.230593'),
(65, 'staff_notification_system', 'true', 'staff_management', 'Enable staff notifications', 1, '2025-09-01 06:16:52.231454', '2025-09-01 06:16:52.231462'),
(66, 'staff_reporting_enabled', 'true', 'staff_management', 'Enable staff reporting', 1, '2025-09-01 06:16:52.232313', '2025-09-01 06:16:52.232321'),
(67, 'boost_plus_interest_rate', '20.0', 'loan', 'Boost Plus monthly interest rate (%)', 1, '2025-09-09 23:18:47.364186', '2025-10-07 14:39:53.902777'),
(68, 'boost_plus_processing_fee', '2.0', 'loan', 'Boost Plus processing fee (%) - charged monthly', 1, '2025-09-09 23:18:47.366029', '2025-10-14 14:52:28.981268'),
(69, 'boost_late_payment_penalty', '0.0', 'loan', 'Monthly penalty rate for boost loans (percentage)', 1, '2025-09-09 23:18:47.367632', '2025-10-14 09:09:40.499401'),
(70, 'boost_plus_late_payment_penalty', '0.0', 'loan', 'Monthly penalty rate for boost_plus loans (percentage)', 1, '2025-09-09 23:18:47.369180', '2025-10-10 19:42:18.061278'),
(71, 'mwamba_late_payment_penalty', '0.0', 'loan', 'Monthly penalty rate for mwamba loans (percentage)', 1, '2025-09-09 23:18:47.370657', '2025-10-14 09:09:53.996076'),
(72, 'imara_late_payment_penalty', '20.0', 'loan', 'Monthly penalty rate for imara loans (percentage)', 1, '2025-09-09 23:18:47.372137', '2025-09-25 08:41:05.663633'),
(73, 'boost_plus_min_amount', '1000', 'loan', 'Boost Plus minimum loan amount', 1, '2025-09-09 23:22:47.916158', '2025-10-07 14:39:53.905098'),
(74, 'boost_plus_max_amount', '50000', 'loan', 'Boost Plus maximum loan amount', 1, '2025-09-09 23:22:47.917462', '2025-10-07 14:39:53.906166'),
(75, 'enable_email_reports', 'True', 'system', 'Enable automated email reports', 0, '2025-09-09 23:22:47.918688', '2025-09-22 04:06:20.560481'),
(76, 'track_customer_behavior', 'True', 'system', 'Enable customer behavior tracking for analytics', 0, '2025-09-09 23:22:47.919937', '2025-09-22 04:06:20.561405'),
(77, 'enable_advanced_analytics', 'True', 'system', 'Enable advanced analytics features', 0, '2025-09-09 23:22:47.921138', '2025-09-22 04:06:20.562279'),
(78, 'imara_min_duration', '30', 'loan', 'Minimum duration in days for Imara loans', 1, '2025-09-16 04:53:59.174810', '2025-09-22 04:06:20.563180'),
(79, 'imara_max_duration', '3650', 'loan', 'Maximum duration in days for Imara loans', 1, '2025-09-16 04:53:59.176246', '2025-09-22 04:06:20.564065'),
(80, 'imara_default_duration', '90', 'loan', 'Default duration in days for Imara loans', 1, '2025-09-16 04:53:59.177605', '2025-09-22 04:06:20.564953'),
(81, 'boost_plus_max_duration', '90', 'loan', 'Boost Plus maximum duration in days', 1, '2025-10-07 14:39:53.899905', '2025-10-07 14:39:53.899917'),
(82, 'boost_plus_available_durations', '[30, 60, 90]', 'loan', 'Boost Plus available duration options in days', 1, '2025-10-07 14:39:53.901603', '2025-10-07 14:39:53.901613'),
(83, 'boost_plus_repayment_methods', '[\"daily\", \"weekly\", \"monthly\"]', 'loan', 'Boost Plus available repayment methods', 1, '2025-10-07 14:39:53.907339', '2025-10-07 14:39:53.907347');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `auth_group`
--
ALTER TABLE `auth_group`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`);

--
-- Indexes for table `auth_group_permissions`
--
ALTER TABLE `auth_group_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `auth_group_permissions_group_id_permission_id_0cd325b0_uniq` (`group_id`,`permission_id`),
  ADD KEY `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` (`permission_id`);

--
-- Indexes for table `auth_permission`
--
ALTER TABLE `auth_permission`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id`,`codename`);

--
-- Indexes for table `cache_table`
--
ALTER TABLE `cache_table`
  ADD PRIMARY KEY (`cache_key`),
  ADD KEY `cache_table_expires` (`expires`);

--
-- Indexes for table `customer_requests`
--
ALTER TABLE `customer_requests`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `request_number` (`request_number`),
  ADD KEY `customer_requests_customer_id_idx` (`customer_id`),
  ADD KEY `customer_requests_status_idx` (`status`),
  ADD KEY `customer_requests_created_at_idx` (`created_at`);

--
-- Indexes for table `default_role_permissions`
--
ALTER TABLE `default_role_permissions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `django_admin_log`
--
ALTER TABLE `django_admin_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `django_admin_log_content_type_id_c4bce8eb_fk_django_co` (`content_type_id`),
  ADD KEY `django_admin_log_user_id_c564eba6_fk_users_id` (`user_id`);

--
-- Indexes for table `django_content_type`
--
ALTER TABLE `django_content_type`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `django_content_type_app_label_model_76bd3d3b_uniq` (`app_label`,`model`);

--
-- Indexes for table `django_migrations`
--
ALTER TABLE `django_migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `django_session`
--
ALTER TABLE `django_session`
  ADD PRIMARY KEY (`session_key`),
  ADD KEY `django_session_expire_date_a5c62663` (`expire_date`);

--
-- Indexes for table `document_templates`
--
ALTER TABLE `document_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `email_templates`
--
ALTER TABLE `email_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `generated_reports`
--
ALTER TABLE `generated_reports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `generated_reports_generated_by_id_9393ec13_fk_users_id` (`generated_by_id`);

--
-- Indexes for table `loans`
--
ALTER TABLE `loans`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `loan_number` (`loan_number`),
  ADD UNIQUE KEY `application_id` (`application`),
  ADD KEY `loans_borrower_id_aaffb8a4_fk_users_id` (`borrower`),
  ADD KEY `loans_original_loan_id_5b15332d_fk_loans_id` (`original_loan`),
  ADD KEY `idx_loans_borrower` (`borrower_id`),
  ADD KEY `idx_loans_status` (`status`),
  ADD KEY `idx_loans_is_deleted` (`is_deleted`),
  ADD KEY `idx_loans_deleted_by` (`deleted_by_id`),
  ADD KEY `idx_loans_original_loan` (`original_loan_id`);

--
-- Indexes for table `loans_loan`
--
ALTER TABLE `loans_loan`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `loan_number` (`loan_number`),
  ADD KEY `loans_loan_borrower_id` (`borrower_id`),
  ADD KEY `loans_loan_loan_product_id` (`loan_product_id`),
  ADD KEY `loans_loan_approved_by_id` (`approved_by_id`),
  ADD KEY `loans_loan_disbursed_by_id` (`disbursed_by_id`),
  ADD KEY `loans_loan_deleted_by_id` (`deleted_by_id`);

--
-- Indexes for table `loans_loanapplication`
--
ALTER TABLE `loans_loanapplication`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `application_number` (`application_number`);

--
-- Indexes for table `loans_loanproduct`
--
ALTER TABLE `loans_loanproduct`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `loans_repayment`
--
ALTER TABLE `loans_repayment`
  ADD PRIMARY KEY (`id`),
  ADD KEY `loans_repayment_loan_id` (`loan_id`),
  ADD KEY `loans_repayment_recorded_by_id` (`recorded_by_id`),
  ADD KEY `loans_repayment_mpesa_transaction_id` (`mpesa_transaction_id`);

--
-- Indexes for table `loan_applications`
--
ALTER TABLE `loan_applications`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `application_number` (`application_number`),
  ADD KEY `loan_applications_borrower_id_80b5f00e_fk_users_id` (`borrower`),
  ADD KEY `loan_applications_reviewed_by_id_761723e9_fk_users_id` (`reviewed_by`),
  ADD KEY `loan_applications_loan_product_id_46294b99_fk_loan_products_id` (`loan_product`),
  ADD KEY `idx_loan_app_status` (`status`);

--
-- Indexes for table `loan_products`
--
ALTER TABLE `loan_products`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `product_code` (`product_code`);

--
-- Indexes for table `loan_scoring`
--
ALTER TABLE `loan_scoring`
  ADD PRIMARY KEY (`id`),
  ADD KEY `loan_scoring_user_id_c41ac245_fk_users_id` (`user`),
  ADD KEY `idx_loan_scoring_user_id` (`user_id`),
  ADD KEY `idx_loan_scoring_user` (`user_id`);

--
-- Indexes for table `loan_statements`
--
ALTER TABLE `loan_statements`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `statement_number` (`statement_number`),
  ADD KEY `loan_statements_borrower_id_b430163b_fk_users_id` (`borrower`),
  ADD KEY `loan_statements_loan_id_2bf4f203_fk_loans_id` (`loan`),
  ADD KEY `loan_statements_loan_id_idx` (`loan_id`),
  ADD KEY `idx_loan_statements_borrower` (`borrower_id`);

--
-- Indexes for table `mpesa_access_tokens`
--
ALTER TABLE `mpesa_access_tokens`
  ADD PRIMARY KEY (`id`),
  ADD KEY `mpesa_access_tokens_configuration_id_de2bf233_fk_mpesa_con` (`configuration_id`);

--
-- Indexes for table `mpesa_callbacks`
--
ALTER TABLE `mpesa_callbacks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `mpesa_callbacks_transaction_id_426bc1e5_fk_mpesa_transactions_id` (`transaction_id`);

--
-- Indexes for table `mpesa_configurations`
--
ALTER TABLE `mpesa_configurations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `mpesa_transactions`
--
ALTER TABLE `mpesa_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `mpesa_transactions_loan_id_ab4152e1_fk_loans_id` (`loan`),
  ADD KEY `mpesa_transactions_repayment_id_903b355f_fk_repayments_id` (`repayment`);

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `notifications_related_application__f2562b71_fk_loan_appl` (`related_application`),
  ADD KEY `notifications_related_loan_id_e196b54c_fk_loans_id` (`related_loan`),
  ADD KEY `notifications_user_id_468e288d_fk_users_id` (`user`),
  ADD KEY `notifications_related_loan_id_idx` (`related_loan_id`),
  ADD KEY `notifications_related_application_id_idx` (`related_application_id`);

--
-- Indexes for table `offer_letters`
--
ALTER TABLE `offer_letters`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `offer_number` (`offer_number`),
  ADD UNIQUE KEY `application_id` (`application`),
  ADD KEY `offer_letters_borrower_id_25187cf5_fk_users_id` (`borrower`),
  ADD KEY `offer_letters_application_id_idx` (`application_id`),
  ADD KEY `idx_offer_letters_borrower` (`borrower_id`);

--
-- Indexes for table `otp_verifications`
--
ALTER TABLE `otp_verifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `otp_verifications_user_id_3340c576_fk_users_id` (`user_id`);

--
-- Indexes for table `payment_allocations`
--
ALTER TABLE `payment_allocations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `repayment_id` (`repayment_id`),
  ADD KEY `payment_allocations_loan_id_e9be27ef_fk_loans_id` (`loan_id`),
  ADD KEY `payment_allocations_mpesa_transaction_id_f31fa711_fk_mpesa_tra` (`mpesa_transaction_id`);

--
-- Indexes for table `penalty_charges`
--
ALTER TABLE `penalty_charges`
  ADD PRIMARY KEY (`id`),
  ADD KEY `penalty_charges_loan_id_idx` (`loan_id`),
  ADD KEY `penalty_charges_applied_date_idx` (`applied_date`);

--
-- Indexes for table `portfolio_assignments`
--
ALTER TABLE `portfolio_assignments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `assignment_number` (`assignment_number`),
  ADD KEY `portfolio_assignments_portfolio_manager_id_idx` (`portfolio_manager_id`),
  ADD KEY `portfolio_assignments_client_id_idx` (`client_id`),
  ADD KEY `portfolio_assignments_status_idx` (`status`),
  ADD KEY `portfolio_assignments_assigned_date_idx` (`assigned_date`);

--
-- Indexes for table `portfolio_performance`
--
ALTER TABLE `portfolio_performance`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `date` (`date`),
  ADD KEY `idx_portfolio_manager_id` (`portfolio_manager_id`),
  ADD KEY `portfolio_performance_verified_by_id_idx` (`verified_by_id`);

--
-- Indexes for table `receipts`
--
ALTER TABLE `receipts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `receipt_number` (`receipt_number`),
  ADD UNIQUE KEY `repayment_id` (`repayment`),
  ADD KEY `receipts_borrower_id_e77bb056_fk_users_id` (`borrower`),
  ADD KEY `receipts_loan_id_b4736316_fk_loans_id` (`loan`),
  ADD KEY `receipts_repayment_id_idx` (`repayment_id`),
  ADD KEY `receipts_loan_id_idx` (`loan_id`);

--
-- Indexes for table `registration_fees`
--
ALTER TABLE `registration_fees`
  ADD PRIMARY KEY (`id`),
  ADD KEY `registration_fees_product_type_idx` (`product_type`),
  ADD KEY `registration_fees_is_active_idx` (`is_active`);

--
-- Indexes for table `registration_fee_payments`
--
ALTER TABLE `registration_fee_payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `receipt_number` (`receipt_number`),
  ADD KEY `registration_fee_payments_customer_id_idx` (`customer_id`),
  ADD KEY `registration_fee_payments_payment_date_idx` (`payment_date`),
  ADD KEY `registration_fee_payments_registration_fee_id_idx` (`registration_fee_id`);

--
-- Indexes for table `repayments`
--
ALTER TABLE `repayments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `receipt_number` (`receipt_number`),
  ADD KEY `repayments_loan_id_58f9f13b_fk_loans_id` (`loan`);

--
-- Indexes for table `reports_notification`
--
ALTER TABLE `reports_notification`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `report_schedules`
--
ALTER TABLE `report_schedules`
  ADD PRIMARY KEY (`id`),
  ADD KEY `report_schedules_report_type_idx` (`report_type`),
  ADD KEY `report_schedules_is_active_idx` (`is_active`),
  ADD KEY `report_schedules_next_run_idx` (`next_run`);

--
-- Indexes for table `report_schedules_recipients`
--
ALTER TABLE `report_schedules_recipients`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `report_schedules_recipients_unique` (`reportschedule_id`,`customuser_id`),
  ADD KEY `report_schedules_recipients_reportschedule_id_idx` (`reportschedule_id`),
  ADD KEY `report_schedules_recipients_user_id_idx` (`customuser_id`);

--
-- Indexes for table `report_templates`
--
ALTER TABLE `report_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `role_permissions`
--
ALTER TABLE `role_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `role_permissions_role_module_action_b947a1b8_uniq` (`role`,`module`,`action`);

--
-- Indexes for table `rollover_requests`
--
ALTER TABLE `rollover_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `rollover_requests_borrower_id_a13a7c75_fk_users_id` (`borrower`),
  ADD KEY `rollover_requests_loan_id_427ee293_fk_loans_id` (`loan`),
  ADD KEY `rollover_requests_reviewed_by_id_ffce375d_fk_users_id` (`reviewed_by`);

--
-- Indexes for table `sms_templates`
--
ALTER TABLE `sms_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `system_settings`
--
ALTER TABLE `system_settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `unconfirmed_payments`
--
ALTER TABLE `unconfirmed_payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `mpesa_transaction_id` (`mpesa_transaction_id`),
  ADD KEY `unconfirmed_payments_mpesa_transaction_id_idx` (`mpesa_transaction_id`),
  ADD KEY `unconfirmed_payments_suggested_borrower_id_idx` (`suggested_borrower_id`),
  ADD KEY `unconfirmed_payments_approved_by_id_idx` (`approved_by_id`),
  ADD KEY `unconfirmed_payments_status_idx` (`status`),
  ADD KEY `unconfirmed_payments_match_type_idx` (`match_type`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `phone_number` (`phone_number`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `id_number` (`id_number`),
  ADD UNIQUE KEY `email_2` (`email`),
  ADD KEY `fk_users_verified_by` (`verified_by_id`),
  ADD KEY `idx_users_role` (`role`),
  ADD KEY `idx_users_status` (`status`),
  ADD KEY `idx_users_phone` (`phone_number`),
  ADD KEY `idx_users_email` (`email`),
  ADD KEY `idx_users_portfolio_manager` (`portfolio_manager_id`),
  ADD KEY `fk_users_assigned_by` (`assigned_by_id`),
  ADD KEY `fk_users_kyc_verified_by` (`kyc_verified_by_id`),
  ADD KEY `fk_users_suspended_by` (`suspended_by_id`),
  ADD KEY `fk_users_created_by` (`created_by_id`),
  ADD KEY `fk_users_updated_by` (`updated_by_id`),
  ADD KEY `fk_users_deleted_by` (`deleted_by_id`),
  ADD KEY `fk_users_referred_by` (`referred_by_id`),
  ADD KEY `idx_users_verified_by` (`verified_by_id`),
  ADD KEY `idx_users_assigned_date` (`assigned_date`),
  ADD KEY `idx_users_credit_score` (`credit_score`),
  ADD KEY `idx_users_kyc_status` (`kyc_status`),
  ADD KEY `idx_users_account_status` (`account_status`),
  ADD KEY `idx_users_last_activity` (`last_activity_at`),
  ADD KEY `idx_users_referral_code` (`referral_code`),
  ADD KEY `idx_users_mpesa_number` (`mpesa_number`),
  ADD KEY `users_branch_id_fk` (`branch_id`);

--
-- Indexes for table `users_accessible_branches`
--
ALTER TABLE `users_accessible_branches`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_customuser_accessi_customuser_id_branch_id_unique` (`customuser_id`,`branch_id`),
  ADD KEY `users_customuser_accessible_branches_branch_id_fk` (`branch_id`);

--
-- Indexes for table `users_branch`
--
ALTER TABLE `users_branch`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`);

--
-- Indexes for table `users_customuser`
--
ALTER TABLE `users_customuser`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD KEY `users_customuser_branch_id` (`branch_id`),
  ADD KEY `users_customuser_portfolio_manager_id` (`portfolio_manager_id`),
  ADD KEY `users_customuser_approved_by_id` (`approved_by_id`);

--
-- Indexes for table `users_customuser_groups`
--
ALTER TABLE `users_customuser_groups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_customuser_groups_customuser_id_group_id` (`customuser_id`,`group_id`),
  ADD KEY `idx_users_customuser_groups_customuser_id` (`customuser_id`),
  ADD KEY `idx_users_customuser_groups_group_id` (`group_id`);

--
-- Indexes for table `users_customuser_user_permissions`
--
ALTER TABLE `users_customuser_user_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_customuser_user_permissions_customuser_id_permission_id` (`customuser_id`,`permission_id`),
  ADD KEY `idx_users_customuser_user_permissions_customuser_id` (`customuser_id`),
  ADD KEY `idx_users_customuser_user_permissions_permission_id` (`permission_id`);

--
-- Indexes for table `users_groups`
--
ALTER TABLE `users_groups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_groups_customuser_id_group_id_uniq` (`customuser_id`,`group_id`),
  ADD KEY `users_groups_customuser_id` (`customuser_id`),
  ADD KEY `users_groups_group_id` (`group_id`);

--
-- Indexes for table `users_user_permissions`
--
ALTER TABLE `users_user_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_user_permissions_customuser_id_permission_id_uniq` (`customuser_id`,`permission_id`),
  ADD KEY `users_user_permissions_customuser_id` (`customuser_id`),
  ADD KEY `users_user_permissions_permission_id` (`permission_id`);

--
-- Indexes for table `user_access_logs`
--
ALTER TABLE `user_access_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_access_user_id_416563_idx` (`user_id`,`accessed_at`),
  ADD KEY `user_access_action_a90b01_idx` (`action`,`accessed_at`),
  ADD KEY `user_access_module_47fa23_idx` (`module`,`accessed_at`);

--
-- Indexes for table `user_permissions`
--
ALTER TABLE `user_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_user_permission` (`user_id`,`module`,`action`),
  ADD KEY `idx_user_permissions_user_id` (`user_id`),
  ADD KEY `idx_user_permissions_permission_id` (`permission_id`),
  ADD KEY `idx_user_expires` (`user_id`,`expires_at`),
  ADD KEY `idx_module_action` (`module`,`action`);

--
-- Indexes for table `utils_auditlog`
--
ALTER TABLE `utils_auditlog`
  ADD PRIMARY KEY (`id`),
  ADD KEY `utils_auditlog_user_id_bba0ec05_fk_users_id` (`user_id`);

--
-- Indexes for table `utils_document`
--
ALTER TABLE `utils_document`
  ADD PRIMARY KEY (`id`),
  ADD KEY `utils_document_uploaded_by_id_c44b6c29_fk_users_id` (`uploaded_by`),
  ADD KEY `idx_utils_document_uploaded_by` (`uploaded_by_id`),
  ADD KEY `idx_document_uploaded_by` (`uploaded_by_id`),
  ADD KEY `idx_document_type` (`document_type`);

--
-- Indexes for table `utils_documentshare`
--
ALTER TABLE `utils_documentshare`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `utils_documentshare_document_id_shared_with_id_5c637053_uniq` (`document`,`shared_with`),
  ADD KEY `utils_documentshare_shared_by_id_00694da5_fk_users_id` (`shared_by`),
  ADD KEY `utils_documentshare_shared_with_id_65546475_fk_users_id` (`shared_with`),
  ADD KEY `idx_utils_documentshare_shared_with` (`shared_with_id`),
  ADD KEY `idx_documentshare_shared_with` (`shared_with_id`),
  ADD KEY `idx_utils_documentshare_document` (`document_id`),
  ADD KEY `idx_documentshare_document` (`document_id`);

--
-- Indexes for table `utils_documenttag`
--
ALTER TABLE `utils_documenttag`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`),
  ADD KEY `utils_documenttag_created_by_id_7d2b3d90_fk_users_id` (`created_by`);

--
-- Indexes for table `utils_document_tags`
--
ALTER TABLE `utils_document_tags`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `utils_document_tags_document_id_documenttag_id_43d6f1f7_uniq` (`document`,`documenttag`),
  ADD KEY `utils_document_tags_documenttag_id_6b2c49ec_fk_utils_doc` (`documenttag`);

--
-- Indexes for table `utils_notification`
--
ALTER TABLE `utils_notification`
  ADD PRIMARY KEY (`id`),
  ADD KEY `utils_notif_user_id_36dc1c_idx` (`user`,`created_at` DESC),
  ADD KEY `utils_notif_notific_d43fdf_idx` (`notification_type`),
  ADD KEY `utils_notif_read_at_52948b_idx` (`read_at`),
  ADD KEY `idx_utils_notification_user_id` (`user_id`),
  ADD KEY `idx_notification_user` (`user_id`),
  ADD KEY `idx_notification_read` (`read_at`),
  ADD KEY `utils_notification_loan_app_id_idx` (`loan_app_id`),
  ADD KEY `utils_notification_related_loan_id_idx` (`related_loan_id`),
  ADD KEY `utils_notification_loan_id_idx` (`loan_id`);

--
-- Indexes for table `utils_systemsetting`
--
ALTER TABLE `utils_systemsetting`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `key` (`key`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `auth_group`
--
ALTER TABLE `auth_group`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `auth_group_permissions`
--
ALTER TABLE `auth_group_permissions`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `auth_permission`
--
ALTER TABLE `auth_permission`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=237;

--
-- AUTO_INCREMENT for table `default_role_permissions`
--
ALTER TABLE `default_role_permissions`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `django_admin_log`
--
ALTER TABLE `django_admin_log`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `django_content_type`
--
ALTER TABLE `django_content_type`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=60;

--
-- AUTO_INCREMENT for table `django_migrations`
--
ALTER TABLE `django_migrations`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=593;

--
-- AUTO_INCREMENT for table `loans_loan`
--
ALTER TABLE `loans_loan`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `loans_repayment`
--
ALTER TABLE `loans_repayment`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `otp_verifications`
--
ALTER TABLE `otp_verifications`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `portfolio_assignments`
--
ALTER TABLE `portfolio_assignments`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

--
-- AUTO_INCREMENT for table `portfolio_performance`
--
ALTER TABLE `portfolio_performance`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `report_schedules_recipients`
--
ALTER TABLE `report_schedules_recipients`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `role_permissions`
--
ALTER TABLE `role_permissions`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4769;

--
-- AUTO_INCREMENT for table `users_accessible_branches`
--
ALTER TABLE `users_accessible_branches`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `users_customuser`
--
ALTER TABLE `users_customuser`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users_customuser_groups`
--
ALTER TABLE `users_customuser_groups`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users_customuser_user_permissions`
--
ALTER TABLE `users_customuser_user_permissions`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users_groups`
--
ALTER TABLE `users_groups`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users_user_permissions`
--
ALTER TABLE `users_user_permissions`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `user_access_logs`
--
ALTER TABLE `user_access_logs`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=191;

--
-- AUTO_INCREMENT for table `user_permissions`
--
ALTER TABLE `user_permissions`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=515;

--
-- AUTO_INCREMENT for table `utils_document`
--
ALTER TABLE `utils_document`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `utils_documentshare`
--
ALTER TABLE `utils_documentshare`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `utils_documenttag`
--
ALTER TABLE `utils_documenttag`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `utils_document_tags`
--
ALTER TABLE `utils_document_tags`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `utils_systemsetting`
--
ALTER TABLE `utils_systemsetting`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=84;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `auth_group_permissions`
--
ALTER TABLE `auth_group_permissions`
  ADD CONSTRAINT `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
  ADD CONSTRAINT `auth_group_permissions_group_id_b120cbf9_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`);

--
-- Constraints for table `auth_permission`
--
ALTER TABLE `auth_permission`
  ADD CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`);

--
-- Constraints for table `django_admin_log`
--
ALTER TABLE `django_admin_log`
  ADD CONSTRAINT `django_admin_log_content_type_id_c4bce8eb_fk_django_co_new` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`);

--
-- Constraints for table `mpesa_access_tokens`
--
ALTER TABLE `mpesa_access_tokens`
  ADD CONSTRAINT `mpesa_access_tokens_configuration_id_de2bf233_fk_mpesa_con` FOREIGN KEY (`configuration_id`) REFERENCES `mpesa_configurations` (`id`);

--
-- Constraints for table `mpesa_callbacks`
--
ALTER TABLE `mpesa_callbacks`
  ADD CONSTRAINT `mpesa_callbacks_transaction_id_426bc1e5_fk_mpesa_transactions_id` FOREIGN KEY (`transaction_id`) REFERENCES `mpesa_transactions` (`id`);

--
-- Constraints for table `payment_allocations`
--
ALTER TABLE `payment_allocations`
  ADD CONSTRAINT `payment_allocations_loan_id_e9be27ef_fk_loans_id` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `payment_allocations_mpesa_transaction_id_f31fa711_fk_mpesa_tra` FOREIGN KEY (`mpesa_transaction_id`) REFERENCES `mpesa_transactions` (`id`),
  ADD CONSTRAINT `payment_allocations_repayment_id_61a101ee_fk_repayments_id` FOREIGN KEY (`repayment_id`) REFERENCES `repayments` (`id`);

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_branch_id_fk` FOREIGN KEY (`branch_id`) REFERENCES `users_branch` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `users_accessible_branches`
--
ALTER TABLE `users_accessible_branches`
  ADD CONSTRAINT `users_customuser_accessible_branches_branch_id_fk` FOREIGN KEY (`branch_id`) REFERENCES `users_branch` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `users_customuser_accessible_branches_customuser_id_fk` FOREIGN KEY (`customuser_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `users_groups`
--
ALTER TABLE `users_groups`
  ADD CONSTRAINT `users_groups_customuser_id_fk` FOREIGN KEY (`customuser_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `users_groups_group_id_fk` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `users_user_permissions`
--
ALTER TABLE `users_user_permissions`
  ADD CONSTRAINT `users_user_permissions_customuser_id_fk` FOREIGN KEY (`customuser_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `users_user_permissions_permission_id_fk` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`) ON DELETE CASCADE;
--
-- Database: `acbptxvs_ruralpoint`
--
CREATE DATABASE IF NOT EXISTS `acbptxvs_ruralpoint` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
USE `acbptxvs_ruralpoint`;

-- --------------------------------------------------------

--
-- Table structure for table `auth_group`
--

CREATE TABLE `auth_group` (
  `id` int NOT NULL,
  `name` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `auth_group_permissions`
--

CREATE TABLE `auth_group_permissions` (
  `id` bigint NOT NULL,
  `group_id` int NOT NULL,
  `permission_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `auth_permission`
--

CREATE TABLE `auth_permission` (
  `id` int NOT NULL,
  `name` varchar(255) NOT NULL,
  `content_type_id` int NOT NULL,
  `codename` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `auth_permission`
--

INSERT INTO `auth_permission` (`id`, `name`, `content_type_id`, `codename`) VALUES
(1, 'Can add log entry', 1, 'add_logentry'),
(2, 'Can change log entry', 1, 'change_logentry'),
(3, 'Can delete log entry', 1, 'delete_logentry'),
(4, 'Can view log entry', 1, 'view_logentry'),
(5, 'Can add permission', 2, 'add_permission'),
(6, 'Can change permission', 2, 'change_permission'),
(7, 'Can delete permission', 2, 'delete_permission'),
(8, 'Can view permission', 2, 'view_permission'),
(9, 'Can add group', 3, 'add_group'),
(10, 'Can change group', 3, 'change_group'),
(11, 'Can delete group', 3, 'delete_group'),
(12, 'Can view group', 3, 'view_group'),
(13, 'Can add content type', 4, 'add_contenttype'),
(14, 'Can change content type', 4, 'change_contenttype'),
(15, 'Can delete content type', 4, 'delete_contenttype'),
(16, 'Can view content type', 4, 'view_contenttype'),
(17, 'Can add session', 5, 'add_session'),
(18, 'Can change session', 5, 'change_session'),
(19, 'Can delete session', 5, 'delete_session'),
(20, 'Can view session', 5, 'view_session'),
(21, 'Can add custom user', 6, 'add_customuser'),
(22, 'Can change custom user', 6, 'change_customuser'),
(23, 'Can delete custom user', 6, 'delete_customuser'),
(24, 'Can view custom user', 6, 'view_customuser'),
(25, 'Can add otp verification', 7, 'add_otpverification'),
(26, 'Can change otp verification', 7, 'change_otpverification'),
(27, 'Can delete otp verification', 7, 'delete_otpverification'),
(28, 'Can view otp verification', 7, 'view_otpverification'),
(29, 'Can add role permission', 8, 'add_rolepermission'),
(30, 'Can change role permission', 8, 'change_rolepermission'),
(31, 'Can delete role permission', 8, 'delete_rolepermission'),
(32, 'Can view role permission', 8, 'view_rolepermission'),
(33, 'Can add user access log', 9, 'add_useraccesslog'),
(34, 'Can change user access log', 9, 'change_useraccesslog'),
(35, 'Can delete user access log', 9, 'delete_useraccesslog'),
(36, 'Can view user access log', 9, 'view_useraccesslog'),
(37, 'Can add loan', 10, 'add_loan'),
(38, 'Can change loan', 10, 'change_loan'),
(39, 'Can delete loan', 10, 'delete_loan'),
(40, 'Can view loan', 10, 'view_loan'),
(41, 'Can add loan application', 11, 'add_loanapplication'),
(42, 'Can change loan application', 11, 'change_loanapplication'),
(43, 'Can delete loan application', 11, 'delete_loanapplication'),
(44, 'Can view loan application', 11, 'view_loanapplication'),
(45, 'Can add loan product', 12, 'add_loanproduct'),
(46, 'Can change loan product', 12, 'change_loanproduct'),
(47, 'Can delete loan product', 12, 'delete_loanproduct'),
(48, 'Can view loan product', 12, 'view_loanproduct'),
(49, 'Can add mpesa transaction', 13, 'add_mpesatransaction'),
(50, 'Can change mpesa transaction', 13, 'change_mpesatransaction'),
(51, 'Can delete mpesa transaction', 13, 'delete_mpesatransaction'),
(52, 'Can view mpesa transaction', 13, 'view_mpesatransaction'),
(53, 'Can add repayment', 14, 'add_repayment'),
(54, 'Can change repayment', 14, 'change_repayment'),
(55, 'Can delete repayment', 14, 'delete_repayment'),
(56, 'Can view repayment', 14, 'view_repayment'),
(57, 'Can add rollover request', 15, 'add_rolloverrequest'),
(58, 'Can change rollover request', 15, 'change_rolloverrequest'),
(59, 'Can delete rollover request', 15, 'delete_rolloverrequest'),
(60, 'Can view rollover request', 15, 'view_rolloverrequest'),
(61, 'Can add document template', 16, 'add_documenttemplate'),
(62, 'Can change document template', 16, 'change_documenttemplate'),
(63, 'Can delete document template', 16, 'delete_documenttemplate'),
(64, 'Can view document template', 16, 'view_documenttemplate'),
(65, 'Can add email template', 17, 'add_emailtemplate'),
(66, 'Can change email template', 17, 'change_emailtemplate'),
(67, 'Can delete email template', 17, 'delete_emailtemplate'),
(68, 'Can view email template', 17, 'view_emailtemplate'),
(69, 'Can add sms template', 18, 'add_smstemplate'),
(70, 'Can change sms template', 18, 'change_smstemplate'),
(71, 'Can delete sms template', 18, 'delete_smstemplate'),
(72, 'Can view sms template', 18, 'view_smstemplate'),
(73, 'Can add loan statement', 19, 'add_loanstatement'),
(74, 'Can change loan statement', 19, 'change_loanstatement'),
(75, 'Can delete loan statement', 19, 'delete_loanstatement'),
(76, 'Can view loan statement', 19, 'view_loanstatement'),
(77, 'Can add offer letter', 20, 'add_offerletter'),
(78, 'Can change offer letter', 20, 'change_offerletter'),
(79, 'Can delete offer letter', 20, 'delete_offerletter'),
(80, 'Can view offer letter', 20, 'view_offerletter'),
(81, 'Can add receipt', 21, 'add_receipt'),
(82, 'Can change receipt', 21, 'change_receipt'),
(83, 'Can delete receipt', 21, 'delete_receipt'),
(84, 'Can view receipt', 21, 'view_receipt'),
(85, 'Can add Audit Log', 22, 'add_auditlog'),
(86, 'Can change Audit Log', 22, 'change_auditlog'),
(87, 'Can delete Audit Log', 22, 'delete_auditlog'),
(88, 'Can view Audit Log', 22, 'view_auditlog'),
(89, 'Can add system setting', 23, 'add_systemsetting'),
(90, 'Can change system setting', 23, 'change_systemsetting'),
(91, 'Can delete system setting', 23, 'delete_systemsetting'),
(92, 'Can view system setting', 23, 'view_systemsetting'),
(93, 'Can add document', 24, 'add_document'),
(94, 'Can change document', 24, 'change_document'),
(95, 'Can delete document', 24, 'delete_document'),
(96, 'Can view document', 24, 'view_document'),
(97, 'Can add document share', 25, 'add_documentshare'),
(98, 'Can change document share', 25, 'change_documentshare'),
(99, 'Can delete document share', 25, 'delete_documentshare'),
(100, 'Can view document share', 25, 'view_documentshare'),
(101, 'Can add document tag', 26, 'add_documenttag'),
(102, 'Can change document tag', 26, 'change_documenttag'),
(103, 'Can delete document tag', 26, 'delete_documenttag'),
(104, 'Can view document tag', 26, 'view_documenttag'),
(105, 'Can add notification', 27, 'add_notification'),
(106, 'Can change notification', 27, 'change_notification'),
(107, 'Can delete notification', 27, 'delete_notification'),
(108, 'Can view notification', 27, 'view_notification'),
(109, 'Can add generated report', 28, 'add_generatedreport'),
(110, 'Can change generated report', 28, 'change_generatedreport'),
(111, 'Can delete generated report', 28, 'delete_generatedreport'),
(112, 'Can view generated report', 28, 'view_generatedreport'),
(113, 'Can add loan scoring', 29, 'add_loanscoring'),
(114, 'Can change loan scoring', 29, 'change_loanscoring'),
(115, 'Can delete loan scoring', 29, 'delete_loanscoring'),
(116, 'Can view loan scoring', 29, 'view_loanscoring'),
(117, 'Can add notification', 30, 'add_notification'),
(118, 'Can change notification', 30, 'change_notification'),
(119, 'Can delete notification', 30, 'delete_notification'),
(120, 'Can view notification', 30, 'view_notification'),
(121, 'Can add report template', 31, 'add_reporttemplate'),
(122, 'Can change report template', 31, 'change_reporttemplate'),
(123, 'Can delete report template', 31, 'delete_reporttemplate'),
(124, 'Can view report template', 31, 'view_reporttemplate'),
(125, 'Can add System Setting', 32, 'add_systemsettings'),
(126, 'Can change System Setting', 32, 'change_systemsettings'),
(127, 'Can delete System Setting', 32, 'delete_systemsettings'),
(128, 'Can view System Setting', 32, 'view_systemsettings');

-- --------------------------------------------------------

--
-- Table structure for table `django_admin_log`
--

CREATE TABLE `django_admin_log` (
  `id` int NOT NULL,
  `action_time` datetime(6) NOT NULL,
  `object_id` longtext,
  `object_repr` varchar(200) NOT NULL,
  `action_flag` smallint UNSIGNED NOT NULL,
  `change_message` longtext NOT NULL,
  `content_type_id` int DEFAULT NULL,
  `user_id` char(32) NOT NULL
) ;

-- --------------------------------------------------------

--
-- Table structure for table `django_content_type`
--

CREATE TABLE `django_content_type` (
  `id` int NOT NULL,
  `app_label` varchar(100) NOT NULL,
  `model` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `django_content_type`
--

INSERT INTO `django_content_type` (`id`, `app_label`, `model`) VALUES
(1, 'admin', 'logentry'),
(3, 'auth', 'group'),
(2, 'auth', 'permission'),
(4, 'contenttypes', 'contenttype'),
(10, 'loans', 'loan'),
(11, 'loans', 'loanapplication'),
(12, 'loans', 'loanproduct'),
(13, 'loans', 'mpesatransaction'),
(14, 'loans', 'repayment'),
(15, 'loans', 'rolloverrequest'),
(28, 'reports', 'generatedreport'),
(29, 'reports', 'loanscoring'),
(30, 'reports', 'notification'),
(31, 'reports', 'reporttemplate'),
(32, 'reports', 'systemsettings'),
(5, 'sessions', 'session'),
(6, 'users', 'customuser'),
(7, 'users', 'otpverification'),
(8, 'users', 'rolepermission'),
(9, 'users', 'useraccesslog'),
(22, 'utils', 'auditlog'),
(24, 'utils', 'document'),
(25, 'utils', 'documentshare'),
(26, 'utils', 'documenttag'),
(16, 'utils', 'documenttemplate'),
(17, 'utils', 'emailtemplate'),
(19, 'utils', 'loanstatement'),
(27, 'utils', 'notification'),
(20, 'utils', 'offerletter'),
(21, 'utils', 'receipt'),
(18, 'utils', 'smstemplate'),
(23, 'utils', 'systemsetting');

-- --------------------------------------------------------

--
-- Table structure for table `django_migrations`
--

CREATE TABLE `django_migrations` (
  `id` bigint NOT NULL,
  `app` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `applied` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `django_migrations`
--

INSERT INTO `django_migrations` (`id`, `app`, `name`, `applied`) VALUES
(1, 'contenttypes', '0001_initial', '2025-08-16 11:54:39.696515'),
(2, 'contenttypes', '0002_remove_content_type_name', '2025-08-16 11:54:39.709604'),
(3, 'auth', '0001_initial', '2025-08-16 11:54:39.754983'),
(4, 'auth', '0002_alter_permission_name_max_length', '2025-08-16 11:54:39.766838'),
(5, 'auth', '0003_alter_user_email_max_length', '2025-08-16 11:54:39.770484'),
(6, 'auth', '0004_alter_user_username_opts', '2025-08-16 11:54:39.774319'),
(7, 'auth', '0005_alter_user_last_login_null', '2025-08-16 11:54:39.777712'),
(8, 'auth', '0006_require_contenttypes_0002', '2025-08-16 11:54:39.778171'),
(9, 'auth', '0007_alter_validators_add_error_messages', '2025-08-16 11:54:39.781530'),
(10, 'auth', '0008_alter_user_username_max_length', '2025-08-16 11:54:39.784952'),
(11, 'auth', '0009_alter_user_last_name_max_length', '2025-08-16 11:54:39.788697'),
(12, 'auth', '0010_alter_group_name_max_length', '2025-08-16 11:54:39.795015'),
(13, 'auth', '0011_update_proxy_permissions', '2025-08-16 11:54:39.798695'),
(14, 'auth', '0012_alter_user_first_name_max_length', '2025-08-16 11:54:39.802549'),
(15, 'users', '0001_initial', '2025-08-16 11:54:39.938173'),
(16, 'admin', '0001_initial', '2025-08-16 11:54:39.971325'),
(17, 'admin', '0002_logentry_remove_auto_add', '2025-08-16 11:54:39.977829'),
(18, 'admin', '0003_logentry_add_action_flag_choices', '2025-08-16 11:54:39.983502'),
(19, 'loans', '0001_initial', '2025-08-16 11:54:40.008854'),
(20, 'loans', '0002_initial', '2025-08-16 11:54:40.259477'),
(21, 'loans', '0003_loanproduct_available_repayment_methods_and_more', '2025-08-16 11:54:40.302492'),
(22, 'loans', '0004_loanapplication_repayment_method', '2025-08-16 11:54:40.326693'),
(23, 'loans', '0005_loanproduct_max_rollover_count_and_more', '2025-08-16 11:54:40.386344'),
(24, 'loans', '0006_alter_loanproduct_product_type', '2025-08-16 11:54:40.389892'),
(25, 'reports', '0001_initial', '2025-08-16 11:54:40.412788'),
(26, 'reports', '0002_initial', '2025-08-16 11:54:40.537138'),
(27, 'reports', '0003_alter_notification_user', '2025-08-16 11:54:40.548956'),
(28, 'sessions', '0001_initial', '2025-08-16 11:54:40.556740'),
(29, 'users', '0002_alter_customuser_id_alter_customuser_monthly_income', '2025-08-16 11:54:40.578431'),
(30, 'users', '0003_customuser_logbook_customuser_signature_and_more', '2025-08-16 11:54:40.690973'),
(31, 'users', '0004_customuser_capital_invested_customuser_county_and_more', '2025-08-16 11:54:41.544284'),
(32, 'users', '0005_alter_customuser_role_alter_rolepermission_role', '2025-08-16 11:54:41.555649'),
(33, 'utils', '0001_initial', '2025-08-16 11:54:41.705993'),
(34, 'utils', '0002_auditlog', '2025-08-16 11:54:41.736023'),
(35, 'utils', '0003_systemsetting_document_documentshare_and_more', '2025-08-16 11:54:41.946632'),
(36, 'utils', '0004_alter_document_document_type_and_more', '2025-08-16 11:54:41.975886');

-- --------------------------------------------------------

--
-- Table structure for table `django_session`
--

CREATE TABLE `django_session` (
  `session_key` varchar(40) NOT NULL,
  `session_data` longtext NOT NULL,
  `expire_date` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `django_session`
--

INSERT INTO `django_session` (`session_key`, `session_data`, `expire_date`) VALUES
('0zbfe4u8ntxrzyjufi39dw0fnh92xiub', '.eJxVy70OwjAMBOB3yUyq_NhpwohYGBg7V07sqAgEEqET4t1ppQ5w253ue6uR5tc0zk2e44XVXgVbAKyrOkXDGiChzphRYxVXo4mYSlW7X5apXOW-2rW2buutG4bT8fxguR22xx-bqE2LcUuCS4ZAbMWc0AJ7ycvSR-EYsXeewWf0gcSSGC5cKyXh3nHwrD5fv7U87A:1unI9r:-AFDZx9XTVJKMdZ-HU45QPNmxjXvOVdYye_WiN1r8eY', '2025-08-16 15:45:23.606674'),
('72plm9pocfs04ks35sedji7uar6coyjg', '.eJxVy70OwjAMBOB3yUyq_NhpwohYGBg7V07sqAgEEqET4t1ppQ5w253ue6uR5tc0zk2e44XVXgVbAKyrOkXDGiChzphRYxVXo4mYSlW7X5apXOW-2rW2buutG4bT8fxguR22xx-bqE2LcUuCS4ZAbMWc0AJ7ycvSR-EYsXeewWf0gcSSGC5cKyXh3nHwrD5fv7U87A:1unGb2:p1xVEZt5ox5TVZ0PBOfsRurDGcB7BPDJ-OMvHymwQL0', '2025-08-16 14:05:20.627177'),
('9vof6x6hemg8753346l0gd0kd0snfna0', '.eJxVy70OwjAMBOB3yUyq_NhpwohYGBg7V07sqAgEEqET4t1ppQ5w253ue6uR5tc0zk2e44XVXgVbAKyrOkXDGiChzphRYxVXo4mYSlW7X5apXOW-2rW2buutG4bT8fxguR22xx-bqE2LcUuCS4ZAbMWc0AJ7ycvSR-EYsXeewWf0gcSSGC5cKyXh3nHwrD5fv7U87A:1unGim:vnQ37dOIk1HicGpvgWcsarvNGcmGcktrE9SOu2LdE70', '2025-08-16 14:13:20.954134'),
('i0mjmwsq6nwoiex8zcu1g1k5h8vbj1oc', 'e30:1unvwH:4jOKHAXnluvMVWOsRWIxl9anXLKIrZLXXS--sjjZsuA', '2025-08-18 10:14:01.895910'),
('rcf9q5sj7vou5osrh5tcwjbpikdxofu0', '.eJxVy70OwjAMBOB3yUyq_NhpwohYGBg7V07sqAgEEqET4t1ppQ5w253ue6uR5tc0zk2e44XVXgVbAKyrOkXDGiChzphRYxVXo4mYSlW7X5apXOW-2rW2buutG4bT8fxguR22xx-bqE2LcUuCS4ZAbMWc0AJ7ycvSR-EYsXeewWf0gcSSGC5cKyXh3nHwrD5fv7U87A:1urmDy:bBTdUPjEF2JMZwCRtX_HB0CsssHQRc78cXj6OxwKDt4', '2025-08-29 00:40:10.696873'),
('wc3h3khytgc6wapbn2gdbx8ygthvxxrb', '.eJxVy70OwjAMBOB3yUyq_NhpwohYGBg7V07sqAgEEqET4t1ppQ5w253ue6uR5tc0zk2e44XVXgVbAKyrOkXDGiChzphRYxVXo4mYSlW7X5apXOW-2rW2buutG4bT8fxguR22xx-bqE2LcUuCS4ZAbMWc0AJ7ycvSR-EYsXeewWf0gcSSGC5cKyXh3nHwrD5fv7U87A:1usshH:GbNoS_jt6h5b_E2ApreTEMWAooBQ952PgMPpZbSD0bc', '2025-09-01 01:46:59.749288'),
('zxlz3lz4z5vf76wgvimpbuo0e9bi28v7', '.eJxVy70OwjAMBOB3yUyq_NhpwohYGBg7V07sqAgEEqET4t1ppQ5w253ue6uR5tc0zk2e44XVXgVbAKyrOkXDGiChzphRYxVXo4mYSlW7X5apXOW-2rW2buutG4bT8fxguR22xx-bqE2LcUuCS4ZAbMWc0AJ7ycvSR-EYsXeewWf0gcSSGC5cKyXh3nHwrD5fv7U87A:1unhJb:JUBnbwZAvrJE_5Ch3pKLFZNNDN6RGF7tMVFyeUNiR1I', '2025-08-17 18:37:07.586018');

-- --------------------------------------------------------

--
-- Table structure for table `document_templates`
--

CREATE TABLE `document_templates` (
  `id` char(32) NOT NULL,
  `name` varchar(200) NOT NULL,
  `template_type` varchar(30) NOT NULL,
  `description` longtext,
  `html_template` longtext NOT NULL,
  `css_styles` longtext,
  `is_active` tinyint(1) NOT NULL,
  `is_default` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `email_templates`
--

CREATE TABLE `email_templates` (
  `id` char(32) NOT NULL,
  `name` varchar(200) NOT NULL,
  `template_type` varchar(30) NOT NULL,
  `subject` varchar(200) NOT NULL,
  `html_content` longtext NOT NULL,
  `text_content` longtext,
  `is_active` tinyint(1) NOT NULL,
  `is_default` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `generated_reports`
--

CREATE TABLE `generated_reports` (
  `id` char(32) NOT NULL,
  `report_type` varchar(50) NOT NULL,
  `report_name` varchar(200) NOT NULL,
  `format` varchar(10) NOT NULL,
  `file_path` varchar(100) NOT NULL,
  `file_size` int UNSIGNED DEFAULT NULL,
  `parameters` json DEFAULT NULL,
  `generated_at` datetime(6) NOT NULL,
  `generated_by_id` char(32) DEFAULT NULL
) ;

-- --------------------------------------------------------

--
-- Table structure for table `loans`
--

CREATE TABLE `loans` (
  `id` char(32) NOT NULL,
  `loan_number` varchar(20) NOT NULL,
  `principal_amount` decimal(12,2) NOT NULL,
  `interest_amount` decimal(12,2) NOT NULL,
  `processing_fee` decimal(12,2) NOT NULL,
  `total_amount` decimal(12,2) NOT NULL,
  `disbursement_date` datetime(6) NOT NULL,
  `due_date` datetime(6) NOT NULL,
  `duration_days` int UNSIGNED NOT NULL,
  `status` varchar(20) NOT NULL,
  `amount_paid` decimal(12,2) NOT NULL,
  `last_payment_date` datetime(6) DEFAULT NULL,
  `is_rolled_over` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL,
  `borrower_id` char(32) NOT NULL,
  `original_loan_id` char(32) DEFAULT NULL,
  `application_id` char(32) NOT NULL
) ;

--
-- Dumping data for table `loans`
--

INSERT INTO `loans` (`id`, `loan_number`, `principal_amount`, `interest_amount`, `processing_fee`, `total_amount`, `disbursement_date`, `due_date`, `duration_days`, `status`, `amount_paid`, `last_payment_date`, `is_rolled_over`, `created_at`, `updated_at`, `borrower_id`, `original_loan_id`, `application_id`) VALUES
('630433a7dec04c2e8c1b33ccc8407a60', 'LOAN-630433', 21000.00, 4200.00, 1050.00, 26250.00, '2025-08-16 14:25:52.445070', '2025-09-15 14:25:52.445072', 30, 'active', 0.00, NULL, 0, '2025-08-16 14:25:52.446072', '2025-08-16 14:25:52.446530', '74b15bae95bc41b9a81eeb17322232a8', NULL, 'd2153167d9214ec9ae6e32f6827c7095'),
('9e5c761d148d407aa895c7ff58ebeafb', 'LOAN-9E5C76', 46000.00, 9200.00, 2300.00, 57500.00, '2025-08-16 14:33:38.582023', '2025-09-15 14:33:38.582025', 30, 'active', 1000.00, '2025-08-16 14:34:38.138052', 0, '2025-08-16 14:33:38.582988', '2025-08-16 14:34:38.138630', '74b15bae95bc41b9a81eeb17322232a8', NULL, '34c164ef143242989c3156562d903ace');

-- --------------------------------------------------------

--
-- Table structure for table `loan_applications`
--

CREATE TABLE `loan_applications` (
  `id` char(32) NOT NULL,
  `application_number` varchar(20) NOT NULL,
  `requested_amount` decimal(12,2) NOT NULL,
  `requested_duration` int UNSIGNED NOT NULL,
  `purpose` longtext NOT NULL,
  `interest_amount` decimal(12,2) DEFAULT NULL,
  `processing_fee_amount` decimal(12,2) DEFAULT NULL,
  `total_amount` decimal(12,2) DEFAULT NULL,
  `status` varchar(20) NOT NULL,
  `submitted_at` datetime(6) NOT NULL,
  `reviewed_at` datetime(6) DEFAULT NULL,
  `approval_notes` longtext,
  `supporting_documents` varchar(100) DEFAULT NULL,
  `auto_approved` tinyint(1) NOT NULL,
  `credit_score` int UNSIGNED DEFAULT NULL,
  `borrower_id` char(32) NOT NULL,
  `reviewed_by_id` char(32) DEFAULT NULL,
  `loan_product_id` char(32) NOT NULL,
  `repayment_method` varchar(20) NOT NULL
) ;

--
-- Dumping data for table `loan_applications`
--

INSERT INTO `loan_applications` (`id`, `application_number`, `requested_amount`, `requested_duration`, `purpose`, `interest_amount`, `processing_fee_amount`, `total_amount`, `status`, `submitted_at`, `reviewed_at`, `approval_notes`, `supporting_documents`, `auto_approved`, `credit_score`, `borrower_id`, `reviewed_by_id`, `loan_product_id`, `repayment_method`) VALUES
('34c164ef143242989c3156562d903ace', 'APP-000002', 46000.00, 30, 'Business Expansion', 9200.00, 2300.00, 57500.00, 'approved', '2025-08-16 14:31:29.599738', '2025-08-16 14:33:38.581150', '', '', 0, NULL, '74b15bae95bc41b9a81eeb17322232a8', '61c4412f980d4495b5b55fe2f80859cf', '1f3bf5437bec4503a5797116c37afacc', 'weekly'),
('d2153167d9214ec9ae6e32f6827c7095', 'APP-000001', 21000.00, 30, 'Equipment Purchase', 4200.00, 1050.00, 26250.00, 'approved', '2025-08-16 14:25:17.141960', '2025-08-16 14:25:52.444209', '', '', 0, NULL, '74b15bae95bc41b9a81eeb17322232a8', '61c4412f980d4495b5b55fe2f80859cf', '1f3bf5437bec4503a5797116c37afacc', 'weekly');

-- --------------------------------------------------------

--
-- Table structure for table `loan_products`
--

CREATE TABLE `loan_products` (
  `id` char(32) NOT NULL,
  `name` varchar(200) NOT NULL,
  `product_type` varchar(20) NOT NULL,
  `description` longtext NOT NULL,
  `min_amount` decimal(12,2) NOT NULL,
  `max_amount` decimal(12,2) NOT NULL,
  `interest_rate` decimal(5,2) NOT NULL,
  `processing_fee` decimal(5,2) NOT NULL,
  `late_payment_penalty` decimal(5,2) NOT NULL,
  `min_duration` int UNSIGNED NOT NULL,
  `max_duration` int UNSIGNED NOT NULL,
  `requires_guarantor` tinyint(1) NOT NULL,
  `requires_collateral` tinyint(1) NOT NULL,
  `minimum_income` decimal(12,2) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL,
  `available_repayment_methods` json NOT NULL DEFAULT (_utf8mb4'[]'),
  `duration_months` int UNSIGNED NOT NULL,
  `max_rollover_count` int UNSIGNED NOT NULL,
  `max_rollover_days` int UNSIGNED NOT NULL,
  `rollover_fee_percentage` decimal(5,2) NOT NULL
) ;

--
-- Dumping data for table `loan_products`
--

INSERT INTO `loan_products` (`id`, `name`, `product_type`, `description`, `min_amount`, `max_amount`, `interest_rate`, `processing_fee`, `late_payment_penalty`, `min_duration`, `max_duration`, `requires_guarantor`, `requires_collateral`, `minimum_income`, `is_active`, `created_at`, `updated_at`, `available_repayment_methods`, `duration_months`, `max_rollover_count`, `max_rollover_days`, `rollover_fee_percentage`) VALUES
('1f3bf5437bec4503a5797116c37afacc', 'Boost', 'boost', 'Quick 1-month loan with flexible repayment options. Perfect for short-term financial needs.', 1000.00, 50000.00, 20.00, 5.00, 5.00, 30, 30, 0, 0, NULL, 1, '2025-08-16 12:59:05.596369', '2025-08-16 12:59:05.596397', '[\"daily\", \"weekly\", \"monthly\"]', 1, 3, 30, 5.00),
('9dcc8914621443ff89ad16885171c6c3', 'Imara', 'imara', '6-month loan with monthly repayment. Perfect for long-term financial planning.', 10000.00, 500000.00, 10.00, 5.00, 5.00, 180, 180, 0, 0, NULL, 1, '2025-08-16 12:59:05.597560', '2025-08-16 12:59:05.597572', '[\"monthly\"]', 6, 3, 30, 5.00),
('f192e325f6e349168346d61ec9cd9e53', 'Mwamba', 'mwamba', '3-month loan with weekly or monthly repayment options. Ideal for medium-term financing.', 5000.00, 200000.00, 20.00, 5.00, 5.00, 90, 90, 0, 0, NULL, 1, '2025-08-16 12:59:05.597025', '2025-08-16 12:59:05.597038', '[\"weekly\", \"monthly\"]', 3, 3, 30, 5.00);

-- --------------------------------------------------------

--
-- Table structure for table `loan_scoring`
--

CREATE TABLE `loan_scoring` (
  `id` char(32) NOT NULL,
  `repayment_history_score` int UNSIGNED NOT NULL,
  `income_score` int UNSIGNED NOT NULL,
  `rollover_frequency_score` int UNSIGNED NOT NULL,
  `employment_stability_score` int UNSIGNED NOT NULL,
  `total_score` int UNSIGNED NOT NULL,
  `credit_limit` decimal(12,2) NOT NULL,
  `is_eligible` tinyint(1) NOT NULL,
  `risk_level` varchar(20) NOT NULL,
  `calculated_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL,
  `user_id` char(32) NOT NULL
) ;

-- --------------------------------------------------------

--
-- Table structure for table `loan_statements`
--

CREATE TABLE `loan_statements` (
  `id` char(32) NOT NULL,
  `statement_number` varchar(20) NOT NULL,
  `statement_date` datetime(6) NOT NULL,
  `period_from` datetime(6) NOT NULL,
  `period_to` datetime(6) NOT NULL,
  `principal_amount` decimal(12,2) NOT NULL,
  `interest_amount` decimal(12,2) NOT NULL,
  `total_amount` decimal(12,2) NOT NULL,
  `amount_paid` decimal(12,2) NOT NULL,
  `outstanding_balance` decimal(12,2) NOT NULL,
  `pdf_file` varchar(100) DEFAULT NULL,
  `created_at` datetime(6) NOT NULL,
  `borrower_id` char(32) NOT NULL,
  `loan_id` char(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `mpesa_transactions`
--

CREATE TABLE `mpesa_transactions` (
  `id` char(32) NOT NULL,
  `transaction_type` varchar(20) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `phone_number` varchar(17) NOT NULL,
  `mpesa_transaction_id` varchar(50) DEFAULT NULL,
  `merchant_request_id` varchar(50) DEFAULT NULL,
  `checkout_request_id` varchar(50) DEFAULT NULL,
  `status` varchar(20) NOT NULL,
  `result_code` varchar(10) DEFAULT NULL,
  `result_description` longtext,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL,
  `loan_id` char(32) DEFAULT NULL,
  `repayment_id` char(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `mpesa_transactions`
--

INSERT INTO `mpesa_transactions` (`id`, `transaction_type`, `amount`, `phone_number`, `mpesa_transaction_id`, `merchant_request_id`, `checkout_request_id`, `status`, `result_code`, `result_description`, `created_at`, `updated_at`, `loan_id`, `repayment_id`) VALUES
('2e059e6e91a74ccca060e1384974f888', '', 1000.00, '', NULL, NULL, NULL, 'completed', NULL, NULL, '2025-08-16 14:34:38.140106', '2025-08-16 14:34:38.140116', NULL, '72177e2fd1b841ce9a612af1e2173342');

-- --------------------------------------------------------

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` char(32) NOT NULL,
  `notification_type` varchar(30) NOT NULL,
  `title` varchar(200) NOT NULL,
  `message` longtext NOT NULL,
  `channel` varchar(20) NOT NULL,
  `is_sent` tinyint(1) NOT NULL,
  `sent_at` datetime(6) DEFAULT NULL,
  `created_at` datetime(6) NOT NULL,
  `related_application_id` char(32) DEFAULT NULL,
  `related_loan_id` char(32) DEFAULT NULL,
  `user_id` char(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `offer_letters`
--

CREATE TABLE `offer_letters` (
  `id` char(32) NOT NULL,
  `offer_number` varchar(20) NOT NULL,
  `loan_amount` decimal(12,2) NOT NULL,
  `interest_rate` decimal(5,2) NOT NULL,
  `duration_days` int UNSIGNED NOT NULL,
  `processing_fee` decimal(12,2) NOT NULL,
  `total_amount` decimal(12,2) NOT NULL,
  `terms_conditions` longtext NOT NULL,
  `special_conditions` longtext,
  `status` varchar(20) NOT NULL,
  `valid_until` datetime(6) NOT NULL,
  `pdf_file` varchar(100) DEFAULT NULL,
  `borrower_signature` longtext,
  `signed_at` datetime(6) DEFAULT NULL,
  `created_at` datetime(6) NOT NULL,
  `sent_at` datetime(6) DEFAULT NULL,
  `application_id` char(32) NOT NULL,
  `borrower_id` char(32) NOT NULL
) ;

-- --------------------------------------------------------

--
-- Table structure for table `otp_verifications`
--

CREATE TABLE `otp_verifications` (
  `id` bigint NOT NULL,
  `otp_code` varchar(6) NOT NULL,
  `is_used` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `expires_at` datetime(6) NOT NULL,
  `user_id` char(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `receipts`
--

CREATE TABLE `receipts` (
  `id` char(32) NOT NULL,
  `receipt_number` varchar(20) NOT NULL,
  `amount_paid` decimal(12,2) NOT NULL,
  `payment_method` varchar(20) NOT NULL,
  `payment_date` datetime(6) NOT NULL,
  `previous_balance` decimal(12,2) NOT NULL,
  `new_balance` decimal(12,2) NOT NULL,
  `pdf_file` varchar(100) DEFAULT NULL,
  `created_at` datetime(6) NOT NULL,
  `borrower_id` char(32) NOT NULL,
  `loan_id` char(32) NOT NULL,
  `repayment_id` char(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

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

CREATE TABLE `repayments` (
  `id` char(32) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `payment_method` varchar(20) NOT NULL,
  `mpesa_transaction_id` varchar(50) DEFAULT NULL,
  `mpesa_phone_number` varchar(17) DEFAULT NULL,
  `receipt_number` varchar(20) NOT NULL,
  `payment_date` datetime(6) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `loan_id` char(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `repayments` (`id`, `amount`, `payment_method`, `mpesa_transaction_id`, `mpesa_phone_number`, `receipt_number`, `payment_date`, `created_at`, `loan_id`) VALUES
('72177e2fd1b841ce9a612af1e2173342', 1000.00, 'mpesa', NULL, NULL, 'RCP-000001', '2025-08-16 14:34:38.138052', '2025-08-16 14:34:38.138068', '9e5c761d148d407aa895c7ff58ebeafb');

-- --------------------------------------------------------

--
-- Table structure for table `report_templates`
--

CREATE TABLE `report_templates` (
  `id` char(32) NOT NULL,
  `name` varchar(200) NOT NULL,
  `report_type` varchar(30) NOT NULL,
  `description` longtext,
  `template_file` varchar(100) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `role_permissions`
--

CREATE TABLE `role_permissions` (
  `id` bigint NOT NULL,
  `role` varchar(20) NOT NULL,
  `module` varchar(20) NOT NULL,
  `action` varchar(20) NOT NULL,
  `is_allowed` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `role_permissions`
--

INSERT INTO `role_permissions` (`id`, `role`, `module`, `action`, `is_allowed`, `created_at`, `updated_at`) VALUES
(801, 'admin', 'users', 'view', 1, '2025-08-16 12:54:31.798459', '2025-08-16 12:54:31.798493'),
(802, 'admin', 'users', 'create', 1, '2025-08-16 12:54:31.799649', '2025-08-16 12:54:31.799660'),
(803, 'admin', 'users', 'edit', 1, '2025-08-16 12:54:31.800695', '2025-08-16 12:54:31.800705'),
(804, 'admin', 'users', 'delete', 1, '2025-08-16 12:54:31.801739', '2025-08-16 12:54:31.801757'),
(805, 'admin', 'users', 'manage', 1, '2025-08-16 12:54:31.802777', '2025-08-16 12:54:31.802787'),
(806, 'admin', 'loans', 'view', 1, '2025-08-16 12:54:31.803790', '2025-08-16 12:54:31.803800'),
(807, 'admin', 'loans', 'create', 1, '2025-08-16 12:54:31.804784', '2025-08-16 12:54:31.804794'),
(808, 'admin', 'loans', 'edit', 1, '2025-08-16 12:54:31.805872', '2025-08-16 12:54:31.805883'),
(809, 'admin', 'loans', 'delete', 1, '2025-08-16 12:54:31.806904', '2025-08-16 12:54:31.806915'),
(810, 'admin', 'loans', 'approve', 1, '2025-08-16 12:54:31.807943', '2025-08-16 12:54:31.807953'),
(811, 'admin', 'loans', 'reject', 1, '2025-08-16 12:54:31.808988', '2025-08-16 12:54:31.808998'),
(812, 'admin', 'loans', 'manage', 1, '2025-08-16 12:54:31.809990', '2025-08-16 12:54:31.810000'),
(813, 'admin', 'reports', 'view', 1, '2025-08-16 12:54:31.810982', '2025-08-16 12:54:31.810991'),
(814, 'admin', 'reports', 'create', 1, '2025-08-16 12:54:31.811969', '2025-08-16 12:54:31.811980'),
(815, 'admin', 'reports', 'edit', 1, '2025-08-16 12:54:31.813066', '2025-08-16 12:54:31.813076'),
(816, 'admin', 'reports', 'delete', 1, '2025-08-16 12:54:31.814076', '2025-08-16 12:54:31.814086'),
(817, 'admin', 'reports', 'export', 1, '2025-08-16 12:54:31.815084', '2025-08-16 12:54:31.815095'),
(818, 'admin', 'reports', 'manage', 1, '2025-08-16 12:54:31.816243', '2025-08-16 12:54:31.816257'),
(819, 'admin', 'documents', 'view', 1, '2025-08-16 12:54:31.817395', '2025-08-16 12:54:31.817405'),
(820, 'admin', 'documents', 'create', 1, '2025-08-16 12:54:31.818385', '2025-08-16 12:54:31.818395'),
(821, 'admin', 'documents', 'edit', 1, '2025-08-16 12:54:31.819390', '2025-08-16 12:54:31.819404'),
(822, 'admin', 'documents', 'delete', 1, '2025-08-16 12:54:31.820400', '2025-08-16 12:54:31.820410'),
(823, 'admin', 'documents', 'manage', 1, '2025-08-16 12:54:31.821430', '2025-08-16 12:54:31.821440'),
(824, 'admin', 'settings', 'view', 1, '2025-08-16 12:54:31.822451', '2025-08-16 12:54:31.822461'),
(825, 'admin', 'settings', 'create', 1, '2025-08-16 12:54:31.823477', '2025-08-16 12:54:31.823487'),
(826, 'admin', 'settings', 'edit', 1, '2025-08-16 12:54:31.824480', '2025-08-16 12:54:31.824489'),
(827, 'admin', 'settings', 'delete', 1, '2025-08-16 12:54:31.825476', '2025-08-16 12:54:31.825486'),
(828, 'admin', 'settings', 'manage', 1, '2025-08-16 12:54:31.826480', '2025-08-16 12:54:31.826490'),
(829, 'admin', 'notifications', 'view', 1, '2025-08-16 12:54:31.827501', '2025-08-16 12:54:31.827513'),
(830, 'admin', 'notifications', 'create', 1, '2025-08-16 12:54:31.828529', '2025-08-16 12:54:31.828540'),
(831, 'admin', 'notifications', 'edit', 1, '2025-08-16 12:54:31.829591', '2025-08-16 12:54:31.829602'),
(832, 'admin', 'notifications', 'delete', 1, '2025-08-16 12:54:31.830677', '2025-08-16 12:54:31.830687'),
(833, 'admin', 'notifications', 'manage', 1, '2025-08-16 12:54:31.831786', '2025-08-16 12:54:31.831797'),
(834, 'admin', 'audit', 'view', 1, '2025-08-16 12:54:31.832964', '2025-08-16 12:54:31.832978'),
(835, 'admin', 'audit', 'create', 1, '2025-08-16 12:54:31.834270', '2025-08-16 12:54:31.834284'),
(836, 'admin', 'audit', 'edit', 1, '2025-08-16 12:54:31.835539', '2025-08-16 12:54:31.835552'),
(837, 'admin', 'audit', 'delete', 1, '2025-08-16 12:54:31.836653', '2025-08-16 12:54:31.836663'),
(838, 'admin', 'audit', 'export', 1, '2025-08-16 12:54:31.837644', '2025-08-16 12:54:31.837654'),
(839, 'admin', 'audit', 'manage', 1, '2025-08-16 12:54:31.838652', '2025-08-16 12:54:31.838662'),
(840, 'admin', 'kyc', 'view', 1, '2025-08-16 12:54:31.839641', '2025-08-16 12:54:31.839651'),
(841, 'admin', 'kyc', 'create', 1, '2025-08-16 12:54:31.840663', '2025-08-16 12:54:31.840673'),
(842, 'admin', 'kyc', 'edit', 1, '2025-08-16 12:54:31.841687', '2025-08-16 12:54:31.841697'),
(843, 'admin', 'kyc', 'delete', 1, '2025-08-16 12:54:31.842715', '2025-08-16 12:54:31.842725'),
(844, 'admin', 'kyc', 'approve', 1, '2025-08-16 12:54:31.844130', '2025-08-16 12:54:31.844146'),
(845, 'admin', 'kyc', 'reject', 1, '2025-08-16 12:54:31.845372', '2025-08-16 12:54:31.845384'),
(846, 'admin', 'kyc', 'manage', 1, '2025-08-16 12:54:31.846419', '2025-08-16 12:54:31.846428'),
(847, 'admin', 'payments', 'view', 1, '2025-08-16 12:54:31.847459', '2025-08-16 12:54:31.847469'),
(848, 'admin', 'payments', 'create', 1, '2025-08-16 12:54:31.848474', '2025-08-16 12:54:31.848484'),
(849, 'admin', 'payments', 'edit', 1, '2025-08-16 12:54:31.849491', '2025-08-16 12:54:31.849501'),
(850, 'admin', 'payments', 'delete', 1, '2025-08-16 12:54:31.850498', '2025-08-16 12:54:31.850508'),
(851, 'admin', 'payments', 'approve', 1, '2025-08-16 12:54:31.851506', '2025-08-16 12:54:31.851516'),
(852, 'admin', 'payments', 'reject', 1, '2025-08-16 12:54:31.852519', '2025-08-16 12:54:31.852528'),
(853, 'admin', 'payments', 'manage', 1, '2025-08-16 12:54:31.853548', '2025-08-16 12:54:31.853560'),
(854, 'admin', 'communications', 'view', 1, '2025-08-16 12:54:31.854577', '2025-08-16 12:54:31.854588'),
(855, 'admin', 'communications', 'create', 1, '2025-08-16 12:54:31.855608', '2025-08-16 12:54:31.855619'),
(856, 'admin', 'communications', 'edit', 1, '2025-08-16 12:54:31.856636', '2025-08-16 12:54:31.856646'),
(857, 'admin', 'communications', 'delete', 1, '2025-08-16 12:54:31.857670', '2025-08-16 12:54:31.857680'),
(858, 'admin', 'communications', 'manage', 1, '2025-08-16 12:54:31.858706', '2025-08-16 12:54:31.858716'),
(859, 'team_leader', 'users', 'view', 1, '2025-08-16 12:54:31.859740', '2025-08-16 12:54:31.859755'),
(860, 'team_leader', 'users', 'create', 1, '2025-08-16 12:54:31.860776', '2025-08-16 12:54:31.860787'),
(861, 'team_leader', 'users', 'edit', 1, '2025-08-16 12:54:31.861808', '2025-08-16 12:54:31.861819'),
(862, 'team_leader', 'loans', 'view', 1, '2025-08-16 12:54:31.862830', '2025-08-16 12:54:31.862840'),
(863, 'team_leader', 'loans', 'create', 1, '2025-08-16 12:54:31.863861', '2025-08-16 12:54:31.863871'),
(864, 'team_leader', 'loans', 'edit', 1, '2025-08-16 12:54:31.864876', '2025-08-16 12:54:31.864886'),
(865, 'team_leader', 'loans', 'approve', 1, '2025-08-16 12:54:31.865897', '2025-08-16 12:54:31.865907'),
(866, 'team_leader', 'loans', 'reject', 1, '2025-08-16 12:54:31.867000', '2025-08-16 12:54:31.867011'),
(867, 'team_leader', 'reports', 'view', 1, '2025-08-16 12:54:31.868048', '2025-08-16 12:54:31.868060'),
(868, 'team_leader', 'reports', 'create', 1, '2025-08-16 12:54:31.869163', '2025-08-16 12:54:31.869174'),
(869, 'team_leader', 'reports', 'edit', 1, '2025-08-16 12:54:31.870208', '2025-08-16 12:54:31.870219'),
(870, 'team_leader', 'reports', 'export', 1, '2025-08-16 12:54:31.871309', '2025-08-16 12:54:31.871320'),
(871, 'team_leader', 'documents', 'view', 1, '2025-08-16 12:54:31.872373', '2025-08-16 12:54:31.872384'),
(872, 'team_leader', 'documents', 'create', 1, '2025-08-16 12:54:31.873632', '2025-08-16 12:54:31.873645'),
(873, 'team_leader', 'documents', 'edit', 1, '2025-08-16 12:54:31.874882', '2025-08-16 12:54:31.874893'),
(874, 'team_leader', 'settings', 'view', 1, '2025-08-16 12:54:31.875956', '2025-08-16 12:54:31.875967'),
(875, 'team_leader', 'notifications', 'view', 1, '2025-08-16 12:54:31.876982', '2025-08-16 12:54:31.876992'),
(876, 'team_leader', 'notifications', 'create', 1, '2025-08-16 12:54:31.878027', '2025-08-16 12:54:31.878038'),
(877, 'team_leader', 'notifications', 'edit', 1, '2025-08-16 12:54:31.879054', '2025-08-16 12:54:31.879065'),
(878, 'team_leader', 'audit', 'view', 1, '2025-08-16 12:54:31.880074', '2025-08-16 12:54:31.880084'),
(879, 'team_leader', 'audit', 'export', 1, '2025-08-16 12:54:31.881099', '2025-08-16 12:54:31.881110'),
(880, 'team_leader', 'kyc', 'view', 1, '2025-08-16 12:54:31.882113', '2025-08-16 12:54:31.882123'),
(881, 'team_leader', 'kyc', 'create', 1, '2025-08-16 12:54:31.883112', '2025-08-16 12:54:31.883122'),
(882, 'team_leader', 'kyc', 'edit', 1, '2025-08-16 12:54:31.884117', '2025-08-16 12:54:31.884128'),
(883, 'team_leader', 'kyc', 'approve', 1, '2025-08-16 12:54:31.885121', '2025-08-16 12:54:31.885132'),
(884, 'team_leader', 'kyc', 'reject', 1, '2025-08-16 12:54:31.886130', '2025-08-16 12:54:31.886140'),
(885, 'team_leader', 'payments', 'view', 1, '2025-08-16 12:54:31.887170', '2025-08-16 12:54:31.887180'),
(886, 'team_leader', 'payments', 'create', 1, '2025-08-16 12:54:31.888188', '2025-08-16 12:54:31.888198'),
(887, 'team_leader', 'payments', 'edit', 1, '2025-08-16 12:54:31.889192', '2025-08-16 12:54:31.889202'),
(888, 'team_leader', 'payments', 'approve', 1, '2025-08-16 12:54:31.890205', '2025-08-16 12:54:31.890216'),
(889, 'team_leader', 'payments', 'reject', 1, '2025-08-16 12:54:31.891200', '2025-08-16 12:54:31.891210'),
(890, 'team_leader', 'communications', 'view', 1, '2025-08-16 12:54:31.892207', '2025-08-16 12:54:31.892217'),
(891, 'team_leader', 'communications', 'create', 1, '2025-08-16 12:54:31.893226', '2025-08-16 12:54:31.893236'),
(892, 'team_leader', 'communications', 'edit', 1, '2025-08-16 12:54:31.894229', '2025-08-16 12:54:31.894239'),
(893, 'loan_officer', 'users', 'view', 1, '2025-08-16 12:54:31.895297', '2025-08-16 12:54:31.895307'),
(894, 'loan_officer', 'users', 'create', 1, '2025-08-16 12:54:31.896326', '2025-08-16 12:54:31.896336'),
(895, 'loan_officer', 'users', 'edit', 1, '2025-08-16 12:54:31.897593', '2025-08-16 12:54:31.897604'),
(896, 'loan_officer', 'loans', 'view', 1, '2025-08-16 12:54:31.898913', '2025-08-16 12:54:31.898925'),
(897, 'loan_officer', 'loans', 'create', 1, '2025-08-16 12:54:31.900054', '2025-08-16 12:54:31.900064'),
(898, 'loan_officer', 'loans', 'edit', 1, '2025-08-16 12:54:31.901122', '2025-08-16 12:54:31.901132'),
(899, 'loan_officer', 'loans', 'approve', 1, '2025-08-16 12:54:31.902157', '2025-08-16 12:54:31.902167'),
(900, 'loan_officer', 'loans', 'reject', 1, '2025-08-16 12:54:31.903239', '2025-08-16 12:54:31.903250'),
(901, 'loan_officer', 'reports', 'view', 1, '2025-08-16 12:54:31.904303', '2025-08-16 12:54:31.904313'),
(902, 'loan_officer', 'reports', 'export', 1, '2025-08-16 12:54:31.905332', '2025-08-16 12:54:31.905343'),
(903, 'loan_officer', 'documents', 'view', 1, '2025-08-16 12:54:31.906382', '2025-08-16 12:54:31.906393'),
(904, 'loan_officer', 'documents', 'create', 1, '2025-08-16 12:54:31.907393', '2025-08-16 12:54:31.907404'),
(905, 'loan_officer', 'documents', 'edit', 1, '2025-08-16 12:54:31.908412', '2025-08-16 12:54:31.908423'),
(906, 'loan_officer', 'notifications', 'view', 1, '2025-08-16 12:54:31.909424', '2025-08-16 12:54:31.909434'),
(907, 'loan_officer', 'notifications', 'create', 1, '2025-08-16 12:54:31.910416', '2025-08-16 12:54:31.910426'),
(908, 'loan_officer', 'audit', 'view', 1, '2025-08-16 12:54:31.911414', '2025-08-16 12:54:31.911425'),
(909, 'loan_officer', 'kyc', 'view', 1, '2025-08-16 12:54:31.912417', '2025-08-16 12:54:31.912427'),
(910, 'loan_officer', 'kyc', 'create', 1, '2025-08-16 12:54:31.913399', '2025-08-16 12:54:31.913409'),
(911, 'loan_officer', 'kyc', 'edit', 1, '2025-08-16 12:54:31.914396', '2025-08-16 12:54:31.914406'),
(912, 'loan_officer', 'kyc', 'approve', 1, '2025-08-16 12:54:31.915385', '2025-08-16 12:54:31.915397'),
(913, 'loan_officer', 'kyc', 'reject', 1, '2025-08-16 12:54:31.916363', '2025-08-16 12:54:31.916374'),
(914, 'loan_officer', 'payments', 'view', 1, '2025-08-16 12:54:31.917364', '2025-08-16 12:54:31.917375'),
(915, 'loan_officer', 'payments', 'create', 1, '2025-08-16 12:54:31.918349', '2025-08-16 12:54:31.918359'),
(916, 'loan_officer', 'payments', 'edit', 1, '2025-08-16 12:54:31.919487', '2025-08-16 12:54:31.919501'),
(917, 'loan_officer', 'communications', 'view', 1, '2025-08-16 12:54:31.920690', '2025-08-16 12:54:31.920701'),
(918, 'loan_officer', 'communications', 'create', 1, '2025-08-16 12:54:31.921719', '2025-08-16 12:54:31.921729'),
(919, 'secretary', 'users', 'view', 1, '2025-08-16 12:54:31.922847', '2025-08-16 12:54:31.922858'),
(920, 'secretary', 'users', 'create', 1, '2025-08-16 12:54:31.924027', '2025-08-16 12:54:31.924040'),
(921, 'secretary', 'users', 'edit', 1, '2025-08-16 12:54:31.925287', '2025-08-16 12:54:31.925303'),
(922, 'secretary', 'loans', 'view', 1, '2025-08-16 12:54:31.926370', '2025-08-16 12:54:31.926381'),
(923, 'secretary', 'loans', 'create', 1, '2025-08-16 12:54:31.927399', '2025-08-16 12:54:31.927410'),
(924, 'secretary', 'loans', 'edit', 1, '2025-08-16 12:54:31.928425', '2025-08-16 12:54:31.928436'),
(925, 'secretary', 'reports', 'view', 1, '2025-08-16 12:54:31.929490', '2025-08-16 12:54:31.929501'),
(926, 'secretary', 'reports', 'export', 1, '2025-08-16 12:54:31.930786', '2025-08-16 12:54:31.930806'),
(927, 'secretary', 'documents', 'view', 1, '2025-08-16 12:54:31.931935', '2025-08-16 12:54:31.931945'),
(928, 'secretary', 'documents', 'create', 1, '2025-08-16 12:54:31.932950', '2025-08-16 12:54:31.932964'),
(929, 'secretary', 'documents', 'edit', 1, '2025-08-16 12:54:31.934128', '2025-08-16 12:54:31.934138'),
(930, 'secretary', 'notifications', 'view', 1, '2025-08-16 12:54:31.935165', '2025-08-16 12:54:31.935175'),
(931, 'secretary', 'notifications', 'create', 1, '2025-08-16 12:54:31.936195', '2025-08-16 12:54:31.936205'),
(932, 'secretary', 'audit', 'view', 1, '2025-08-16 12:54:31.937244', '2025-08-16 12:54:31.937254'),
(933, 'secretary', 'kyc', 'view', 1, '2025-08-16 12:54:31.938254', '2025-08-16 12:54:31.938264'),
(934, 'secretary', 'kyc', 'create', 1, '2025-08-16 12:54:31.939278', '2025-08-16 12:54:31.939288'),
(935, 'secretary', 'kyc', 'edit', 1, '2025-08-16 12:54:31.940421', '2025-08-16 12:54:31.940432'),
(936, 'secretary', 'payments', 'view', 1, '2025-08-16 12:54:31.941578', '2025-08-16 12:54:31.941596'),
(937, 'secretary', 'payments', 'create', 1, '2025-08-16 12:54:31.942948', '2025-08-16 12:54:31.942963'),
(938, 'secretary', 'communications', 'view', 1, '2025-08-16 12:54:31.944227', '2025-08-16 12:54:31.944239'),
(939, 'secretary', 'communications', 'create', 1, '2025-08-16 12:54:31.945296', '2025-08-16 12:54:31.945306'),
(940, 'auditor', 'users', 'view', 1, '2025-08-16 12:54:31.946371', '2025-08-16 12:54:31.946381'),
(941, 'auditor', 'loans', 'view', 1, '2025-08-16 12:54:31.947430', '2025-08-16 12:54:31.947440'),
(942, 'auditor', 'reports', 'view', 1, '2025-08-16 12:54:31.948524', '2025-08-16 12:54:31.948534'),
(943, 'auditor', 'reports', 'export', 1, '2025-08-16 12:54:31.949569', '2025-08-16 12:54:31.949579'),
(944, 'auditor', 'documents', 'view', 1, '2025-08-16 12:54:31.950592', '2025-08-16 12:54:31.950602'),
(945, 'auditor', 'settings', 'view', 1, '2025-08-16 12:54:31.951612', '2025-08-16 12:54:31.951623'),
(946, 'auditor', 'notifications', 'view', 1, '2025-08-16 12:54:31.952659', '2025-08-16 12:54:31.952669'),
(947, 'auditor', 'audit', 'view', 1, '2025-08-16 12:54:31.953694', '2025-08-16 12:54:31.953705'),
(948, 'auditor', 'audit', 'export', 1, '2025-08-16 12:54:31.954704', '2025-08-16 12:54:31.954714'),
(949, 'auditor', 'kyc', 'view', 1, '2025-08-16 12:54:31.955706', '2025-08-16 12:54:31.955717'),
(950, 'auditor', 'payments', 'view', 1, '2025-08-16 12:54:31.956723', '2025-08-16 12:54:31.956733'),
(951, 'auditor', 'communications', 'view', 1, '2025-08-16 12:54:31.957722', '2025-08-16 12:54:31.957732'),
(952, 'borrower', 'users', 'view', 1, '2025-08-16 12:54:31.958784', '2025-08-16 12:54:31.958795'),
(953, 'borrower', 'loans', 'view', 1, '2025-08-16 12:54:31.959856', '2025-08-16 12:54:31.959867'),
(954, 'borrower', 'documents', 'view', 1, '2025-08-16 12:54:31.960927', '2025-08-16 12:54:31.960937'),
(955, 'borrower', 'notifications', 'view', 1, '2025-08-16 12:54:31.961974', '2025-08-16 12:54:31.961985'),
(956, 'borrower', 'kyc', 'view', 1, '2025-08-16 12:54:31.963012', '2025-08-16 12:54:31.963022'),
(957, 'borrower', 'kyc', 'create', 1, '2025-08-16 12:54:31.964063', '2025-08-16 12:54:31.964073'),
(958, 'borrower', 'kyc', 'edit', 1, '2025-08-16 12:54:31.965201', '2025-08-16 12:54:31.965213'),
(959, 'borrower', 'payments', 'view', 1, '2025-08-16 12:54:31.966241', '2025-08-16 12:54:31.966252'),
(960, 'borrower', 'communications', 'view', 1, '2025-08-16 12:54:31.967326', '2025-08-16 12:54:31.967336');

-- --------------------------------------------------------

--
-- Table structure for table `rollover_requests`
--

CREATE TABLE `rollover_requests` (
  `id` char(32) NOT NULL,
  `requested_duration` int UNSIGNED NOT NULL,
  `reason` longtext NOT NULL,
  `rollover_fee` decimal(12,2) DEFAULT NULL,
  `status` varchar(20) NOT NULL,
  `reviewed_at` datetime(6) DEFAULT NULL,
  `review_notes` longtext,
  `requested_at` datetime(6) NOT NULL,
  `borrower_id` char(32) NOT NULL,
  `loan_id` char(32) NOT NULL,
  `reviewed_by_id` char(32) DEFAULT NULL
) ;

-- --------------------------------------------------------

--
-- Table structure for table `sms_templates`
--

CREATE TABLE `sms_templates` (
  `id` char(32) NOT NULL,
  `name` varchar(200) NOT NULL,
  `template_type` varchar(30) NOT NULL,
  `message_template` longtext NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `is_default` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `system_settings`
--

CREATE TABLE `system_settings` (
  `id` char(32) NOT NULL,
  `default_interest_rate` decimal(5,2) NOT NULL,
  `default_processing_fee` decimal(5,2) NOT NULL,
  `default_late_penalty` decimal(5,2) NOT NULL,
  `rollover_fee_percentage` decimal(5,2) NOT NULL,
  `max_rollover_days` int UNSIGNED NOT NULL,
  `max_rollover_count` int UNSIGNED NOT NULL,
  `auto_approval_enabled` tinyint(1) NOT NULL,
  `auto_approval_min_score` int UNSIGNED NOT NULL,
  `auto_approval_max_amount` decimal(12,2) NOT NULL,
  `email_notifications_enabled` tinyint(1) NOT NULL,
  `sms_notifications_enabled` tinyint(1) NOT NULL,
  `mpesa_business_shortcode` varchar(10) DEFAULT NULL,
  `mpesa_passkey` varchar(100) DEFAULT NULL,
  `mpesa_environment` varchar(20) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL
) ;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` char(32) NOT NULL,
  `password` varchar(128) NOT NULL,
  `last_login` datetime(6) DEFAULT NULL,
  `is_superuser` tinyint(1) NOT NULL,
  `username` varchar(150) NOT NULL,
  `first_name` varchar(150) NOT NULL,
  `last_name` varchar(150) NOT NULL,
  `is_staff` tinyint(1) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `date_joined` datetime(6) NOT NULL,
  `email` varchar(254) DEFAULT NULL,
  `role` varchar(20) NOT NULL,
  `phone_number` varchar(17) NOT NULL,
  `id_number` varchar(20) DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `gender` varchar(10) DEFAULT NULL,
  `marital_status` varchar(20) DEFAULT NULL,
  `nationality` varchar(50) DEFAULT NULL,
  `physical_address` longtext,
  `postal_address` varchar(100) DEFAULT NULL,
  `postal_code` varchar(20) DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  `country` varchar(100) NOT NULL,
  `business_name` varchar(200) DEFAULT NULL,
  `business_type` varchar(100) DEFAULT NULL,
  `business_address` longtext,
  `business_registration_number` varchar(50) DEFAULT NULL,
  `id_document` varchar(100) DEFAULT NULL,
  `selfie` varchar(100) DEFAULT NULL,
  `utility_bill` varchar(100) DEFAULT NULL,
  `bank_statement` varchar(100) DEFAULT NULL,
  `business_license` varchar(100) DEFAULT NULL,
  `tax_certificate` varchar(100) DEFAULT NULL,
  `other_documents` json NOT NULL,
  `status` varchar(20) NOT NULL,
  `is_verified` tinyint(1) NOT NULL,
  `verification_date` datetime(6) DEFAULT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL,
  `employer` varchar(200) DEFAULT NULL,
  `monthly_income` decimal(12,2) DEFAULT NULL,
  `verified_by_id` char(32) DEFAULT NULL,
  `logbook` varchar(100) DEFAULT NULL,
  `signature` varchar(100) DEFAULT NULL,
  `title_deed` varchar(100) DEFAULT NULL,
  `capital_invested` decimal(15,2) DEFAULT NULL,
  `county` varchar(100) DEFAULT NULL,
  `cp_domicile` varchar(200) DEFAULT NULL,
  `declaration_name` varchar(200) DEFAULT NULL,
  `domicile` varchar(200) DEFAULT NULL,
  `expected_turnover` decimal(15,2) DEFAULT NULL,
  `guarantor_id` varchar(50) DEFAULT NULL,
  `guarantor_mobile` varchar(20) DEFAULT NULL,
  `guarantor_name` varchar(200) DEFAULT NULL,
  `guarantor_residence` varchar(200) DEFAULT NULL,
  `guarantor_tel` varchar(20) DEFAULT NULL,
  `nickname` varchar(100) DEFAULT NULL,
  `other_business_type` varchar(200) DEFAULT NULL,
  `personal_pin` varchar(50) DEFAULT NULL,
  `physical_location` varchar(200) DEFAULT NULL,
  `place_of_birth` varchar(200) DEFAULT NULL,
  `postal_code_business` varchar(20) DEFAULT NULL,
  `recommender_id` varchar(50) DEFAULT NULL,
  `recommender_mobile` varchar(20) DEFAULT NULL,
  `recommender_name` varchar(200) DEFAULT NULL,
  `recommender_residence` varchar(200) DEFAULT NULL,
  `recommender_tel` varchar(20) DEFAULT NULL,
  `registration_date` date DEFAULT NULL,
  `source_of_funds` longtext,
  `start_time` time(6) DEFAULT NULL,
  `last_login_at` datetime(6) DEFAULT NULL,
  `is_phone_verified` tinyint(1) DEFAULT '0',
  `is_email_verified` tinyint(1) DEFAULT '0',
  `address` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `password`, `last_login`, `is_superuser`, `username`, `first_name`, `last_name`, `is_staff`, `is_active`, `date_joined`, `email`, `role`, `phone_number`, `id_number`, `date_of_birth`, `gender`, `marital_status`, `nationality`, `physical_address`, `postal_address`, `postal_code`, `city`, `country`, `business_name`, `business_type`, `business_address`, `business_registration_number`, `id_document`, `selfie`, `utility_bill`, `bank_statement`, `business_license`, `tax_certificate`, `other_documents`, `status`, `is_verified`, `verification_date`, `created_at`, `updated_at`, `employer`, `monthly_income`, `verified_by_id`, `logbook`, `signature`, `title_deed`, `capital_invested`, `county`, `cp_domicile`, `declaration_name`, `domicile`, `expected_turnover`, `guarantor_id`, `guarantor_mobile`, `guarantor_name`, `guarantor_residence`, `guarantor_tel`, `nickname`, `other_business_type`, `personal_pin`, `physical_location`, `place_of_birth`, `postal_code_business`, `recommender_id`, `recommender_mobile`, `recommender_name`, `recommender_residence`, `recommender_tel`, `registration_date`, `source_of_funds`, `start_time`, `last_login_at`, `is_phone_verified`, `is_email_verified`, `address`) VALUES
('61c4412f980d4495b5b55fe2f80859cf', 'pbkdf2_sha256$1000000$T3sFpNo4pIUINJsrTT9WaY$jWgA1dP498Q1J63BiPBpnLzhUDs0JRynMUqmUnruRQs=', '2025-09-01 00:27:18.529397', 1, 'admin', 'admin', 'peris', 1, 1, '2025-08-16 12:18:14.617635', 'admin@ruralpoint.co.ke', 'admin', '+254754493153', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Kenya', NULL, NULL, NULL, NULL, '', '', '', '', '', '', '[]', 'active', 0, NULL, '2025-08-16 12:18:14.829081', '2025-08-16 12:54:32.225340', NULL, NULL, NULL, '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, NULL),
('74b15bae95bc41b9a81eeb17322232a8', '!lB5UrldJjJzcurmB0JyF3obMb5g8k2jaFlxYqAgb', NULL, 0, '+2541234567', 'phin', '', 0, 1, '2025-08-16 13:01:33.903412', 'phingish@gmail.com', 'borrower', '+2541234567', '12345678', '2025-08-05', 'M', 'single', 'Kenyan', NULL, NULL, '1234', '1234', 'Kenya', '1234', 'technology', '1234', NULL, 'kyc/id_documents/Untitled.jpg', 'kyc/selfies/Untitled.jpg', 'kyc/utility_bills/Untitled.jpg', 'kyc/bank_statements/Untitled.jpg', '', '', '[]', 'active', 0, NULL, '2025-08-16 13:01:33.904476', '2025-08-16 13:01:33.907034', NULL, NULL, NULL, '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `users_groups`
--

CREATE TABLE `users_groups` (
  `id` bigint NOT NULL,
  `customuser_id` char(32) NOT NULL,
  `group_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `users_user_permissions`
--

CREATE TABLE `users_user_permissions` (
  `id` bigint NOT NULL,
  `customuser_id` char(32) NOT NULL,
  `permission_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_access_logs`
--

CREATE TABLE `user_access_logs` (
  `id` bigint NOT NULL,
  `action` varchar(50) NOT NULL,
  `module` varchar(50) NOT NULL,
  `object_type` varchar(50) DEFAULT NULL,
  `object_id` varchar(50) DEFAULT NULL,
  `description` longtext NOT NULL,
  `ip_address` char(39) DEFAULT NULL,
  `user_agent` varchar(500) DEFAULT NULL,
  `session_id` varchar(100) DEFAULT NULL,
  `accessed_at` datetime(6) NOT NULL,
  `response_time` double DEFAULT NULL,
  `status_code` int DEFAULT NULL,
  `user_id` char(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_access_logs`
--

INSERT INTO `user_access_logs` (`id`, `action`, `module`, `object_type`, `object_id`, `description`, `ip_address`, `user_agent`, `session_id`, `accessed_at`, `response_time`, `status_code`, `user_id`) VALUES
(1, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', 'obubsgcn3h8eult26oss5ugmvaptv1rj', '2025-08-16 12:45:07.528967', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(2, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', 'obubsgcn3h8eult26oss5ugmvaptv1rj', '2025-08-16 12:45:56.815858', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(3, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', 'obubsgcn3h8eult26oss5ugmvaptv1rj', '2025-08-16 12:46:01.565374', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(4, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', 'obubsgcn3h8eult26oss5ugmvaptv1rj', '2025-08-16 12:47:07.081452', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(5, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', 'obubsgcn3h8eult26oss5ugmvaptv1rj', '2025-08-16 12:47:10.169769', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(6, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', 'obubsgcn3h8eult26oss5ugmvaptv1rj', '2025-08-16 12:47:12.672205', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(7, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', 'obubsgcn3h8eult26oss5ugmvaptv1rj', '2025-08-16 12:47:46.648594', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(8, 'update', 'users', 'CustomUser', '61c4412f-980d-4495-b5b5-5fe2f80859cf', 'Updated staff user: admin peris', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', 'obubsgcn3h8eult26oss5ugmvaptv1rj', '2025-08-16 12:47:46.652548', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(9, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', 'obubsgcn3h8eult26oss5ugmvaptv1rj', '2025-08-16 12:47:46.888785', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(10, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '102.135.169.134', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0', '72plm9pocfs04ks35sedji7uar6coyjg', '2025-08-16 12:55:46.161115', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(11, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '105.161.238.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36', '0zbfe4u8ntxrzyjufi39dw0fnh92xiub', '2025-08-16 14:42:33.610266', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(12, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '105.161.238.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36', '0zbfe4u8ntxrzyjufi39dw0fnh92xiub', '2025-08-16 14:42:40.498653', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(13, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '105.161.238.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36', '0zbfe4u8ntxrzyjufi39dw0fnh92xiub', '2025-08-16 14:43:01.565653', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf'),
(14, 'role_access', 'role_check', NULL, NULL, 'Accessed with role: admin', '105.161.238.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36', '0zbfe4u8ntxrzyjufi39dw0fnh92xiub', '2025-08-16 14:43:09.424415', NULL, NULL, '61c4412f980d4495b5b55fe2f80859cf');

-- --------------------------------------------------------

--
-- Table structure for table `utils_auditlog`
--

CREATE TABLE `utils_auditlog` (
  `id` char(32) NOT NULL,
  `action` varchar(50) NOT NULL,
  `model_name` varchar(100) NOT NULL,
  `object_id` varchar(50) NOT NULL,
  `description` longtext NOT NULL,
  `ip_address` char(39) DEFAULT NULL,
  `user_agent` varchar(255) DEFAULT NULL,
  `created_at` datetime(6) NOT NULL,
  `user_id` char(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `utils_auditlog`
--

INSERT INTO `utils_auditlog` (`id`, `action`, `model_name`, `object_id`, `description`, `ip_address`, `user_agent`, `created_at`, `user_id`) VALUES
('07ae1ed240bb4b099fec913bbaad0690', 'payment', 'Repayment', '72177e2f-d1b8-41ce-9a61-2af1e2173342', 'Recorded payment of KES 1,000.00 for loan LOAN-9E5C76', NULL, NULL, '2025-08-16 14:34:38.139377', '61c4412f980d4495b5b55fe2f80859cf'),
('98c69391982346978202432a1b4f5bbf', 'create', 'LoanApplication', '34c164ef-1432-4298-9c31-56562d903ace', 'Added Boost loan for phin', NULL, NULL, '2025-08-16 14:31:29.602392', '61c4412f980d4495b5b55fe2f80859cf'),
('9fc6215bb3214b209911a477b1f7421c', 'create', 'Loan', '9e5c761d-148d-407a-a895-c7ff58ebeafb', 'Created loan LOAN-9E5C76 for phin', NULL, NULL, '2025-08-16 14:33:38.584268', '61c4412f980d4495b5b55fe2f80859cf'),
('a6cfea57888140199669341118d06a38', 'create', 'Loan', '630433a7-dec0-4c2e-8c1b-33ccc8407a60', 'Created loan LOAN-630433 for phin', NULL, NULL, '2025-08-16 14:25:52.447321', '61c4412f980d4495b5b55fe2f80859cf'),
('b8767357e73f45dc9a67cfa2b9bd0a8a', 'create', 'CustomUser', '74b15bae-95bc-41b9-a81e-eb17322232a8', 'Created new client: phin', NULL, NULL, '2025-08-16 13:01:33.908375', '61c4412f980d4495b5b55fe2f80859cf'),
('bfdc2af156954187aa3b267be5256968', 'create', 'LoanApplication', 'd2153167-d921-4ec9-ae6e-32f6827c7095', 'Added Boost loan for phin', NULL, NULL, '2025-08-16 14:25:17.145038', '61c4412f980d4495b5b55fe2f80859cf');

-- --------------------------------------------------------

--
-- Table structure for table `utils_document`
--

CREATE TABLE `utils_document` (
  `id` bigint NOT NULL,
  `name` varchar(255) NOT NULL,
  `file` varchar(100) NOT NULL,
  `document_type` varchar(50) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL,
  `description` longtext,
  `thumbnail` varchar(100) DEFAULT NULL,
  `file_size` int UNSIGNED NOT NULL,
  `mime_type` varchar(100) NOT NULL,
  `is_public` tinyint(1) NOT NULL,
  `uploaded_by_id` char(32) NOT NULL
) ;

-- --------------------------------------------------------

--
-- Table structure for table `utils_documentshare`
--

CREATE TABLE `utils_documentshare` (
  `id` bigint NOT NULL,
  `shared_at` datetime(6) NOT NULL,
  `message` longtext,
  `is_read` tinyint(1) NOT NULL,
  `document_id` bigint NOT NULL,
  `shared_by_id` char(32) DEFAULT NULL,
  `shared_with_id` char(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `utils_documenttag`
--

CREATE TABLE `utils_documenttag` (
  `id` bigint NOT NULL,
  `name` varchar(50) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `created_by_id` char(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `utils_document_tags`
--

CREATE TABLE `utils_document_tags` (
  `id` bigint NOT NULL,
  `document_id` bigint NOT NULL,
  `documenttag_id` bigint NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- --------------------------------------------------------

--
-- Table structure for table `utils_notification`
--

CREATE TABLE `utils_notification` (
  `id` char(32) NOT NULL,
  `notification_type` varchar(50) NOT NULL,
  `title` varchar(200) NOT NULL,
  `message` longtext NOT NULL,
  `priority` varchar(20) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `read_at` datetime(6) DEFAULT NULL,
  `action_url` varchar(200) DEFAULT NULL,
  `expires_at` datetime(6) DEFAULT NULL,
  `icon` varchar(50) NOT NULL,
  `user_id` char(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `utils_notification`
--

INSERT INTO `utils_notification` (`id`, `notification_type`, `title`, `message`, `priority`, `created_at`, `read_at`, `action_url`, `expires_at`, `icon`, `user_id`) VALUES
('104e06db38374d90a65f198cb1b55fb3', 'system_maintenance', 'New Boost Loan', 'A new Boost loan has been recorded for phin', 'medium', '2025-08-16 14:31:29.603912', '2025-08-16 14:39:13.356202', NULL, NULL, 'fa-bell', NULL),
('7233610e5703405c8f8d24d3edf87fe7', 'system_maintenance', 'New Boost Loan', 'A new Boost loan has been recorded for phin', 'medium', '2025-08-16 14:25:17.146714', '2025-08-16 14:39:13.356202', NULL, NULL, 'fa-bell', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `utils_systemsetting`
--

CREATE TABLE `utils_systemsetting` (
  `id` bigint NOT NULL,
  `key` varchar(50) NOT NULL,
  `value` longtext NOT NULL,
  `category` varchar(20) NOT NULL,
  `description` longtext,
  `is_public` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  `updated_at` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `utils_systemsetting`
--

INSERT INTO `utils_systemsetting` (`id`, `key`, `value`, `category`, `description`, `is_public`, `created_at`, `updated_at`) VALUES
(1, 'max_loan_amount', '500000', 'loan', 'Maximum loan amount allowed', 1, '2025-08-16 11:54:45.053872', '2025-08-16 11:54:45.053888'),
(2, 'min_loan_amount', '1000', 'loan', 'Minimum loan amount allowed', 1, '2025-08-16 11:54:45.055020', '2025-08-16 11:54:45.055032'),
(3, 'default_interest_rate', '15.0', 'loan', 'Default interest rate percentage', 1, '2025-08-16 11:54:45.056211', '2025-08-16 11:54:45.056221'),
(4, 'processing_fee_percentage', '3.0', 'loan', 'Processing fee percentage', 1, '2025-08-16 11:54:45.057283', '2025-08-16 11:54:45.057294'),
(5, 'late_payment_penalty', '2.0', 'loan', 'Late payment penalty percentage', 1, '2025-08-16 11:54:45.058356', '2025-08-16 11:54:45.058367'),
(6, 'max_file_size_mb', '10', 'document', 'Maximum file upload size in MB', 1, '2025-08-16 11:54:45.059381', '2025-08-16 11:54:45.059391'),
(7, 'allowed_file_types', '.pdf,.doc,.docx,.jpg,.jpeg,.png', 'document', 'Allowed file types for uploads', 1, '2025-08-16 11:54:45.060375', '2025-08-16 11:54:45.060385'),
(8, 'require_kyc_documents', 'true', 'document', 'Whether KYC documents are required', 1, '2025-08-16 11:54:45.061372', '2025-08-16 11:54:45.061382'),
(9, 'session_timeout_minutes', '60', 'system', 'Session timeout in minutes', 1, '2025-08-16 11:54:45.062437', '2025-08-16 11:54:45.062447'),
(10, 'max_login_attempts', '5', 'system', 'Maximum login attempts before lockout', 1, '2025-08-16 11:54:45.063514', '2025-08-16 11:54:45.063527'),
(11, 'email_notifications_enabled', 'true', 'notification', 'Enable email notifications', 1, '2025-08-16 11:54:45.064563', '2025-08-16 11:54:45.064573'),
(12, 'sms_notifications_enabled', 'true', 'notification', 'Enable SMS notifications', 1, '2025-08-16 11:54:45.065546', '2025-08-16 11:54:45.065557'),
(13, 'push_notifications_enabled', 'false', 'notification', 'Enable push notifications', 1, '2025-08-16 11:54:45.066449', '2025-08-16 11:54:45.066459'),
(14, 'auto_approval_min_score', '80', 'loan', 'Minimum credit score for auto-approval', 1, '2025-08-16 11:54:45.067417', '2025-08-16 11:54:45.067431'),
(15, 'auto_approval_max_amount', '25000', 'loan', 'Maximum amount for auto-approval', 1, '2025-08-16 11:54:45.068391', '2025-08-16 11:54:45.068401'),
(16, 'rollover_fee_percentage', '10.0', 'loan', 'Default rollover fee percentage', 1, '2025-08-16 11:54:45.069376', '2025-08-16 11:54:45.069386'),
(17, 'max_rollover_count', '3', 'loan', 'Maximum number of rollovers allowed', 1, '2025-08-16 11:54:45.070679', '2025-08-16 11:54:45.070689'),
(18, 'max_rollover_days', '30', 'loan', 'Maximum days for rollover extension', 1, '2025-08-16 11:54:45.071837', '2025-08-16 11:54:45.071851'),
(19, 'rollover_approval_required', 'true', 'loan', 'Whether rollovers require manual approval', 1, '2025-08-16 11:54:45.072764', '2025-08-16 11:54:45.072773'),
(20, 'boost_duration_months', '1', 'loan', 'Boost loan duration in months', 1, '2025-08-16 12:59:05.599349', '2025-08-16 12:59:05.599361'),
(21, 'boost_interest_rate', '20.0', 'loan', 'Boost monthly interest rate (%)', 1, '2025-08-16 12:59:05.600727', '2025-08-16 12:59:05.600739'),
(22, 'boost_processing_fee', '5.0', 'loan', 'Boost processing fee (%)', 1, '2025-08-16 12:59:05.602072', '2025-08-16 12:59:05.602083'),
(23, 'boost_repayment_methods', '[\"daily\", \"weekly\", \"monthly\"]', 'loan', 'Boost available repayment methods', 1, '2025-08-16 12:59:05.603391', '2025-08-16 12:59:05.603401'),
(24, 'boost_min_amount', '1000', 'loan', 'Boost minimum loan amount', 1, '2025-08-16 12:59:05.604699', '2025-08-16 12:59:05.604710'),
(25, 'boost_max_amount', '50000', 'loan', 'Boost maximum loan amount', 1, '2025-08-16 12:59:05.606012', '2025-08-16 12:59:05.606024'),
(26, 'mwamba_duration_months', '3', 'loan', 'Mwamba loan duration in months', 1, '2025-08-16 12:59:05.607307', '2025-08-16 12:59:05.607318'),
(27, 'mwamba_interest_rate', '20.0', 'loan', 'Mwamba monthly interest rate (%)', 1, '2025-08-16 12:59:05.608608', '2025-08-16 12:59:05.608620'),
(28, 'mwamba_processing_fee', '5.0', 'loan', 'Mwamba processing fee (%)', 1, '2025-08-16 12:59:05.609920', '2025-08-16 12:59:05.609931'),
(29, 'mwamba_repayment_methods', '[\"weekly\", \"monthly\"]', 'loan', 'Mwamba available repayment methods', 1, '2025-08-16 12:59:05.611211', '2025-08-16 12:59:05.611222'),
(30, 'mwamba_min_amount', '5000', 'loan', 'Mwamba minimum loan amount', 1, '2025-08-16 12:59:05.612629', '2025-08-16 12:59:05.612640'),
(31, 'mwamba_max_amount', '200000', 'loan', 'Mwamba maximum loan amount', 1, '2025-08-16 12:59:05.613864', '2025-08-16 12:59:05.613875'),
(32, 'imara_duration_months', '6', 'loan', 'Imara loan duration in months', 1, '2025-08-16 12:59:05.614982', '2025-08-16 12:59:05.614992'),
(33, 'imara_interest_rate', '10.0', 'loan', 'Imara monthly interest rate (%)', 1, '2025-08-16 12:59:05.616121', '2025-08-16 12:59:05.616132'),
(34, 'imara_processing_fee', '5.0', 'loan', 'Imara processing fee (%)', 1, '2025-08-16 12:59:05.617209', '2025-08-16 12:59:05.617219'),
(35, 'imara_repayment_methods', '[\"monthly\"]', 'loan', 'Imara available repayment methods', 1, '2025-08-16 12:59:05.618343', '2025-08-16 12:59:05.618354'),
(36, 'imara_min_amount', '10000', 'loan', 'Imara minimum loan amount', 1, '2025-08-16 12:59:05.619420', '2025-08-16 12:59:05.619431'),
(37, 'imara_max_amount', '500000', 'loan', 'Imara maximum loan amount', 1, '2025-08-16 12:59:05.620597', '2025-08-16 12:59:05.620607');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `auth_group`
--
ALTER TABLE `auth_group`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`);

--
-- Indexes for table `auth_group_permissions`
--
ALTER TABLE `auth_group_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `auth_group_permissions_group_id_permission_id_0cd325b0_uniq` (`group_id`,`permission_id`),
  ADD KEY `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` (`permission_id`);

--
-- Indexes for table `auth_permission`
--
ALTER TABLE `auth_permission`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id`,`codename`);

--
-- Indexes for table `django_admin_log`
--
ALTER TABLE `django_admin_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `django_admin_log_content_type_id_c4bce8eb_fk_django_co` (`content_type_id`),
  ADD KEY `django_admin_log_user_id_c564eba6_fk_users_id` (`user_id`);

--
-- Indexes for table `django_content_type`
--
ALTER TABLE `django_content_type`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `django_content_type_app_label_model_76bd3d3b_uniq` (`app_label`,`model`);

--
-- Indexes for table `django_migrations`
--
ALTER TABLE `django_migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `django_session`
--
ALTER TABLE `django_session`
  ADD PRIMARY KEY (`session_key`),
  ADD KEY `django_session_expire_date_a5c62663` (`expire_date`);

--
-- Indexes for table `document_templates`
--
ALTER TABLE `document_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `email_templates`
--
ALTER TABLE `email_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `generated_reports`
--
ALTER TABLE `generated_reports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `generated_reports_generated_by_id_9393ec13_fk_users_id` (`generated_by_id`);

--
-- Indexes for table `loans`
--
ALTER TABLE `loans`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `loan_number` (`loan_number`),
  ADD UNIQUE KEY `application_id` (`application_id`),
  ADD KEY `loans_borrower_id_aaffb8a4_fk_users_id` (`borrower_id`),
  ADD KEY `loans_original_loan_id_5b15332d_fk_loans_id` (`original_loan_id`);

--
-- Indexes for table `loan_applications`
--
ALTER TABLE `loan_applications`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `application_number` (`application_number`),
  ADD KEY `loan_applications_borrower_id_80b5f00e_fk_users_id` (`borrower_id`),
  ADD KEY `loan_applications_reviewed_by_id_761723e9_fk_users_id` (`reviewed_by_id`),
  ADD KEY `loan_applications_loan_product_id_46294b99_fk_loan_products_id` (`loan_product_id`);

--
-- Indexes for table `loan_products`
--
ALTER TABLE `loan_products`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `loan_scoring`
--
ALTER TABLE `loan_scoring`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_loan_scoring_user` (`user_id`);

--
-- Indexes for table `loan_statements`
--
ALTER TABLE `loan_statements`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `statement_number` (`statement_number`),
  ADD KEY `loan_statements_borrower_id_b430163b_fk_users_id` (`borrower_id`),
  ADD KEY `loan_statements_loan_id_2bf4f203_fk_loans_id` (`loan_id`);

--
-- Indexes for table `mpesa_transactions`
--
ALTER TABLE `mpesa_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `mpesa_transactions_loan_id_ab4152e1_fk_loans_id` (`loan_id`),
  ADD KEY `mpesa_transactions_repayment_id_903b355f_fk_repayments_id` (`repayment_id`);

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `notifications_related_application__f2562b71_fk_loan_appl` (`related_application_id`),
  ADD KEY `notifications_related_loan_id_e196b54c_fk_loans_id` (`related_loan_id`),
  ADD KEY `notifications_user_id_468e288d_fk_users_id` (`user_id`);

--
-- Indexes for table `offer_letters`
--
ALTER TABLE `offer_letters`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `offer_number` (`offer_number`),
  ADD UNIQUE KEY `application_id` (`application_id`),
  ADD KEY `offer_letters_borrower_id_25187cf5_fk_users_id` (`borrower_id`);

--
-- Indexes for table `otp_verifications`
--
ALTER TABLE `otp_verifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `otp_verifications_user_id_3340c576_fk_users_id` (`user_id`);

--
-- Indexes for table `receipts`
--
ALTER TABLE `receipts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `receipt_number` (`receipt_number`),
  ADD UNIQUE KEY `repayment_id` (`repayment_id`),
  ADD KEY `receipts_borrower_id_e77bb056_fk_users_id` (`borrower_id`),
  ADD KEY `receipts_loan_id_b4736316_fk_loans_id` (`loan_id`);

--
-- Indexes for table `repayments`
--
ALTER TABLE `repayments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `receipt_number` (`receipt_number`),
  ADD KEY `repayments_loan_id_58f9f13b_fk_loans_id` (`loan_id`);

--
-- Indexes for table `report_templates`
--
ALTER TABLE `report_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `role_permissions`
--
ALTER TABLE `role_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `role_permissions_role_module_action_b947a1b8_uniq` (`role`,`module`,`action`);

--
-- Indexes for table `rollover_requests`
--
ALTER TABLE `rollover_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `rollover_requests_borrower_id_a13a7c75_fk_users_id` (`borrower_id`),
  ADD KEY `rollover_requests_loan_id_427ee293_fk_loans_id` (`loan_id`),
  ADD KEY `rollover_requests_reviewed_by_id_ffce375d_fk_users_id` (`reviewed_by_id`);

--
-- Indexes for table `sms_templates`
--
ALTER TABLE `sms_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `system_settings`
--
ALTER TABLE `system_settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `phone_number` (`phone_number`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `id_number` (`id_number`),
  ADD KEY `users_verified_by_id_29c05f4b_fk_users_id` (`verified_by_id`),
  ADD KEY `idx_users_role` (`role`),
  ADD KEY `idx_users_status` (`status`),
  ADD KEY `idx_users_phone` (`phone_number`),
  ADD KEY `idx_users_email` (`email`);

--
-- Indexes for table `users_groups`
--
ALTER TABLE `users_groups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_groups_customuser_id_group_id_927de924_uniq` (`customuser_id`,`group_id`),
  ADD KEY `users_groups_group_id_2f3517aa_fk_auth_group_id` (`group_id`);

--
-- Indexes for table `users_user_permissions`
--
ALTER TABLE `users_user_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_user_permissions_customuser_id_permission_id_2b4e4e39_uniq` (`customuser_id`,`permission_id`),
  ADD KEY `users_user_permissio_permission_id_6d08dcd2_fk_auth_perm` (`permission_id`);

--
-- Indexes for table `user_access_logs`
--
ALTER TABLE `user_access_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_access_user_id_416563_idx` (`user_id`,`accessed_at`),
  ADD KEY `user_access_action_a90b01_idx` (`action`,`accessed_at`),
  ADD KEY `user_access_module_47fa23_idx` (`module`,`accessed_at`);

--
-- Indexes for table `utils_auditlog`
--
ALTER TABLE `utils_auditlog`
  ADD PRIMARY KEY (`id`),
  ADD KEY `utils_auditlog_user_id_bba0ec05_fk_users_id` (`user_id`);

--
-- Indexes for table `utils_document`
--
ALTER TABLE `utils_document`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_document_uploaded_by` (`uploaded_by_id`),
  ADD KEY `idx_document_type` (`document_type`);

--
-- Indexes for table `utils_documentshare`
--
ALTER TABLE `utils_documentshare`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `utils_documentshare_document_id_shared_with_id_5c637053_uniq` (`document_id`,`shared_with_id`),
  ADD KEY `utils_documentshare_shared_by_id_00694da5_fk_users_id` (`shared_by_id`),
  ADD KEY `idx_documentshare_shared_with` (`shared_with_id`),
  ADD KEY `idx_documentshare_document` (`document_id`);

--
-- Indexes for table `utils_documenttag`
--
ALTER TABLE `utils_documenttag`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`),
  ADD KEY `utils_documenttag_created_by_id_7d2b3d90_fk_users_id` (`created_by_id`);

--
-- Indexes for table `utils_document_tags`
--
ALTER TABLE `utils_document_tags`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `utils_document_tags_document_id_documenttag_id_43d6f1f7_uniq` (`document_id`,`documenttag_id`),
  ADD KEY `utils_document_tags_documenttag_id_6b2c49ec_fk_utils_doc` (`documenttag_id`);

--
-- Indexes for table `utils_notification`
--
ALTER TABLE `utils_notification`
  ADD PRIMARY KEY (`id`),
  ADD KEY `utils_notif_user_id_36dc1c_idx` (`user_id`,`created_at` DESC),
  ADD KEY `utils_notif_notific_d43fdf_idx` (`notification_type`),
  ADD KEY `utils_notif_read_at_52948b_idx` (`read_at`),
  ADD KEY `idx_notification_user` (`user_id`),
  ADD KEY `idx_notification_read` (`read_at`);

--
-- Indexes for table `utils_systemsetting`
--
ALTER TABLE `utils_systemsetting`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `key` (`key`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `auth_group`
--
ALTER TABLE `auth_group`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `auth_group_permissions`
--
ALTER TABLE `auth_group_permissions`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `auth_permission`
--
ALTER TABLE `auth_permission`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=129;

--
-- AUTO_INCREMENT for table `django_admin_log`
--
ALTER TABLE `django_admin_log`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `django_content_type`
--
ALTER TABLE `django_content_type`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT for table `django_migrations`
--
ALTER TABLE `django_migrations`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

--
-- AUTO_INCREMENT for table `otp_verifications`
--
ALTER TABLE `otp_verifications`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `role_permissions`
--
ALTER TABLE `role_permissions`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=961;

--
-- AUTO_INCREMENT for table `users_groups`
--
ALTER TABLE `users_groups`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users_user_permissions`
--
ALTER TABLE `users_user_permissions`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `user_access_logs`
--
ALTER TABLE `user_access_logs`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `utils_document`
--
ALTER TABLE `utils_document`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `utils_documentshare`
--
ALTER TABLE `utils_documentshare`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `utils_documenttag`
--
ALTER TABLE `utils_documenttag`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `utils_document_tags`
--
ALTER TABLE `utils_document_tags`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `utils_systemsetting`
--
ALTER TABLE `utils_systemsetting`
  MODIFY `id` bigint NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `auth_group_permissions`
--
ALTER TABLE `auth_group_permissions`
  ADD CONSTRAINT `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
  ADD CONSTRAINT `auth_group_permissions_group_id_b120cbf9_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`);

--
-- Constraints for table `auth_permission`
--
ALTER TABLE `auth_permission`
  ADD CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`);

--
-- Constraints for table `django_admin_log`
--
ALTER TABLE `django_admin_log`
  ADD CONSTRAINT `django_admin_log_content_type_id_c4bce8eb_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`),
  ADD CONSTRAINT `django_admin_log_user_id_c564eba6_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `generated_reports`
--
ALTER TABLE `generated_reports`
  ADD CONSTRAINT `generated_reports_generated_by_id_9393ec13_fk_users_id` FOREIGN KEY (`generated_by_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `loans`
--
ALTER TABLE `loans`
  ADD CONSTRAINT `loans_application_id_b24dd095_fk_loan_applications_id` FOREIGN KEY (`application_id`) REFERENCES `loan_applications` (`id`),
  ADD CONSTRAINT `loans_borrower_id_aaffb8a4_fk_users_id` FOREIGN KEY (`borrower_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `loans_original_loan_id_5b15332d_fk_loans_id` FOREIGN KEY (`original_loan_id`) REFERENCES `loans` (`id`);

--
-- Constraints for table `loan_applications`
--
ALTER TABLE `loan_applications`
  ADD CONSTRAINT `loan_applications_borrower_id_80b5f00e_fk_users_id` FOREIGN KEY (`borrower_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `loan_applications_loan_product_id_46294b99_fk_loan_products_id` FOREIGN KEY (`loan_product_id`) REFERENCES `loan_products` (`id`),
  ADD CONSTRAINT `loan_applications_reviewed_by_id_761723e9_fk_users_id` FOREIGN KEY (`reviewed_by_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `loan_scoring`
--
ALTER TABLE `loan_scoring`
  ADD CONSTRAINT `loan_scoring_user_id_c41ac245_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `loan_statements`
--
ALTER TABLE `loan_statements`
  ADD CONSTRAINT `loan_statements_borrower_id_b430163b_fk_users_id` FOREIGN KEY (`borrower_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `loan_statements_loan_id_2bf4f203_fk_loans_id` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`);

--
-- Constraints for table `mpesa_transactions`
--
ALTER TABLE `mpesa_transactions`
  ADD CONSTRAINT `mpesa_transactions_loan_id_ab4152e1_fk_loans_id` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `mpesa_transactions_repayment_id_903b355f_fk_repayments_id` FOREIGN KEY (`repayment_id`) REFERENCES `repayments` (`id`);

--
-- Constraints for table `notifications`
--
ALTER TABLE `notifications`
  ADD CONSTRAINT `notifications_related_application__f2562b71_fk_loan_appl` FOREIGN KEY (`related_application_id`) REFERENCES `loan_applications` (`id`),
  ADD CONSTRAINT `notifications_related_loan_id_e196b54c_fk_loans_id` FOREIGN KEY (`related_loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `notifications_user_id_468e288d_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `offer_letters`
--
ALTER TABLE `offer_letters`
  ADD CONSTRAINT `offer_letters_application_id_d9f4f93c_fk_loan_applications_id` FOREIGN KEY (`application_id`) REFERENCES `loan_applications` (`id`),
  ADD CONSTRAINT `offer_letters_borrower_id_25187cf5_fk_users_id` FOREIGN KEY (`borrower_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `otp_verifications`
--
ALTER TABLE `otp_verifications`
  ADD CONSTRAINT `otp_verifications_user_id_3340c576_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `receipts`
--
ALTER TABLE `receipts`
  ADD CONSTRAINT `receipts_borrower_id_e77bb056_fk_users_id` FOREIGN KEY (`borrower_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `receipts_loan_id_b4736316_fk_loans_id` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `receipts_repayment_id_c32f01e1_fk_repayments_id` FOREIGN KEY (`repayment_id`) REFERENCES `repayments` (`id`);

--
-- Constraints for table `repayments`
--
ALTER TABLE `repayments`
  ADD CONSTRAINT `repayments_loan_id_58f9f13b_fk_loans_id` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`);

--
-- Constraints for table `rollover_requests`
--
ALTER TABLE `rollover_requests`
  ADD CONSTRAINT `rollover_requests_borrower_id_a13a7c75_fk_users_id` FOREIGN KEY (`borrower_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `rollover_requests_loan_id_427ee293_fk_loans_id` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `rollover_requests_reviewed_by_id_ffce375d_fk_users_id` FOREIGN KEY (`reviewed_by_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_verified_by_id_29c05f4b_fk_users_id` FOREIGN KEY (`verified_by_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `users_groups`
--
ALTER TABLE `users_groups`
  ADD CONSTRAINT `users_groups_customuser_id_4bd991a9_fk_users_id` FOREIGN KEY (`customuser_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `users_groups_group_id_2f3517aa_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`);

--
-- Constraints for table `users_user_permissions`
--
ALTER TABLE `users_user_permissions`
  ADD CONSTRAINT `users_user_permissio_permission_id_6d08dcd2_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
  ADD CONSTRAINT `users_user_permissions_customuser_id_efdb305c_fk_users_id` FOREIGN KEY (`customuser_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `user_access_logs`
--
ALTER TABLE `user_access_logs`
  ADD CONSTRAINT `user_access_logs_user_id_aa688f69_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `utils_auditlog`
--
ALTER TABLE `utils_auditlog`
  ADD CONSTRAINT `utils_auditlog_user_id_bba0ec05_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `utils_document`
--
ALTER TABLE `utils_document`
  ADD CONSTRAINT `utils_document_uploaded_by_id_c44b6c29_fk_users_id` FOREIGN KEY (`uploaded_by_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `utils_documentshare`
--
ALTER TABLE `utils_documentshare`
  ADD CONSTRAINT `utils_documentshare_document_id_b638cf78_fk_utils_document_id` FOREIGN KEY (`document_id`) REFERENCES `utils_document` (`id`),
  ADD CONSTRAINT `utils_documentshare_shared_by_id_00694da5_fk_users_id` FOREIGN KEY (`shared_by_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `utils_documentshare_shared_with_id_65546475_fk_users_id` FOREIGN KEY (`shared_with_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `utils_documenttag`
--
ALTER TABLE `utils_documenttag`
  ADD CONSTRAINT `utils_documenttag_created_by_id_7d2b3d90_fk_users_id` FOREIGN KEY (`created_by_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `utils_document_tags`
--
ALTER TABLE `utils_document_tags`
  ADD CONSTRAINT `utils_document_tags_document_id_cba5f146_fk_utils_document_id` FOREIGN KEY (`document_id`) REFERENCES `utils_document` (`id`),
  ADD CONSTRAINT `utils_document_tags_documenttag_id_6b2c49ec_fk_utils_doc` FOREIGN KEY (`documenttag_id`) REFERENCES `utils_documenttag` (`id`);

--
-- Constraints for table `utils_notification`
--
ALTER TABLE `utils_notification`
  ADD CONSTRAINT `utils_notification_user_id_39803554_fk_users_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
--
-- Database: `acbptxvs_teamjoint`
--
CREATE DATABASE IF NOT EXISTS `acbptxvs_teamjoint` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
USE `acbptxvs_teamjoint`;
--
-- Database: `acbptxvs_tuokoleane`
--
CREATE DATABASE IF NOT EXISTS `acbptxvs_tuokoleane` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
USE `acbptxvs_tuokoleane`;
--
-- Database: `acbptxvs_umoja`
--
CREATE DATABASE IF NOT EXISTS `acbptxvs_umoja` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
USE `acbptxvs_umoja`;

-- --------------------------------------------------------

--
-- Table structure for table `blood_groups`
--

CREATE TABLE `blood_groups` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `blood_groups`
--

INSERT INTO `blood_groups` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'A+', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(2, 'A-', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(3, 'B+', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(4, 'B-', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(5, 'AB+', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(6, 'AB-', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(7, 'O+', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(8, 'O-', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(9, 'A+', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(10, 'A-', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(11, 'B+', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(12, 'B-', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(13, 'AB+', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(14, 'AB-', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(15, 'O+', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(16, 'O-', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(17, 'A+', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(18, 'A-', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(19, 'B+', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(20, 'B-', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(21, 'AB+', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(22, 'AB-', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(23, 'O+', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(24, 'O-', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(25, 'A+', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(26, 'A-', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(27, 'B+', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(28, 'B-', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(29, 'AB+', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(30, 'AB-', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(31, 'O+', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(32, 'O-', '2025-10-09 16:36:16', '2025-10-09 16:36:16');

-- --------------------------------------------------------

--
-- Table structure for table `books`
--

CREATE TABLE `books` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `my_class_id` int UNSIGNED DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `author` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `book_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_copies` int DEFAULT NULL,
  `issued_copies` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `book_requests`
--

CREATE TABLE `book_requests` (
  `id` int UNSIGNED NOT NULL,
  `book_id` int UNSIGNED NOT NULL,
  `user_id` int UNSIGNED NOT NULL,
  `start_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `end_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `returned` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `class_types`
--

CREATE TABLE `class_types` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `class_types`
--

INSERT INTO `class_types` (`id`, `name`, `code`, `created_at`, `updated_at`) VALUES
(1, 'Primary', 'PRIM', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(2, 'Secondary', 'SEC', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(3, 'Nursery', 'NUR', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(4, 'Kindergarten', 'KG', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(5, 'Pre-Primary', 'PRE', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(6, 'Primary', 'PRIM', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(7, 'Secondary', 'SEC', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(8, 'Nursery', 'NUR', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(9, 'Kindergarten', 'KG', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(10, 'Pre-Primary', 'PRE', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(11, 'Primary', 'PRIM', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(12, 'Secondary', 'SEC', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(13, 'Nursery', 'NUR', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(14, 'Kindergarten', 'KG', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(15, 'Pre-Primary', 'PRE', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(16, 'Primary', 'PRIM', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(17, 'Secondary', 'SEC', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(18, 'Nursery', 'NUR', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(19, 'Kindergarten', 'KG', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(20, 'Pre-Primary', 'PRE', '2025-10-09 16:36:16', '2025-10-09 16:36:16');

-- --------------------------------------------------------

--
-- Table structure for table `dorms`
--

CREATE TABLE `dorms` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(100) 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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `exams`
--

CREATE TABLE `exams` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `term` tinyint NOT NULL,
  `year` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `exam_records`
--

CREATE TABLE `exam_records` (
  `id` int UNSIGNED NOT NULL,
  `exam_id` int UNSIGNED NOT NULL,
  `student_id` int UNSIGNED NOT NULL,
  `my_class_id` int UNSIGNED NOT NULL,
  `section_id` int UNSIGNED NOT NULL,
  `total` int DEFAULT NULL,
  `ave` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `class_ave` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pos` int DEFAULT NULL,
  `af` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ps` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `p_comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `t_comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `grades`
--

CREATE TABLE `grades` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `class_type_id` int UNSIGNED DEFAULT NULL,
  `mark_from` tinyint NOT NULL,
  `mark_to` tinyint NOT NULL,
  `remark` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `grades`
--

INSERT INTO `grades` (`id`, `name`, `class_type_id`, `mark_from`, `mark_to`, `remark`, `created_at`, `updated_at`) VALUES
(1, 'A+', NULL, 90, 100, 'Excellent', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(2, 'A', NULL, 80, 89, 'Very Good', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(3, 'A-', NULL, 75, 79, 'Good', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(4, 'B+', NULL, 70, 74, 'Above Average', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(5, 'B', NULL, 65, 69, 'Average', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(6, 'B-', NULL, 60, 64, 'Below Average', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(7, 'C+', NULL, 55, 59, 'Fair', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(8, 'C', NULL, 50, 54, 'Pass', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(9, 'C-', NULL, 45, 49, 'Weak Pass', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(10, 'D+', NULL, 40, 44, 'Poor', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(11, 'D', NULL, 35, 39, 'Very Poor', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(12, 'E', NULL, 0, 34, 'Fail', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(13, 'A+', NULL, 90, 100, 'Excellent', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(14, 'A', NULL, 80, 89, 'Very Good', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(15, 'A-', NULL, 75, 79, 'Good', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(16, 'B+', NULL, 70, 74, 'Above Average', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(17, 'B', NULL, 65, 69, 'Average', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(18, 'B-', NULL, 60, 64, 'Below Average', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(19, 'C+', NULL, 55, 59, 'Fair', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(20, 'C', NULL, 50, 54, 'Pass', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(21, 'C-', NULL, 45, 49, 'Weak Pass', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(22, 'D+', NULL, 40, 44, 'Poor', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(23, 'D', NULL, 35, 39, 'Very Poor', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(24, 'E', NULL, 0, 34, 'Fail', '2025-10-09 16:36:16', '2025-10-09 16:36:16');

-- --------------------------------------------------------

--
-- Table structure for table `lgas`
--

CREATE TABLE `lgas` (
  `id` int UNSIGNED NOT NULL,
  `state_id` int UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `lgas`
--

INSERT INTO `lgas` (`id`, `state_id`, `name`, `created_at`, `updated_at`) VALUES
(1, 1, 'Westlands', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(2, 1, 'Langata', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(3, 1, 'Kasarani', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(4, 1, 'Embakasi', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(5, 1, 'Kamukunji', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(6, 1, 'Starehe', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(7, 1, 'Makadara', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(8, 1, 'Mathare', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(9, 1, 'Kibra', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(10, 1, 'Ruaraka', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(11, 1, 'Dagoretti', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(12, 1, 'Roysambu', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(13, 1, 'Westlands', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(14, 1, 'Langata', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(15, 1, 'Kasarani', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(16, 1, 'Embakasi', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(17, 1, 'Kamukunji', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(18, 1, 'Starehe', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(19, 1, 'Makadara', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(20, 1, 'Mathare', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(21, 1, 'Kibra', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(22, 1, 'Ruaraka', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(23, 1, 'Dagoretti', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(24, 1, 'Roysambu', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(25, 1, 'Westlands', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(26, 1, 'Langata', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(27, 1, 'Kasarani', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(28, 1, 'Embakasi', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(29, 1, 'Kamukunji', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(30, 1, 'Starehe', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(31, 1, 'Makadara', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(32, 1, 'Mathare', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(33, 1, 'Kibra', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(34, 1, 'Ruaraka', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(35, 1, 'Dagoretti', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(36, 1, 'Roysambu', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(37, 1, 'Westlands', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(38, 1, 'Langata', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(39, 1, 'Kasarani', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(40, 1, 'Embakasi', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(41, 1, 'Kamukunji', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(42, 1, 'Starehe', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(43, 1, 'Makadara', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(44, 1, 'Mathare', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(45, 1, 'Kibra', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(46, 1, 'Ruaraka', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(47, 1, 'Dagoretti', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(48, 1, 'Roysambu', '2025-10-09 16:36:16', '2025-10-09 16:36:16');

-- --------------------------------------------------------

--
-- Table structure for table `marks`
--

CREATE TABLE `marks` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int UNSIGNED NOT NULL,
  `subject_id` int UNSIGNED NOT NULL,
  `my_class_id` int UNSIGNED NOT NULL,
  `section_id` int UNSIGNED NOT NULL,
  `exam_id` int UNSIGNED NOT NULL,
  `t1` int DEFAULT NULL,
  `t2` int DEFAULT NULL,
  `t3` int DEFAULT NULL,
  `t4` int DEFAULT NULL,
  `tca` int DEFAULT NULL,
  `exm` int DEFAULT NULL,
  `tex1` int DEFAULT NULL,
  `tex2` int DEFAULT NULL,
  `tex3` int DEFAULT NULL,
  `sub_pos` tinyint DEFAULT NULL,
  `cum` int DEFAULT NULL,
  `cum_ave` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `grade_id` int UNSIGNED DEFAULT NULL,
  `year` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

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

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2013_09_20_121733_create_blood_groups_table', 1),
(2, '2013_09_22_124750_create_states_table', 1),
(3, '2013_09_22_124806_create_lgas_table', 1),
(4, '2013_09_26_121148_create_nationalities_table', 1),
(5, '2014_10_12_000000_create_users_table', 1),
(6, '2014_10_12_100000_create_password_resets_table', 1),
(7, '2018_09_20_100249_create_user_types_table', 1),
(8, '2018_09_20_150906_create_class_types_table', 1),
(9, '2018_09_22_073005_create_my_classes_table', 1),
(10, '2018_09_22_073526_create_sections_table', 1),
(11, '2018_09_22_080555_create_settings_table', 1),
(12, '2018_09_22_081302_create_subjects_table', 1),
(13, '2018_09_22_151514_create_student_records_table', 1),
(14, '2018_09_26_124241_create_dorms_table', 1),
(15, '2018_10_04_224910_create_exams_table', 1),
(16, '2018_10_06_224846_create_marks_table', 1),
(17, '2018_10_06_224944_create_grades_table', 1),
(18, '2018_10_06_225007_create_pins_table', 1),
(19, '2018_10_18_205550_create_skills_table', 1),
(20, '2018_10_18_205842_create_exam_records_table', 1),
(21, '2018_10_31_191358_create_books_table', 1),
(22, '2018_10_31_192540_create_book_requests_table', 1),
(23, '2018_11_01_132115_create_staff_records_table', 1),
(24, '2018_11_03_210758_create_payments_table', 1),
(25, '2018_11_03_210817_create_payment_records_table', 1),
(26, '2018_11_06_083707_create_receipts_table', 1),
(27, '2018_11_27_180401_create_time_tables_table', 1),
(28, '2019_09_22_142514_create_fks', 1),
(29, '2019_09_26_132227_create_promotions_table', 1);

-- --------------------------------------------------------

--
-- Table structure for table `my_classes`
--

CREATE TABLE `my_classes` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `class_type_id` int UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `my_classes`
--

INSERT INTO `my_classes` (`id`, `name`, `class_type_id`, `created_at`, `updated_at`) VALUES
(1, 'Primary 1', 1, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(2, 'Primary 2', 1, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(3, 'Primary 3', 1, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(4, 'Primary 4', 1, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(5, 'Primary 5', 1, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(6, 'Primary 6', 1, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(7, 'Primary 7', 1, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(8, 'Primary 8', 1, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(9, 'Form 1', 2, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(10, 'Form 2', 2, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(11, 'Form 3', 2, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(12, 'Form 4', 2, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(13, 'Nursery', 3, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(14, 'Kindergarten', 4, '2025-10-09 16:41:34', '2025-10-09 16:41:34'),
(15, 'Pre-Primary', 5, '2025-10-09 16:41:34', '2025-10-09 16:41:34');

-- --------------------------------------------------------

--
-- Table structure for table `nationalities`
--

CREATE TABLE `nationalities` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `nationalities`
--

INSERT INTO `nationalities` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Kenyan', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(2, 'Ugandan', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(3, 'Tanzanian', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(4, 'Rwandan', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(5, 'Ethiopian', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(6, 'Somali', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(7, 'Sudanese', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(8, 'British', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(9, 'American', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(10, 'Indian', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(11, 'Chinese', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(12, 'Other', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(13, 'Kenyan', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(14, 'Ugandan', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(15, 'Tanzanian', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(16, 'Rwandan', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(17, 'Ethiopian', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(18, 'Somali', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(19, 'Sudanese', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(20, 'British', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(21, 'American', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(22, 'Indian', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(23, 'Chinese', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(24, 'Other', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(25, 'Kenyan', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(26, 'Ugandan', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(27, 'Tanzanian', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(28, 'Rwandan', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(29, 'Ethiopian', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(30, 'Somali', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(31, 'Sudanese', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(32, 'British', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(33, 'American', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(34, 'Indian', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(35, 'Chinese', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(36, 'Other', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(37, 'Kenyan', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(38, 'Ugandan', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(39, 'Tanzanian', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(40, 'Rwandan', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(41, 'Ethiopian', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(42, 'Somali', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(43, 'Sudanese', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(44, 'British', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(45, 'American', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(46, 'Indian', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(47, 'Chinese', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(48, 'Other', '2025-10-09 16:36:16', '2025-10-09 16:36:16');

-- --------------------------------------------------------

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `payments` (
  `id` int UNSIGNED NOT NULL,
  `title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` int NOT NULL,
  `ref_no` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `method` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cash',
  `my_class_id` int UNSIGNED DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `payment_records`
--

CREATE TABLE `payment_records` (
  `id` int UNSIGNED NOT NULL,
  `payment_id` int UNSIGNED NOT NULL,
  `student_id` int UNSIGNED NOT NULL,
  `ref_no` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amt_paid` int DEFAULT NULL,
  `balance` int DEFAULT NULL,
  `paid` tinyint NOT NULL DEFAULT '0',
  `year` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `pins`
--

CREATE TABLE `pins` (
  `id` int UNSIGNED NOT NULL,
  `code` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `used` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `times_used` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `user_id` int UNSIGNED DEFAULT NULL,
  `student_id` int UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `promotions`
--

CREATE TABLE `promotions` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int UNSIGNED NOT NULL,
  `from_class` int UNSIGNED NOT NULL,
  `from_section` int UNSIGNED NOT NULL,
  `to_class` int UNSIGNED NOT NULL,
  `to_section` int UNSIGNED NOT NULL,
  `grad` tinyint NOT NULL,
  `from_session` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `to_session` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `receipts`
--

CREATE TABLE `receipts` (
  `id` int UNSIGNED NOT NULL,
  `pr_id` int UNSIGNED NOT NULL,
  `amt_paid` int NOT NULL,
  `balance` int NOT NULL,
  `year` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `sections`
--

CREATE TABLE `sections` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `my_class_id` int UNSIGNED NOT NULL,
  `teacher_id` int UNSIGNED DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

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

CREATE TABLE `settings` (
  `id` int UNSIGNED NOT NULL,
  `type` 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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `settings` (`id`, `type`, `description`, `created_at`, `updated_at`) VALUES
(1, 'system_name', 'UMOJA Springboard Academy', NULL, NULL),
(2, 'current_session', '2024-2025', NULL, NULL),
(3, 'system_title', 'UMOJA School Management System', NULL, NULL),
(4, 'phone', '+254 700 000 000', NULL, NULL),
(5, 'address', 'Nairobi, Kenya', NULL, NULL),
(6, 'email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(7, 'system_email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(8, 'lock_exam', '0', NULL, NULL),
(9, 'logo', 'https://umojaspringboardacademy.teamjointcompanylimited.co.ke/global_assets/images/favicon.png', NULL, NULL),
(10, 'term_ends', '2024-12-20', NULL, NULL),
(11, 'term_begins', '2024-09-01', NULL, NULL),
(12, 'next_term_fees_prim', '15000', NULL, NULL),
(13, 'next_term_fees_sec', '20000', NULL, NULL),
(14, 'next_term_fees_nur', '10000', NULL, NULL),
(15, 'next_term_fees_kg', '12000', NULL, NULL),
(16, 'next_term_fees_pre', '11000', NULL, NULL),
(17, 'currency', 'KSh', NULL, NULL),
(18, 'currency_symbol', 'KSh', NULL, NULL),
(19, 'school_address', 'P.O. Box 12345, Nairobi, Kenya', NULL, NULL),
(20, 'school_phone', '+254 700 000 000', NULL, NULL),
(21, 'school_email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(22, 'school_website', 'https://umojaspringboardacademy.branchbusinessadvance.co.ke', NULL, NULL),
(23, 'academic_year', '2024-2025', NULL, NULL),
(24, 'term', 'First Term', NULL, NULL),
(25, 'attendance_percentage', '75', NULL, NULL),
(26, 'max_attendance_days', '200', NULL, NULL),
(27, 'late_fee', '500', NULL, NULL),
(28, 'transport_fee', '3000', NULL, NULL),
(29, 'library_fee', '1000', NULL, NULL),
(30, 'medical_fee', '2000', NULL, NULL),
(31, 'sports_fee', '1500', NULL, NULL),
(32, 'development_fee', '5000', NULL, NULL),
(33, 'system_name', 'UMOJA Springboard Academy', NULL, NULL),
(34, 'current_session', '2024-2025', NULL, NULL),
(35, 'system_title', 'UMOJA School Management System', NULL, NULL),
(36, 'phone', '+254 700 000 000', NULL, NULL),
(37, 'address', 'Nairobi, Kenya', NULL, NULL),
(38, 'email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(39, 'system_email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(40, 'lock_exam', '0', NULL, NULL),
(41, 'logo', 'https://umojaspringboardacademy.teamjointcompanylimited.co.ke/global_assets/images/favicon.png', NULL, NULL),
(42, 'term_ends', '2024-12-20', NULL, NULL),
(43, 'term_begins', '2024-09-01', NULL, NULL),
(44, 'next_term_fees_prim', '15000', NULL, NULL),
(45, 'next_term_fees_sec', '20000', NULL, NULL),
(46, 'next_term_fees_nur', '10000', NULL, NULL),
(47, 'next_term_fees_kg', '12000', NULL, NULL),
(48, 'next_term_fees_pre', '11000', NULL, NULL),
(49, 'currency', 'KSh', NULL, NULL),
(50, 'currency_symbol', 'KSh', NULL, NULL),
(51, 'school_address', 'P.O. Box 12345, Nairobi, Kenya', NULL, NULL),
(52, 'school_phone', '+254 700 000 000', NULL, NULL),
(53, 'school_email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(54, 'school_website', 'https://umojaspringboardacademy.branchbusinessadvance.co.ke', NULL, NULL),
(55, 'academic_year', '2024-2025', NULL, NULL),
(56, 'term', 'First Term', NULL, NULL),
(57, 'attendance_percentage', '75', NULL, NULL),
(58, 'max_attendance_days', '200', NULL, NULL),
(59, 'late_fee', '500', NULL, NULL),
(60, 'transport_fee', '3000', NULL, NULL),
(61, 'library_fee', '1000', NULL, NULL),
(62, 'medical_fee', '2000', NULL, NULL),
(63, 'sports_fee', '1500', NULL, NULL),
(64, 'development_fee', '5000', NULL, NULL),
(65, 'system_name', 'UMOJA Springboard Academy', NULL, NULL),
(66, 'current_session', '2024-2025', NULL, NULL),
(67, 'system_title', 'UMOJA School Management System', NULL, NULL),
(68, 'phone', '+254 700 000 000', NULL, NULL),
(69, 'address', 'Nairobi, Kenya', NULL, NULL),
(70, 'email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(71, 'system_email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(72, 'lock_exam', '0', NULL, NULL),
(73, 'logo', 'https://umojaspringboardacademy.teamjointcompanylimited.co.ke/global_assets/images/favicon.png', NULL, NULL),
(74, 'term_ends', '2024-12-20', NULL, NULL),
(75, 'term_begins', '2024-09-01', NULL, NULL),
(76, 'next_term_fees_prim', '15000', NULL, NULL),
(77, 'next_term_fees_sec', '20000', NULL, NULL),
(78, 'next_term_fees_nur', '10000', NULL, NULL),
(79, 'next_term_fees_kg', '12000', NULL, NULL),
(80, 'next_term_fees_pre', '11000', NULL, NULL),
(81, 'currency', 'KSh', NULL, NULL),
(82, 'currency_symbol', 'KSh', NULL, NULL),
(83, 'school_address', 'P.O. Box 12345, Nairobi, Kenya', NULL, NULL),
(84, 'school_phone', '+254 700 000 000', NULL, NULL),
(85, 'school_email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(86, 'school_website', 'https://umojaspringboardacademy.branchbusinessadvance.co.ke', NULL, NULL),
(87, 'academic_year', '2024-2025', NULL, NULL),
(88, 'term', 'First Term', NULL, NULL),
(89, 'attendance_percentage', '75', NULL, NULL),
(90, 'max_attendance_days', '200', NULL, NULL),
(91, 'late_fee', '500', NULL, NULL),
(92, 'transport_fee', '3000', NULL, NULL),
(93, 'library_fee', '1000', NULL, NULL),
(94, 'medical_fee', '2000', NULL, NULL),
(95, 'sports_fee', '1500', NULL, NULL),
(96, 'development_fee', '5000', NULL, NULL),
(97, 'system_name', 'UMOJA Springboard Academy', NULL, NULL),
(98, 'current_session', '2024-2025', NULL, NULL),
(99, 'system_title', 'UMOJA School Management System', NULL, NULL),
(100, 'phone', '+254 700 000 000', NULL, NULL),
(101, 'address', 'Nairobi, Kenya', NULL, NULL),
(102, 'email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(103, 'system_email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(104, 'lock_exam', '0', NULL, NULL),
(105, 'logo', 'https://umojaspringboardacademy.teamjointcompanylimited.co.ke/global_assets/images/favicon.png', NULL, NULL),
(106, 'term_ends', '2024-12-20', NULL, NULL),
(107, 'term_begins', '2024-09-01', NULL, NULL),
(108, 'next_term_fees_prim', '15000', NULL, NULL),
(109, 'next_term_fees_sec', '20000', NULL, NULL),
(110, 'next_term_fees_nur', '10000', NULL, NULL),
(111, 'next_term_fees_kg', '12000', NULL, NULL),
(112, 'next_term_fees_pre', '11000', NULL, NULL),
(113, 'currency', 'KSh', NULL, NULL),
(114, 'currency_symbol', 'KSh', NULL, NULL),
(115, 'school_address', 'P.O. Box 12345, Nairobi, Kenya', NULL, NULL),
(116, 'school_phone', '+254 700 000 000', NULL, NULL),
(117, 'school_email', 'info@umojaspringboardacademy.co.ke', NULL, NULL),
(118, 'school_website', 'https://umojaspringboardacademy.branchbusinessadvance.co.ke', NULL, NULL),
(119, 'academic_year', '2024-2025', NULL, NULL),
(120, 'term', 'First Term', NULL, NULL),
(121, 'attendance_percentage', '75', NULL, NULL),
(122, 'max_attendance_days', '200', NULL, NULL),
(123, 'late_fee', '500', NULL, NULL),
(124, 'transport_fee', '3000', NULL, NULL),
(125, 'library_fee', '1000', NULL, NULL),
(126, 'medical_fee', '2000', NULL, NULL),
(127, 'sports_fee', '1500', NULL, NULL),
(128, 'development_fee', '5000', NULL, NULL);

-- --------------------------------------------------------

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

CREATE TABLE `skills` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `skill_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `class_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `staff_records`
--

CREATE TABLE `staff_records` (
  `id` int UNSIGNED NOT NULL,
  `user_id` int UNSIGNED NOT NULL,
  `code` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `emp_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `states`
--

CREATE TABLE `states` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `states`
--

INSERT INTO `states` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Nairobi', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(2, 'Mombasa', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(3, 'Kisumu', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(4, 'Nakuru', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(5, 'Eldoret', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(6, 'Thika', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(7, 'Malindi', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(8, 'Kitale', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(9, 'Garissa', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(10, 'Kakamega', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(11, 'Nyeri', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(12, 'Meru', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(13, 'Machakos', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(14, 'Kitui', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(15, 'Embu', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(16, 'Narok', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(17, 'Kericho', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(18, 'Bomet', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(19, 'Bungoma', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(20, 'Busia', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(21, 'Homa Bay', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(22, 'Kajiado', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(23, 'Kilifi', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(24, 'Kirinyaga', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(25, 'Kisii', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(26, 'Kwale', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(27, 'Laikipia', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(28, 'Lamu', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(29, 'Makueni', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(30, 'Mandera', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(31, 'Marsabit', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(32, 'Migori', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(33, 'Muranga', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(34, 'Nyamira', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(35, 'Nyandarua', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(36, 'Nandi', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(37, 'Samburu', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(38, 'Siaya', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(39, 'Taita Taveta', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(40, 'Tana River', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(41, 'Trans Nzoia', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(42, 'Turkana', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(43, 'Uasin Gishu', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(44, 'Vihiga', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(45, 'Wajir', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(46, 'West Pokot', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(47, 'Isiolo', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(48, 'Nairobi', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(49, 'Mombasa', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(50, 'Kisumu', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(51, 'Nakuru', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(52, 'Eldoret', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(53, 'Thika', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(54, 'Malindi', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(55, 'Kitale', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(56, 'Garissa', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(57, 'Kakamega', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(58, 'Nyeri', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(59, 'Meru', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(60, 'Machakos', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(61, 'Kitui', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(62, 'Embu', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(63, 'Narok', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(64, 'Kericho', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(65, 'Bomet', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(66, 'Bungoma', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(67, 'Busia', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(68, 'Homa Bay', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(69, 'Kajiado', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(70, 'Kilifi', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(71, 'Kirinyaga', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(72, 'Kisii', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(73, 'Kwale', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(74, 'Laikipia', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(75, 'Lamu', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(76, 'Makueni', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(77, 'Mandera', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(78, 'Marsabit', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(79, 'Migori', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(80, 'Muranga', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(81, 'Nyamira', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(82, 'Nyandarua', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(83, 'Nandi', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(84, 'Samburu', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(85, 'Siaya', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(86, 'Taita Taveta', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(87, 'Tana River', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(88, 'Trans Nzoia', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(89, 'Turkana', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(90, 'Uasin Gishu', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(91, 'Vihiga', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(92, 'Wajir', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(93, 'West Pokot', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(94, 'Isiolo', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(95, 'Nairobi', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(96, 'Mombasa', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(97, 'Kisumu', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(98, 'Nakuru', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(99, 'Eldoret', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(100, 'Thika', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(101, 'Malindi', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(102, 'Kitale', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(103, 'Garissa', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(104, 'Kakamega', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(105, 'Nyeri', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(106, 'Meru', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(107, 'Machakos', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(108, 'Kitui', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(109, 'Embu', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(110, 'Narok', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(111, 'Kericho', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(112, 'Bomet', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(113, 'Bungoma', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(114, 'Busia', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(115, 'Homa Bay', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(116, 'Kajiado', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(117, 'Kilifi', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(118, 'Kirinyaga', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(119, 'Kisii', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(120, 'Kwale', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(121, 'Laikipia', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(122, 'Lamu', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(123, 'Makueni', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(124, 'Mandera', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(125, 'Marsabit', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(126, 'Migori', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(127, 'Muranga', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(128, 'Nyamira', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(129, 'Nyandarua', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(130, 'Nandi', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(131, 'Samburu', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(132, 'Siaya', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(133, 'Taita Taveta', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(134, 'Tana River', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(135, 'Trans Nzoia', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(136, 'Turkana', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(137, 'Uasin Gishu', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(138, 'Vihiga', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(139, 'Wajir', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(140, 'West Pokot', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(141, 'Isiolo', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(142, 'Nairobi', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(143, 'Mombasa', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(144, 'Kisumu', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(145, 'Nakuru', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(146, 'Eldoret', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(147, 'Thika', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(148, 'Malindi', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(149, 'Kitale', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(150, 'Garissa', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(151, 'Kakamega', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(152, 'Nyeri', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(153, 'Meru', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(154, 'Machakos', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(155, 'Kitui', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(156, 'Embu', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(157, 'Narok', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(158, 'Kericho', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(159, 'Bomet', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(160, 'Bungoma', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(161, 'Busia', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(162, 'Homa Bay', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(163, 'Kajiado', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(164, 'Kilifi', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(165, 'Kirinyaga', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(166, 'Kisii', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(167, 'Kwale', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(168, 'Laikipia', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(169, 'Lamu', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(170, 'Makueni', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(171, 'Mandera', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(172, 'Marsabit', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(173, 'Migori', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(174, 'Muranga', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(175, 'Nyamira', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(176, 'Nyandarua', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(177, 'Nandi', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(178, 'Samburu', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(179, 'Siaya', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(180, 'Taita Taveta', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(181, 'Tana River', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(182, 'Trans Nzoia', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(183, 'Turkana', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(184, 'Uasin Gishu', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(185, 'Vihiga', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(186, 'Wajir', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(187, 'West Pokot', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(188, 'Isiolo', '2025-10-09 16:36:16', '2025-10-09 16:36:16');

-- --------------------------------------------------------

--
-- Table structure for table `student_records`
--

CREATE TABLE `student_records` (
  `id` int UNSIGNED NOT NULL,
  `user_id` int UNSIGNED NOT NULL,
  `my_class_id` int UNSIGNED NOT NULL,
  `section_id` int UNSIGNED NOT NULL,
  `adm_no` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `my_parent_id` int UNSIGNED DEFAULT NULL,
  `dorm_id` int UNSIGNED DEFAULT NULL,
  `dorm_room_no` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `session` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `house` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `age` tinyint DEFAULT NULL,
  `year_admitted` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `grad` tinyint NOT NULL DEFAULT '0',
  `grad_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `subjects`
--

CREATE TABLE `subjects` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `my_class_id` int UNSIGNED NOT NULL,
  `teacher_id` int UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `time_slots`
--

CREATE TABLE `time_slots` (
  `id` int UNSIGNED NOT NULL,
  `ttr_id` int UNSIGNED NOT NULL,
  `hour_from` tinyint NOT NULL,
  `min_from` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `meridian_from` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `hour_to` tinyint NOT NULL,
  `min_to` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `meridian_to` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `time_from` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `time_to` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `timestamp_from` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `timestamp_to` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `full` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `time_tables`
--

CREATE TABLE `time_tables` (
  `id` int UNSIGNED NOT NULL,
  `ttr_id` int UNSIGNED NOT NULL,
  `ts_id` int UNSIGNED NOT NULL,
  `subject_id` int UNSIGNED DEFAULT NULL,
  `exam_date` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `timestamp_from` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `timestamp_to` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `day` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `day_num` tinyint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `time_table_records`
--

CREATE TABLE `time_table_records` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `my_class_id` int UNSIGNED NOT NULL,
  `exam_id` int UNSIGNED DEFAULT NULL,
  `year` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `username` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `dob` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `photo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'https://umojaspringboardacademy.teamjointcompanylimited.co.ke/global_assets/images/user.png',
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bg_id` int UNSIGNED DEFAULT NULL,
  `state_id` int UNSIGNED DEFAULT NULL,
  `lga_id` int UNSIGNED DEFAULT NULL,
  `nal_id` int UNSIGNED DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `code`, `username`, `user_type`, `dob`, `gender`, `photo`, `phone`, `phone2`, `bg_id`, `state_id`, `lga_id`, `nal_id`, `address`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'System Administrator', 'admin@umoja.com', 'ADM6895', 'admin_umoja', 'admin', '2000-01-01', 'Male', 'https://umojaspringboardacademy.teamjointcompanylimited.co.ke/global_assets/images/user.png', '1234567890', NULL, NULL, NULL, NULL, NULL, '123 Umoja Street', '2025-10-09 15:53:58', '$2y$10$wMyTAWx6A5/QSVBFKnxtguyU.pwvGM4j3NUo1dNLqV2kXa0CkEXX6', NULL, '2025-10-09 15:53:58', '2025-10-09 15:53:58');

-- --------------------------------------------------------

--
-- Table structure for table `user_types`
--

CREATE TABLE `user_types` (
  `id` int UNSIGNED NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `level` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_types`
--

INSERT INTO `user_types` (`id`, `title`, `name`, `level`, `created_at`, `updated_at`) VALUES
(1, '', 'admin', '', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(2, '', 'teacher', '', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(3, '', 'student', '', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(4, '', 'parent', '', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(5, '', 'accountant', '', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(6, '', 'librarian', '', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(7, '', 'receptionist', '', '2025-10-09 16:26:54', '2025-10-09 16:26:54'),
(8, '', 'admin', '', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(9, '', 'teacher', '', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(10, '', 'student', '', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(11, '', 'parent', '', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(12, '', 'accountant', '', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(13, '', 'librarian', '', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(14, '', 'receptionist', '', '2025-10-09 16:28:23', '2025-10-09 16:28:23'),
(15, '', 'admin', '', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(16, '', 'teacher', '', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(17, '', 'student', '', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(18, '', 'parent', '', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(19, '', 'accountant', '', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(20, '', 'librarian', '', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(21, '', 'receptionist', '', '2025-10-09 16:31:01', '2025-10-09 16:31:01'),
(22, '', 'admin', '', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(23, '', 'teacher', '', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(24, '', 'student', '', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(25, '', 'parent', '', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(26, '', 'accountant', '', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(27, '', 'librarian', '', '2025-10-09 16:36:16', '2025-10-09 16:36:16'),
(28, '', 'receptionist', '', '2025-10-09 16:36:16', '2025-10-09 16:36:16');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `blood_groups`
--
ALTER TABLE `blood_groups`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `books`
--
ALTER TABLE `books`
  ADD PRIMARY KEY (`id`),
  ADD KEY `books_my_class_id_foreign` (`my_class_id`);

--
-- Indexes for table `book_requests`
--
ALTER TABLE `book_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `book_requests_book_id_foreign` (`book_id`),
  ADD KEY `book_requests_user_id_foreign` (`user_id`);

--
-- Indexes for table `class_types`
--
ALTER TABLE `class_types`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dorms`
--
ALTER TABLE `dorms`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `dorms_name_unique` (`name`);

--
-- Indexes for table `exams`
--
ALTER TABLE `exams`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `exams_term_year_unique` (`term`,`year`);

--
-- Indexes for table `exam_records`
--
ALTER TABLE `exam_records`
  ADD PRIMARY KEY (`id`),
  ADD KEY `exam_records_exam_id_foreign` (`exam_id`),
  ADD KEY `exam_records_my_class_id_foreign` (`my_class_id`),
  ADD KEY `exam_records_student_id_foreign` (`student_id`),
  ADD KEY `exam_records_section_id_foreign` (`section_id`);

--
-- Indexes for table `grades`
--
ALTER TABLE `grades`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `grades_name_class_type_id_remark_unique` (`name`,`class_type_id`,`remark`),
  ADD KEY `grades_class_type_id_foreign` (`class_type_id`);

--
-- Indexes for table `lgas`
--
ALTER TABLE `lgas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `lgas_state_id_foreign` (`state_id`);

--
-- Indexes for table `marks`
--
ALTER TABLE `marks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `marks_student_id_foreign` (`student_id`),
  ADD KEY `marks_my_class_id_foreign` (`my_class_id`),
  ADD KEY `marks_section_id_foreign` (`section_id`),
  ADD KEY `marks_subject_id_foreign` (`subject_id`),
  ADD KEY `marks_exam_id_foreign` (`exam_id`),
  ADD KEY `marks_grade_id_foreign` (`grade_id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `my_classes`
--
ALTER TABLE `my_classes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `my_classes_class_type_id_name_unique` (`class_type_id`,`name`);

--
-- Indexes for table `nationalities`
--
ALTER TABLE `nationalities`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
  ADD KEY `password_resets_email_index` (`email`);

--
-- Indexes for table `payments`
--
ALTER TABLE `payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `payments_ref_no_unique` (`ref_no`),
  ADD KEY `payments_my_class_id_foreign` (`my_class_id`);

--
-- Indexes for table `payment_records`
--
ALTER TABLE `payment_records`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `payment_records_ref_no_unique` (`ref_no`),
  ADD KEY `payment_records_payment_id_foreign` (`payment_id`),
  ADD KEY `payment_records_student_id_foreign` (`student_id`);

--
-- Indexes for table `pins`
--
ALTER TABLE `pins`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `pins_code_unique` (`code`),
  ADD KEY `pins_user_id_foreign` (`user_id`),
  ADD KEY `pins_student_id_foreign` (`student_id`);

--
-- Indexes for table `promotions`
--
ALTER TABLE `promotions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `promotions_student_id_foreign` (`student_id`),
  ADD KEY `promotions_from_class_foreign` (`from_class`),
  ADD KEY `promotions_from_section_foreign` (`from_section`),
  ADD KEY `promotions_to_section_foreign` (`to_section`),
  ADD KEY `promotions_to_class_foreign` (`to_class`);

--
-- Indexes for table `receipts`
--
ALTER TABLE `receipts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `receipts_pr_id_foreign` (`pr_id`);

--
-- Indexes for table `sections`
--
ALTER TABLE `sections`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `sections_name_my_class_id_unique` (`name`,`my_class_id`),
  ADD KEY `sections_my_class_id_foreign` (`my_class_id`),
  ADD KEY `sections_teacher_id_foreign` (`teacher_id`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `skills`
--
ALTER TABLE `skills`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `staff_records`
--
ALTER TABLE `staff_records`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `staff_records_code_unique` (`code`),
  ADD KEY `staff_records_user_id_foreign` (`user_id`);

--
-- Indexes for table `states`
--
ALTER TABLE `states`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `student_records`
--
ALTER TABLE `student_records`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `student_records_adm_no_unique` (`adm_no`),
  ADD KEY `student_records_user_id_foreign` (`user_id`),
  ADD KEY `student_records_my_class_id_foreign` (`my_class_id`),
  ADD KEY `student_records_section_id_foreign` (`section_id`),
  ADD KEY `student_records_my_parent_id_foreign` (`my_parent_id`),
  ADD KEY `student_records_dorm_id_foreign` (`dorm_id`);

--
-- Indexes for table `subjects`
--
ALTER TABLE `subjects`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `subjects_my_class_id_name_unique` (`my_class_id`,`name`),
  ADD KEY `subjects_teacher_id_foreign` (`teacher_id`);

--
-- Indexes for table `time_slots`
--
ALTER TABLE `time_slots`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `time_slots_timestamp_from_timestamp_to_ttr_id_unique` (`timestamp_from`,`timestamp_to`,`ttr_id`),
  ADD KEY `time_slots_ttr_id_foreign` (`ttr_id`);

--
-- Indexes for table `time_tables`
--
ALTER TABLE `time_tables`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `time_tables_ttr_id_ts_id_day_unique` (`ttr_id`,`ts_id`,`day`),
  ADD UNIQUE KEY `time_tables_ttr_id_ts_id_exam_date_unique` (`ttr_id`,`ts_id`,`exam_date`),
  ADD KEY `time_tables_ts_id_foreign` (`ts_id`),
  ADD KEY `time_tables_subject_id_foreign` (`subject_id`);

--
-- Indexes for table `time_table_records`
--
ALTER TABLE `time_table_records`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `time_table_records_name_unique` (`name`),
  ADD UNIQUE KEY `time_table_records_my_class_id_exam_id_year_unique` (`my_class_id`,`exam_id`,`year`),
  ADD KEY `time_table_records_exam_id_foreign` (`exam_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_code_unique` (`code`),
  ADD UNIQUE KEY `users_email_unique` (`email`),
  ADD UNIQUE KEY `users_username_unique` (`username`),
  ADD KEY `users_state_id_foreign` (`state_id`),
  ADD KEY `users_lga_id_foreign` (`lga_id`),
  ADD KEY `users_bg_id_foreign` (`bg_id`),
  ADD KEY `users_nal_id_foreign` (`nal_id`);

--
-- Indexes for table `user_types`
--
ALTER TABLE `user_types`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `blood_groups`
--
ALTER TABLE `blood_groups`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT for table `books`
--
ALTER TABLE `books`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `book_requests`
--
ALTER TABLE `book_requests`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `class_types`
--
ALTER TABLE `class_types`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `dorms`
--
ALTER TABLE `dorms`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `exams`
--
ALTER TABLE `exams`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `exam_records`
--
ALTER TABLE `exam_records`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `grades`
--
ALTER TABLE `grades`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `lgas`
--
ALTER TABLE `lgas`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=49;

--
-- AUTO_INCREMENT for table `marks`
--
ALTER TABLE `marks`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `my_classes`
--
ALTER TABLE `my_classes`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `nationalities`
--
ALTER TABLE `nationalities`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=49;

--
-- AUTO_INCREMENT for table `payments`
--
ALTER TABLE `payments`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment_records`
--
ALTER TABLE `payment_records`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `pins`
--
ALTER TABLE `pins`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `promotions`
--
ALTER TABLE `promotions`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `receipts`
--
ALTER TABLE `receipts`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sections`
--
ALTER TABLE `sections`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=129;

--
-- AUTO_INCREMENT for table `skills`
--
ALTER TABLE `skills`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `staff_records`
--
ALTER TABLE `staff_records`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `states`
--
ALTER TABLE `states`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=189;

--
-- AUTO_INCREMENT for table `student_records`
--
ALTER TABLE `student_records`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `subjects`
--
ALTER TABLE `subjects`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=254;

--
-- AUTO_INCREMENT for table `time_slots`
--
ALTER TABLE `time_slots`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `time_tables`
--
ALTER TABLE `time_tables`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `time_table_records`
--
ALTER TABLE `time_table_records`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `user_types`
--
ALTER TABLE `user_types`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `books`
--
ALTER TABLE `books`
  ADD CONSTRAINT `books_my_class_id_foreign` FOREIGN KEY (`my_class_id`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `book_requests`
--
ALTER TABLE `book_requests`
  ADD CONSTRAINT `book_requests_book_id_foreign` FOREIGN KEY (`book_id`) REFERENCES `books` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `book_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `exam_records`
--
ALTER TABLE `exam_records`
  ADD CONSTRAINT `exam_records_exam_id_foreign` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `exam_records_my_class_id_foreign` FOREIGN KEY (`my_class_id`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `exam_records_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `exam_records_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `grades`
--
ALTER TABLE `grades`
  ADD CONSTRAINT `grades_class_type_id_foreign` FOREIGN KEY (`class_type_id`) REFERENCES `class_types` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `lgas`
--
ALTER TABLE `lgas`
  ADD CONSTRAINT `lgas_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `marks`
--
ALTER TABLE `marks`
  ADD CONSTRAINT `marks_exam_id_foreign` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `marks_grade_id_foreign` FOREIGN KEY (`grade_id`) REFERENCES `grades` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `marks_my_class_id_foreign` FOREIGN KEY (`my_class_id`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `marks_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `marks_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `marks_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `my_classes`
--
ALTER TABLE `my_classes`
  ADD CONSTRAINT `my_classes_class_type_id_foreign` FOREIGN KEY (`class_type_id`) REFERENCES `class_types` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `payments`
--
ALTER TABLE `payments`
  ADD CONSTRAINT `payments_my_class_id_foreign` FOREIGN KEY (`my_class_id`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `payment_records`
--
ALTER TABLE `payment_records`
  ADD CONSTRAINT `payment_records_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `payment_records_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pins`
--
ALTER TABLE `pins`
  ADD CONSTRAINT `pins_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `pins_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `promotions`
--
ALTER TABLE `promotions`
  ADD CONSTRAINT `promotions_from_class_foreign` FOREIGN KEY (`from_class`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `promotions_from_section_foreign` FOREIGN KEY (`from_section`) REFERENCES `sections` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `promotions_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `promotions_to_class_foreign` FOREIGN KEY (`to_class`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `promotions_to_section_foreign` FOREIGN KEY (`to_section`) REFERENCES `sections` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `receipts`
--
ALTER TABLE `receipts`
  ADD CONSTRAINT `receipts_pr_id_foreign` FOREIGN KEY (`pr_id`) REFERENCES `payment_records` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sections`
--
ALTER TABLE `sections`
  ADD CONSTRAINT `sections_my_class_id_foreign` FOREIGN KEY (`my_class_id`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `sections_teacher_id_foreign` FOREIGN KEY (`teacher_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `staff_records`
--
ALTER TABLE `staff_records`
  ADD CONSTRAINT `staff_records_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `student_records`
--
ALTER TABLE `student_records`
  ADD CONSTRAINT `student_records_dorm_id_foreign` FOREIGN KEY (`dorm_id`) REFERENCES `dorms` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_records_my_class_id_foreign` FOREIGN KEY (`my_class_id`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `student_records_my_parent_id_foreign` FOREIGN KEY (`my_parent_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_records_section_id_foreign` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `student_records_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subjects`
--
ALTER TABLE `subjects`
  ADD CONSTRAINT `subjects_my_class_id_foreign` FOREIGN KEY (`my_class_id`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `subjects_teacher_id_foreign` FOREIGN KEY (`teacher_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `time_slots`
--
ALTER TABLE `time_slots`
  ADD CONSTRAINT `time_slots_ttr_id_foreign` FOREIGN KEY (`ttr_id`) REFERENCES `time_table_records` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `time_tables`
--
ALTER TABLE `time_tables`
  ADD CONSTRAINT `time_tables_subject_id_foreign` FOREIGN KEY (`subject_id`) REFERENCES `subjects` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `time_tables_ts_id_foreign` FOREIGN KEY (`ts_id`) REFERENCES `time_slots` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `time_tables_ttr_id_foreign` FOREIGN KEY (`ttr_id`) REFERENCES `time_table_records` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `time_table_records`
--
ALTER TABLE `time_table_records`
  ADD CONSTRAINT `time_table_records_exam_id_foreign` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `time_table_records_my_class_id_foreign` FOREIGN KEY (`my_class_id`) REFERENCES `my_classes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_bg_id_foreign` FOREIGN KEY (`bg_id`) REFERENCES `blood_groups` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_lga_id_foreign` FOREIGN KEY (`lga_id`) REFERENCES `lgas` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_nal_id_foreign` FOREIGN KEY (`nal_id`) REFERENCES `nationalities` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `users_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`) ON DELETE SET NULL;
COMMIT;

