--
-- Host: localhost    Database: fundi_finance
-- ------------------------------------------------------


--
-- Table structure for table `account_transactions`
--

CREATE TABLE `account_transactions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reference` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_id` bigint unsigned NOT NULL,
  `contra_account_id` bigint unsigned DEFAULT NULL,
  `txn_type` enum('credit','debit') COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` enum('deposit','withdrawal','transfer','loan_disbursement','loan_repayment','interest','fee','investment','treasury','reversal','other') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'other',
  `amount` decimal(18,2) NOT NULL,
  `balance_after` decimal(18,2) NOT NULL,
  `narration` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value_date` date NOT NULL,
  `posted_by` bigint unsigned DEFAULT NULL,
  `authorized_by` bigint unsigned DEFAULT NULL,
  `status` enum('pending','posted','reversed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'posted',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_transactions_uuid_unique` (`uuid`),
  UNIQUE KEY `account_transactions_reference_unique` (`reference`),
  KEY `account_transactions_account_id_foreign` (`account_id`),
  KEY `account_transactions_value_date_index` (`value_date`),
  CONSTRAINT `account_transactions_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_transactions`
--

INSERT INTO `account_transactions` VALUES (1,'44444444-4444-4444-4444-444444444001','TXN-20260728-0001',1,NULL,'credit','deposit',850000.00,850000.00,'Opening deposit','2026-07-28',7,6,'posted','2026-07-28 15:38:34','2026-07-28 15:38:34'),(2,'44444444-4444-4444-4444-444444444002','TXN-20260728-0002',2,NULL,'credit','deposit',4200000.00,4200000.00,'Business account funding','2026-07-28',7,6,'posted','2026-07-28 15:38:34','2026-07-28 15:38:34'),(3,'44444444-4444-4444-4444-444444444003','TXN-20260728-0003',3,NULL,'credit','deposit',12500000.00,12500000.00,'Contractor float','2026-07-28',7,6,'posted','2026-07-28 15:38:34','2026-07-28 15:38:34'),(4,'44444444-4444-4444-4444-444444444004','TXN-20260728-0004',5,NULL,'credit','investment',5000000.00,5000000.00,'Fixed investment placement','2026-07-28',7,4,'posted','2026-07-28 15:38:34','2026-07-28 15:38:34');

--
-- Table structure for table `accounts`
--

CREATE TABLE `accounts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_no` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned DEFAULT NULL,
  `account_type` enum('savings','current','investment','loan_disbursement','escrow') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'savings',
  `currency` char(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'NGN',
  `balance` decimal(18,2) NOT NULL DEFAULT '0.00',
  `available_balance` decimal(18,2) NOT NULL DEFAULT '0.00',
  `lien_amount` decimal(18,2) NOT NULL DEFAULT '0.00',
  `interest_rate` decimal(8,4) DEFAULT NULL,
  `opened_at` date NOT NULL,
  `closed_at` date DEFAULT NULL,
  `status` enum('active','dormant','frozen','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `accounts_uuid_unique` (`uuid`),
  UNIQUE KEY `accounts_account_no_unique` (`account_no`),
  KEY `accounts_customer_id_foreign` (`customer_id`),
  KEY `accounts_branch_id_foreign` (`branch_id`),
  CONSTRAINT `accounts_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `accounts_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `accounts`
--

INSERT INTO `accounts` VALUES (1,'33333333-3333-3333-3333-333333333001','1100000001',1,1,'savings','NGN',850000.00,850000.00,0.00,NULL,'2026-07-28',NULL,'active',7,'2026-07-28 15:38:34','2026-07-28 15:38:34'),(2,'33333333-3333-3333-3333-333333333002','1100000002',2,1,'current','NGN',4200000.00,4000000.00,0.00,NULL,'2026-07-28',NULL,'active',7,'2026-07-28 15:38:34','2026-07-28 15:38:34'),(3,'33333333-3333-3333-3333-333333333003','1100000003',3,1,'current','NGN',12500000.00,12500000.00,0.00,NULL,'2026-07-28',NULL,'active',7,'2026-07-28 15:38:34','2026-07-28 15:38:34'),(4,'33333333-3333-3333-3333-333333333004','1100000004',5,1,'savings','NGN',210000.00,210000.00,0.00,NULL,'2026-07-28',NULL,'active',7,'2026-07-28 15:38:34','2026-07-28 15:38:34'),(5,'33333333-3333-3333-3333-333333333005','1200000001',2,1,'investment','NGN',5000000.00,0.00,0.00,NULL,'2026-07-28',NULL,'active',4,'2026-07-28 15:38:34','2026-07-28 15:38:34');

--
-- Table structure for table `advisory_engagements`
--

CREATE TABLE `advisory_engagements` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `engagement_no` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` bigint unsigned NOT NULL,
  `service_type` enum('financial_advisory','business_consulting','fund_raising','capital_structuring') COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fee_amount` decimal(18,2) NOT NULL DEFAULT '0.00',
  `status` enum('prospect','active','completed','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'prospect',
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `assigned_to` bigint unsigned DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `advisory_engagements_uuid_unique` (`uuid`),
  UNIQUE KEY `advisory_engagements_engagement_no_unique` (`engagement_no`),
  KEY `advisory_engagements_customer_id_foreign` (`customer_id`),
  CONSTRAINT `advisory_engagements_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `advisory_engagements`
--

INSERT INTO `advisory_engagements` VALUES (1,'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb0001','ADV-2026-0001',4,'capital_structuring','Debt restructuring advisory',2500000.00,'active','2026-07-28',NULL,4,'Horizon Logistics capital structure review','2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Table structure for table `audit_logs`
--

CREATE TABLE `audit_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `customer_id` bigint unsigned DEFAULT NULL,
  `action` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `module` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `record_type` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `record_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `old_values` json DEFAULT NULL,
  `new_values` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `audit_logs_user_id_index` (`user_id`),
  KEY `audit_logs_module_index` (`module`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `audit_logs`
--

INSERT INTO `audit_logs` VALUES (1,10,NULL,'login','auth','user',10,'127.0.0.1',NULL,NULL,NULL,'2026-07-28 15:38:35'),(2,3,NULL,'create','loans','loan',4,'127.0.0.1',NULL,NULL,NULL,'2026-07-28 15:38:35'),(3,2,NULL,'approve','loans','loan',2,'127.0.0.1',NULL,NULL,NULL,'2026-07-28 15:38:35'),(4,10,NULL,'login','auth','user',10,'127.0.0.1','curl/8.18.0',NULL,NULL,'2026-07-28 14:44:34'),(5,10,NULL,'login','auth','user',10,'127.0.0.1','curl/8.18.0',NULL,NULL,'2026-07-28 14:44:53'),(6,NULL,1,'portal_login','auth','customer',1,'127.0.0.1','curl/8.18.0',NULL,NULL,'2026-07-28 14:44:54'),(7,NULL,1,'portal_login','auth','customer',1,'127.0.0.1','curl/8.18.0',NULL,NULL,'2026-07-28 14:45:09'),(8,10,NULL,'login','auth','user',10,'127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36',NULL,NULL,'2026-07-28 15:02:58'),(9,10,NULL,'logout','auth','user',10,'127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36',NULL,NULL,'2026-07-28 15:03:59'),(10,NULL,1,'portal_login','auth','customer',1,'127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36',NULL,NULL,'2026-07-28 15:04:31'),(11,1,NULL,'login','auth','user',1,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:02:57'),(12,1,NULL,'update','settings','setting',3,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 3, \"key\": \"company_city\", \"group\": \"general\", \"value\": \"Abuja\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 3, \"key\": \"company_city\", \"group\": \"general\", \"value\": \"Abuja\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','2026-07-31 12:04:29'),(13,1,NULL,'update','settings','setting',1,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 1, \"key\": \"company_name\", \"group\": \"general\", \"value\": \"Fundi Finance Company Ltd\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 1, \"key\": \"company_name\", \"group\": \"general\", \"value\": \"Vantage Finance House Limited\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-31T13:04:29.000000Z\"}','2026-07-31 12:04:29'),(14,1,NULL,'update','settings','setting',2,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 2, \"key\": \"company_short_name\", \"group\": \"general\", \"value\": \"Fundi Finance\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 2, \"key\": \"company_short_name\", \"group\": \"general\", \"value\": \"Vantage Finance\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-31T13:04:29.000000Z\"}','2026-07-31 12:04:29'),(15,1,NULL,'update','settings','setting',4,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 4, \"key\": \"company_state\", \"group\": \"general\", \"value\": \"FCT\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 4, \"key\": \"company_state\", \"group\": \"general\", \"value\": \"FCT\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','2026-07-31 12:04:29'),(16,1,NULL,'update','settings','setting',5,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 5, \"key\": \"currency\", \"group\": \"general\", \"value\": \"NGN\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 5, \"key\": \"currency\", \"group\": \"general\", \"value\": \"NGN\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','2026-07-31 12:04:29'),(17,1,NULL,'update','settings','setting',6,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 6, \"key\": \"currency_symbol\", \"group\": \"general\", \"value\": \"₦\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 6, \"key\": \"currency_symbol\", \"group\": \"general\", \"value\": \"₦\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','2026-07-31 12:04:29'),(18,1,NULL,'update','settings','setting',9,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 9, \"key\": \"support_email\", \"group\": \"general\", \"value\": \"support@fundifinance.ng\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 9, \"key\": \"support_email\", \"group\": \"general\", \"value\": \"support@Vantagefintech.com\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-31T13:04:29.000000Z\"}','2026-07-31 12:04:29'),(19,1,NULL,'update','settings','setting',10,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 10, \"key\": \"support_phone\", \"group\": \"general\", \"value\": \"09000000001\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 10, \"key\": \"support_phone\", \"group\": \"general\", \"value\": \"09000000001\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','2026-07-31 12:04:29'),(20,1,NULL,'update','settings','setting',8,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 8, \"key\": \"dual_control_threshold\", \"group\": \"operations\", \"value\": \"100000\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 8, \"key\": \"dual_control_threshold\", \"group\": \"operations\", \"value\": \"100000\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','2026-07-31 12:04:29'),(21,1,NULL,'update','settings','setting',7,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','{\"id\": 7, \"key\": \"cbn_minimum_capital\", \"group\": \"regulatory\", \"value\": \"100000000\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','{\"id\": 7, \"key\": \"cbn_minimum_capital\", \"group\": \"regulatory\", \"value\": \"100000000\", \"created_at\": \"2026-07-28T16:38:35.000000Z\", \"updated_at\": \"2026-07-28T16:38:35.000000Z\"}','2026-07-31 12:04:29'),(22,10,NULL,'login','auth','user',10,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:17:03'),(23,10,NULL,'login','auth','user',10,'::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cursor/3.13.10 Chrome/144.0.7559.236 Electron/40.10.3 Safari/537.36',NULL,NULL,'2026-07-31 12:17:45'),(24,1,NULL,'login','auth','user',1,'::1','curl/8.18.0',NULL,NULL,'2026-07-31 12:24:48'),(25,1,NULL,'login','auth','user',1,'::1','curl/8.18.0',NULL,NULL,'2026-07-31 12:26:30'),(26,10,NULL,'login','auth','user',10,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:26:36'),(27,1,NULL,'login','auth','user',1,'::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cursor/3.13.10 Chrome/144.0.7559.236 Electron/40.10.3 Safari/537.36',NULL,NULL,'2026-07-31 12:27:00'),(28,1,NULL,'login','auth','user',1,'::1','curl/8.18.0',NULL,NULL,'2026-07-31 12:31:12'),(29,1,NULL,'updated','navigation','App\\Models\\NavigationMenu',2,'::1','curl/8.18.0','{\"id\": 2, \"url\": null, \"icon\": null, \"label\": \"Customers\", \"location\": \"admin\", \"badge_key\": null, \"created_at\": \"2026-07-31T14:13:31.000000Z\", \"is_visible\": true, \"route_name\": \"admin.customers.index\", \"sort_order\": 20, \"updated_at\": \"2026-07-31T14:13:31.000000Z\", \"permission_key\": null, \"open_in_new_tab\": false}','{\"id\": 2, \"url\": null, \"icon\": null, \"label\": \"Clients\", \"location\": \"admin\", \"badge_key\": null, \"created_at\": \"2026-07-31T14:13:31.000000Z\", \"is_visible\": true, \"route_name\": \"admin.customers.index\", \"sort_order\": 20, \"updated_at\": \"2026-07-31T13:31:13.000000Z\", \"permission_key\": null, \"open_in_new_tab\": false}','2026-07-31 12:31:13'),(30,1,NULL,'updated','navigation','App\\Models\\NavigationMenu',2,'::1','curl/8.18.0','{\"id\": 2, \"url\": null, \"icon\": null, \"label\": \"Clients\", \"location\": \"admin\", \"badge_key\": null, \"created_at\": \"2026-07-31T14:13:31.000000Z\", \"is_visible\": true, \"route_name\": \"admin.customers.index\", \"sort_order\": 20, \"updated_at\": \"2026-07-31T13:31:13.000000Z\", \"permission_key\": null, \"open_in_new_tab\": false}','{\"id\": 2, \"url\": null, \"icon\": null, \"label\": \"Customers\", \"location\": \"admin\", \"badge_key\": null, \"created_at\": \"2026-07-31T14:13:31.000000Z\", \"is_visible\": true, \"route_name\": \"admin.customers.index\", \"sort_order\": 20, \"updated_at\": \"2026-07-31T13:31:15.000000Z\", \"permission_key\": null, \"open_in_new_tab\": false}','2026-07-31 12:31:15'),(31,NULL,1,'portal_login','auth','customer',1,'::1','curl/8.18.0',NULL,NULL,'2026-07-31 12:31:17'),(32,10,NULL,'logout','auth','user',10,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:31:46'),(33,NULL,1,'portal_login','auth','customer',1,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:31:57'),(34,NULL,1,'portal_logout','auth','customer',1,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:35:58'),(35,1,NULL,'login','auth','user',1,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:36:08'),(36,NULL,1,'portal_login','auth','customer',1,'::1','curl/8.18.0',NULL,NULL,'2026-07-31 12:39:11'),(37,1,NULL,'logout','auth','user',1,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:39:28'),(38,8,NULL,'login','auth','user',8,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:39:37'),(39,1,1,'portal_login','auth','customer',1,'::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cursor/3.13.10 Chrome/144.0.7559.236 Electron/40.10.3 Safari/537.36',NULL,NULL,'2026-07-31 12:39:45'),(40,8,NULL,'logout','auth','user',8,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:39:58'),(41,NULL,5,'portal_login','auth','customer',5,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:40:11'),(42,NULL,5,'portal_logout','auth','customer',5,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:40:29'),(43,NULL,1,'portal_login','auth','customer',1,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:40:36'),(44,NULL,1,'portal_logout','auth','customer',1,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:41:29'),(45,10,NULL,'login','auth','user',10,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:41:45'),(46,1,NULL,'logout','auth','user',1,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:50:03'),(47,10,NULL,'login','auth','user',10,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:52:34'),(48,10,NULL,'logout','auth','user',10,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0',NULL,NULL,'2026-07-31 12:53:17'),(49,3,NULL,'login','auth','user',3,'::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cursor/3.13.10 Chrome/144.0.7559.236 Electron/40.10.3 Safari/537.36',NULL,NULL,'2026-07-31 12:55:19');

--
-- Table structure for table `authorization_queue`
--

CREATE TABLE `authorization_queue` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `module` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `record_type` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `record_id` bigint unsigned NOT NULL,
  `payload` json DEFAULT NULL,
  `amount` decimal(18,2) DEFAULT NULL,
  `priority` enum('low','normal','high','critical') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'normal',
  `status` enum('pending','approved','rejected','expired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `inputer_id` bigint unsigned NOT NULL,
  `authorizer_id` bigint unsigned DEFAULT NULL,
  `remarks` text COLLATE utf8mb4_unicode_ci,
  `decided_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `authorization_queue_uuid_unique` (`uuid`),
  KEY `authorization_queue_status_index` (`status`),
  KEY `authorization_queue_inputer_id_foreign` (`inputer_id`),
  CONSTRAINT `authorization_queue_inputer_id_foreign` FOREIGN KEY (`inputer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `authorization_queue`
--

INSERT INTO `authorization_queue` VALUES (1,'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa0001','loans','disburse','loan',2,'{\"loan_no\": \"LN-2026-0002\", \"principal\": 8000000}',8000000.00,'high','pending',7,NULL,NULL,NULL,'2026-07-28 15:38:35','2026-07-28 15:38:35'),(2,'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa0002','accounts','withdrawal','account',2,'{\"amount\": 200000, \"account_no\": \"1100000002\"}',200000.00,'normal','pending',7,NULL,NULL,NULL,'2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Table structure for table `branches`
--

CREATE TABLE `branches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT 'Abuja',
  `state` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT 'FCT',
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_head_office` tinyint(1) NOT NULL DEFAULT '0',
  `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `branches_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branches`
--

INSERT INTO `branches` VALUES (1,'ABJ-HO','Abuja Head Office','Central Business District, Abuja','Abuja','FCT','09000000001','info@fundifinance.ng',1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34');

--
-- Table structure for table `chart_of_accounts`
--

CREATE TABLE `chart_of_accounts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_class` enum('asset','liability','equity','income','expense') COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_id` bigint unsigned DEFAULT NULL,
  `is_postable` tinyint(1) NOT NULL DEFAULT '1',
  `balance` decimal(18,2) NOT NULL DEFAULT '0.00',
  `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `chart_of_accounts_code_unique` (`code`),
  KEY `chart_of_accounts_parent_id_foreign` (`parent_id`),
  CONSTRAINT `chart_of_accounts_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `chart_of_accounts` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `chart_of_accounts`
--

INSERT INTO `chart_of_accounts` VALUES (1,'1000','Assets','asset',NULL,0,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(2,'1100','Cash and Bank','asset',1,0,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(3,'1101','Cash on Hand','asset',2,1,5000000.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(4,'1102','Bank - Current Account','asset',2,1,85000000.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(5,'1200','Loans and Advances','asset',1,0,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(6,'1201','Loan Portfolio','asset',5,1,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(7,'1300','Treasury Assets','asset',1,0,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(8,'1301','Treasury Bills','asset',7,1,20000000.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(9,'2000','Liabilities','liability',NULL,0,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(10,'2100','Customer Deposits','liability',9,0,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(11,'2101','Investment Liabilities','liability',10,1,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(12,'3000','Equity','equity',NULL,0,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(13,'3101','Share Capital','equity',12,1,100000000.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(14,'4000','Income','income',NULL,0,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(15,'4101','Interest Income - Loans','income',14,1,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(16,'4102','Fee Income','income',14,1,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(17,'4103','Treasury Income','income',14,1,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(18,'4104','Advisory Income','income',14,1,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(19,'5000','Expenses','expense',NULL,0,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(20,'5101','Personnel Costs','expense',19,1,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(21,'5102','Operating Expenses','expense',19,1,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(22,'5103','Interest Expense','expense',19,1,0.00,'active','2026-07-28 15:38:34','2026-07-28 15:38:34');

--
-- Table structure for table `crm_interactions`
--

CREATE TABLE `crm_interactions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `customer_id` bigint unsigned DEFAULT NULL,
  `lead_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned NOT NULL,
  `channel` enum('call','email','visit','whatsapp','meeting','other') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'call',
  `subject` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `next_follow_up` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `crm_interactions_customer_id_foreign` (`customer_id`),
  KEY `crm_interactions_lead_id_foreign` (`lead_id`),
  KEY `crm_interactions_user_id_foreign` (`user_id`),
  CONSTRAINT `crm_interactions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `crm_interactions_lead_id_foreign` FOREIGN KEY (`lead_id`) REFERENCES `leads` (`id`) ON DELETE CASCADE,
  CONSTRAINT `crm_interactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `crm_interactions`
--

INSERT INTO `crm_interactions` VALUES (1,2,NULL,3,'visit','Site visit — Greenfield Agro','Reviewed inventory and warehouse controls','2026-08-04','2026-07-28 15:38:35','2026-07-28 15:38:35'),(2,NULL,1,3,'call','LPO document checklist','Requested award letter and invoice copies','2026-07-30','2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Table structure for table `customer_kyc_documents`
--

CREATE TABLE `customer_kyc_documents` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `customer_id` bigint unsigned NOT NULL,
  `doc_type` enum('id_card','passport','utility_bill','cac','tax_clearance','bank_statement','other') COLLATE utf8mb4_unicode_ci NOT NULL,
  `doc_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issued_at` date DEFAULT NULL,
  `expires_at` date DEFAULT NULL,
  `verified` tinyint(1) NOT NULL DEFAULT '0',
  `verified_by` bigint unsigned DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_kyc_documents_customer_id_foreign` (`customer_id`),
  CONSTRAINT `customer_kyc_documents_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `customer_kyc_documents`
--


--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `failed_jobs`
--


--
-- Table structure for table `investment_products`
--

CREATE TABLE `investment_products` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` enum('fixed','premium','corporate_note') COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `min_amount` decimal(18,2) NOT NULL DEFAULT '100000.00',
  `interest_rate` decimal(8,4) NOT NULL,
  `min_tenor_days` int NOT NULL DEFAULT '30',
  `max_tenor_days` int NOT NULL DEFAULT '365',
  `interest_payout` enum('maturity','monthly','quarterly') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'maturity',
  `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `investment_products_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `investment_products`
--

INSERT INTO `investment_products` VALUES (1,'FI-001','Fixed Investment','fixed','Fixed tenure investment with guaranteed return',100000.00,14.0000,30,365,'maturity','active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(2,'PI-001','Premium Investment Account','premium','Higher-yield premium investment for HNW clients',5000000.00,16.5000,90,730,'quarterly','active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(3,'CN-001','Corporate Investment Note','corporate_note','Corporate investment notes for institutional clients',10000000.00,15.0000,180,1095,'maturity','active','2026-07-28 15:38:34','2026-07-28 15:38:34');

--
-- Table structure for table `investments`
--

CREATE TABLE `investments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `investment_no` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` bigint unsigned NOT NULL,
  `product_id` bigint unsigned NOT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `principal` decimal(18,2) NOT NULL,
  `interest_rate` decimal(8,4) NOT NULL,
  `tenor_days` int NOT NULL,
  `start_date` date NOT NULL,
  `maturity_date` date NOT NULL,
  `expected_interest` decimal(18,2) NOT NULL DEFAULT '0.00',
  `interest_paid` decimal(18,2) NOT NULL DEFAULT '0.00',
  `status` enum('pending','active','matured','rolled_over','liquidated','cancelled') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `created_by` bigint unsigned DEFAULT NULL,
  `authorized_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `investments_uuid_unique` (`uuid`),
  UNIQUE KEY `investments_investment_no_unique` (`investment_no`),
  KEY `investments_customer_id_foreign` (`customer_id`),
  KEY `investments_product_id_foreign` (`product_id`),
  CONSTRAINT `investments_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `investments_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `investment_products` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `investments`
--

INSERT INTO `investments` VALUES (1,'77777777-7777-7777-7777-777777777001','INV-2026-0001',2,1,5,5000000.00,14.0000,180,'2026-06-28','2026-12-25',345205.48,0.00,'active',4,1,'2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Table structure for table `job_batches`
--

CREATE TABLE `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `job_batches`
--


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

CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `journal_entries`
--

CREATE TABLE `journal_entries` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entry_no` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entry_date` date NOT NULL,
  `narration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_module` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source_id` bigint unsigned DEFAULT NULL,
  `total_debit` decimal(18,2) NOT NULL DEFAULT '0.00',
  `total_credit` decimal(18,2) NOT NULL DEFAULT '0.00',
  `status` enum('draft','pending_approval','posted','reversed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `created_by` bigint unsigned DEFAULT NULL,
  `authorized_by` bigint unsigned DEFAULT NULL,
  `posted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `journal_entries_uuid_unique` (`uuid`),
  UNIQUE KEY `journal_entries_entry_no_unique` (`entry_no`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `journal_entries`
--

INSERT INTO `journal_entries` VALUES (1,'cccccccc-cccc-cccc-cccc-cccccccc0001','JE-2026-0001','2026-07-28','Share capital injection — CBN minimum capital','equity',NULL,100000000.00,100000000.00,'posted',4,1,'2026-07-28 15:38:35','2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Table structure for table `journal_lines`
--

CREATE TABLE `journal_lines` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `journal_entry_id` bigint unsigned NOT NULL,
  `gl_account_id` bigint unsigned NOT NULL,
  `debit` decimal(18,2) NOT NULL DEFAULT '0.00',
  `credit` decimal(18,2) NOT NULL DEFAULT '0.00',
  `narration` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `journal_lines_journal_entry_id_foreign` (`journal_entry_id`),
  KEY `journal_lines_gl_account_id_foreign` (`gl_account_id`),
  CONSTRAINT `journal_lines_gl_account_id_foreign` FOREIGN KEY (`gl_account_id`) REFERENCES `chart_of_accounts` (`id`),
  CONSTRAINT `journal_lines_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `journal_entries` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `journal_lines`
--

INSERT INTO `journal_lines` VALUES (1,1,4,100000000.00,0.00,'Bank receipt — capital','2026-07-28 15:38:35','2026-07-28 15:38:35'),(2,1,13,0.00,100000000.00,'Share capital credited','2026-07-28 15:38:35','2026-07-28 15:38:35');

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

CREATE TABLE `leads` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `full_name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `business_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `interest` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `estimated_amount` decimal(18,2) DEFAULT NULL,
  `stage` enum('new','contacted','qualified','proposal','won','lost') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'new',
  `assigned_to` bigint unsigned DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `converted_customer_id` bigint unsigned DEFAULT NULL,
  `created_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `leads_uuid_unique` (`uuid`),
  KEY `leads_assigned_to_foreign` (`assigned_to`),
  CONSTRAINT `leads_assigned_to_foreign` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `leads` VALUES (1,'99999999-9999-9999-9999-999999999001','Referral','Kunle Adewale','Adewale Supplies','kunle@adewalesupplies.ng','08033330001','LPO Financing',4500000.00,'qualified',3,'Needs LPO finance for ministry supply',NULL,3,'2026-07-28 15:38:35','2026-07-28 15:38:35'),(2,'99999999-9999-9999-9999-999999999002','Website','Blessing Uche',NULL,'blessing.uche@email.com','08033330002','Personal Loan',800000.00,'new',3,NULL,NULL,3,'2026-07-28 15:38:35','2026-07-28 15:38:35'),(3,'99999999-9999-9999-9999-999999999003','Walk-in','Farouk Hassan','Hassan Motors','farouk@hassanmotors.ng','08033330003','Vehicle Finance',12000000.00,'proposal',2,'Fleet acquisition for ride-hailing',NULL,2,'2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Table structure for table `loan_collaterals`
--

CREATE TABLE `loan_collaterals` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `loan_id` bigint unsigned NOT NULL,
  `collateral_type` enum('property','vehicle','equipment','inventory','receivable','cash','other') COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `estimated_value` decimal(18,2) NOT NULL DEFAULT '0.00',
  `document_ref` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loan_collaterals_loan_id_foreign` (`loan_id`),
  CONSTRAINT `loan_collaterals_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_collaterals`
--

INSERT INTO `loan_collaterals` VALUES (1,2,'inventory','Agro input stock and warehouse inventory',12000000.00,'COL-INV-002','2026-07-28 15:38:35','2026-07-28 15:38:35'),(2,3,'receivable','Assignment of contract receivables',35000000.00,'COL-REC-003','2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Table structure for table `loan_guarantors`
--

CREATE TABLE `loan_guarantors` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `loan_id` bigint unsigned NOT NULL,
  `full_name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `relationship` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bvn` varchar(11) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loan_guarantors_loan_id_foreign` (`loan_id`),
  CONSTRAINT `loan_guarantors_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_guarantors`
--

INSERT INTO `loan_guarantors` VALUES (1,1,'Peter Okoro','08022220001','peter.okoro@email.com','Brother','Gwarinpa, Abuja',NULL,'2026-07-28 15:38:35','2026-07-28 15:38:35'),(2,4,'Aisha Mohammed','08022220002',NULL,'Business Partner','Kubwa, Abuja',NULL,'2026-07-28 15:38:35','2026-07-28 15:38:35');

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

CREATE TABLE `loan_products` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` enum('personal','women','education','salary_advance','sme','working_capital','contractor','invoice_discounting','lpo','trade','project','vehicle','equipment_lease','machinery','school_fees') COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `min_amount` decimal(18,2) NOT NULL DEFAULT '50000.00',
  `max_amount` decimal(18,2) NOT NULL DEFAULT '50000000.00',
  `interest_rate` decimal(8,4) NOT NULL COMMENT 'Annual percentage rate',
  `interest_method` enum('reducing','flat','discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'reducing',
  `min_tenor_months` int NOT NULL DEFAULT '1',
  `max_tenor_months` int NOT NULL DEFAULT '36',
  `processing_fee_pct` decimal(8,4) NOT NULL DEFAULT '1.0000',
  `penalty_rate_pct` decimal(8,4) NOT NULL DEFAULT '1.0000',
  `requires_collateral` tinyint(1) NOT NULL DEFAULT '0',
  `requires_guarantor` tinyint(1) NOT NULL DEFAULT '0',
  `status` enum('active','inactive') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `loan_products_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `loan_products` VALUES (1,'PL-001','Personal Loan','personal','Flexible personal financing for salaried individuals',50000.00,5000000.00,28.0000,'reducing',3,24,1.5000,1.0000,0,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(2,'WI-001','Women Initiative Loan','women','Empowerment loans for women-owned enterprises',100000.00,10000000.00,24.0000,'reducing',3,36,1.0000,1.0000,0,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(3,'ED-001','Education Loan','education','School and tertiary education financing',100000.00,8000000.00,22.0000,'reducing',6,48,1.0000,1.0000,0,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(4,'SA-001','Salary Advance','salary_advance','Short-term salary advances for payroll clients',20000.00,1000000.00,5.0000,'flat',1,3,2.0000,1.0000,0,0,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(5,'SME-001','SME Loan','sme','Growth financing for small and medium enterprises',500000.00,50000000.00,26.0000,'reducing',6,36,1.5000,1.0000,1,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(6,'WC-001','Working Capital Loan','working_capital','Short-cycle working capital for traders and SMEs',250000.00,30000000.00,27.0000,'reducing',3,18,1.5000,1.0000,1,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(7,'CF-001','Contractor Finance','contractor','Contract financing for verified contractors',1000000.00,100000000.00,25.0000,'reducing',3,24,2.0000,1.0000,1,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(8,'ID-001','Invoice Discounting','invoice_discounting','Discounting of verified receivables',500000.00,80000000.00,20.0000,'discount',1,6,1.0000,1.0000,0,0,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(9,'LPO-001','LPO Financing','lpo','Local Purchase Order financing',500000.00,50000000.00,22.0000,'discount',1,6,1.5000,1.0000,0,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(10,'TF-001','Trade Finance','trade','Import/export and domestic trade finance',1000000.00,150000000.00,24.0000,'reducing',3,12,1.5000,1.0000,1,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(11,'PF-001','Project Finance','project','Medium-term project financing',5000000.00,500000000.00,23.0000,'reducing',12,60,2.0000,1.0000,1,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(12,'VF-001','Vehicle Finance','vehicle','Asset finance for vehicles',1500000.00,40000000.00,21.0000,'reducing',12,48,1.5000,1.0000,1,0,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(13,'EL-001','Equipment Leasing','equipment_lease','Lease financing for productive equipment',1000000.00,80000000.00,20.0000,'reducing',12,48,1.5000,1.0000,1,0,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(14,'MF-001','Machinery Finance','machinery','Machinery acquisition financing',2000000.00,100000000.00,21.0000,'reducing',12,60,1.5000,1.0000,1,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34'),(15,'SF-001','School Fees Finance','school_fees','Term financing for school fees obligations',100000.00,5000000.00,18.0000,'flat',3,12,1.0000,1.0000,0,1,'active','2026-07-28 15:38:34','2026-07-28 15:38:34');

--
-- Table structure for table `loan_repayments`
--

CREATE TABLE `loan_repayments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reference` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `loan_id` bigint unsigned NOT NULL,
  `schedule_id` bigint unsigned DEFAULT NULL,
  `amount` decimal(18,2) NOT NULL,
  `principal_component` decimal(18,2) NOT NULL DEFAULT '0.00',
  `interest_component` decimal(18,2) NOT NULL DEFAULT '0.00',
  `penalty_component` decimal(18,2) NOT NULL DEFAULT '0.00',
  `fee_component` decimal(18,2) NOT NULL DEFAULT '0.00',
  `payment_method` enum('cash','transfer','cheque','salary_deduction','portal') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'transfer',
  `payment_date` date NOT NULL,
  `narration` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `received_by` bigint unsigned DEFAULT NULL,
  `authorized_by` bigint unsigned DEFAULT NULL,
  `status` enum('pending','posted','reversed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'posted',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `loan_repayments_uuid_unique` (`uuid`),
  UNIQUE KEY `loan_repayments_reference_unique` (`reference`),
  KEY `loan_repayments_loan_id_foreign` (`loan_id`),
  CONSTRAINT `loan_repayments_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_repayments`
--

INSERT INTO `loan_repayments` VALUES (1,'66666666-6666-6666-6666-666666666001','RPY-2026-0001',1,1,160000.00,125000.00,35000.00,0.00,0.00,'transfer','2026-07-23','Installment 1 repayment',7,6,'posted','2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Table structure for table `loan_schedules`
--

CREATE TABLE `loan_schedules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `loan_id` bigint unsigned NOT NULL,
  `installment_no` int NOT NULL,
  `due_date` date NOT NULL,
  `principal_due` decimal(18,2) NOT NULL,
  `interest_due` decimal(18,2) NOT NULL,
  `fees_due` decimal(18,2) NOT NULL DEFAULT '0.00',
  `total_due` decimal(18,2) NOT NULL,
  `principal_paid` decimal(18,2) NOT NULL DEFAULT '0.00',
  `interest_paid` decimal(18,2) NOT NULL DEFAULT '0.00',
  `fees_paid` decimal(18,2) NOT NULL DEFAULT '0.00',
  `penalty_paid` decimal(18,2) NOT NULL DEFAULT '0.00',
  `status` enum('pending','partial','paid','overdue','waived') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `paid_at` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `loan_schedules_loan_installment_unique` (`loan_id`,`installment_no`),
  CONSTRAINT `loan_schedules_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loan_schedules`
--

INSERT INTO `loan_schedules` VALUES (1,1,1,'2026-07-20',125000.00,35000.00,0.00,160000.00,125000.00,35000.00,0.00,0.00,'paid','2026-07-23','2026-07-28 15:38:35','2026-07-28 15:38:35'),(2,1,2,'2026-08-12',125000.00,32083.33,0.00,157083.33,0.00,0.00,0.00,0.00,'pending',NULL,'2026-07-28 15:38:35','2026-07-28 15:38:35'),(3,1,3,'2026-09-11',125000.00,29166.67,0.00,154166.67,0.00,0.00,0.00,0.00,'pending',NULL,'2026-07-28 15:38:35','2026-07-28 15:38:35');

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

CREATE TABLE `loans` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `loan_no` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` bigint unsigned NOT NULL,
  `product_id` bigint unsigned NOT NULL,
  `branch_id` bigint unsigned DEFAULT NULL,
  `account_id` bigint unsigned DEFAULT NULL,
  `principal` decimal(18,2) NOT NULL,
  `interest_rate` decimal(8,4) NOT NULL,
  `interest_method` enum('reducing','flat','discount') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'reducing',
  `tenor_months` int NOT NULL,
  `processing_fee` decimal(18,2) NOT NULL DEFAULT '0.00',
  `disbursed_amount` decimal(18,2) DEFAULT NULL,
  `outstanding_principal` decimal(18,2) NOT NULL DEFAULT '0.00',
  `outstanding_interest` decimal(18,2) NOT NULL DEFAULT '0.00',
  `total_repayable` decimal(18,2) NOT NULL DEFAULT '0.00',
  `total_paid` decimal(18,2) NOT NULL DEFAULT '0.00',
  `purpose` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `application_date` date NOT NULL,
  `approval_date` date DEFAULT NULL,
  `disbursement_date` date DEFAULT NULL,
  `maturity_date` date DEFAULT NULL,
  `next_due_date` date DEFAULT NULL,
  `status` enum('draft','submitted','underwriting','approved','rejected','disbursed','active','in_arrears','restructured','written_off','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
  `credit_score` int DEFAULT NULL,
  `officer_id` bigint unsigned DEFAULT NULL,
  `approved_by` bigint unsigned DEFAULT NULL,
  `disbursed_by` bigint unsigned DEFAULT NULL,
  `rejection_reason` text COLLATE utf8mb4_unicode_ci,
  `created_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `loans_uuid_unique` (`uuid`),
  UNIQUE KEY `loans_loan_no_unique` (`loan_no`),
  KEY `loans_customer_id_foreign` (`customer_id`),
  KEY `loans_product_id_foreign` (`product_id`),
  KEY `loans_status_index` (`status`),
  CONSTRAINT `loans_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loans_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `loan_products` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `loans` VALUES (1,'55555555-5555-5555-5555-555555555001','LN-2026-0001',1,1,1,1,1500000.00,28.0000,'reducing',12,22500.00,1477500.00,1375000.00,185000.00,1740000.00,125000.00,'Home renovation','2026-06-13','2026-06-18','2026-06-20','2027-05-28','2026-08-12','active',720,3,2,6,NULL,3,'2026-07-28 15:38:34','2026-07-28 15:38:34'),(2,'55555555-5555-5555-5555-555555555002','LN-2026-0002',2,5,1,2,8000000.00,26.0000,'reducing',24,120000.00,7880000.00,8000000.00,0.00,10080000.00,0.00,'Working capital for agro inputs','2026-07-18','2026-07-25',NULL,NULL,NULL,'approved',680,3,2,NULL,NULL,3,'2026-07-28 15:38:34','2026-07-28 15:38:34'),(3,'55555555-5555-5555-5555-555555555003','LN-2026-0003',3,7,1,3,25000000.00,25.0000,'reducing',12,500000.00,NULL,25000000.00,0.00,0.00,0.00,'Federal contract mobilization','2026-07-23',NULL,NULL,NULL,NULL,'underwriting',650,2,NULL,NULL,NULL,2,'2026-07-28 15:38:34','2026-07-28 15:38:34'),(4,'55555555-5555-5555-5555-555555555004','LN-2026-0004',5,2,1,4,750000.00,24.0000,'reducing',18,7500.00,NULL,750000.00,0.00,0.00,0.00,'Boutique expansion','2026-07-28',NULL,NULL,NULL,NULL,'submitted',700,3,NULL,NULL,NULL,3,'2026-07-28 15:38:34','2026-07-28 15:38:34');

--
-- Table structure for table `navigation_menus`
--

CREATE TABLE `navigation_menus` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `location` varchar(32) NOT NULL DEFAULT 'admin',
  `label` varchar(120) NOT NULL,
  `route_name` varchar(160) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `icon` varchar(64) DEFAULT NULL,
  `sort_order` int NOT NULL DEFAULT '0',
  `is_visible` tinyint(1) NOT NULL DEFAULT '1',
  `open_in_new_tab` tinyint(1) NOT NULL DEFAULT '0',
  `badge_key` varchar(64) DEFAULT NULL,
  `permission_key` varchar(64) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `nav_loc_label` (`location`,`label`),
  KEY `nav_loc_sort` (`location`,`sort_order`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `navigation_menus`
--

INSERT INTO `navigation_menus` VALUES (1,'admin','Dashboard','admin.dashboard',NULL,NULL,10,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(2,'admin','Customers','admin.customers.index',NULL,NULL,20,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 12:31:15'),(3,'admin','Loans','admin.loans.index',NULL,NULL,30,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(4,'admin','Accounts','admin.accounts.index',NULL,NULL,40,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(5,'admin','Investments','admin.investments.index',NULL,NULL,50,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(6,'admin','Treasury','admin.treasury.index',NULL,NULL,60,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(7,'admin','Accounting','admin.accounting.chart',NULL,NULL,70,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(8,'admin','CRM','admin.crm.index',NULL,NULL,80,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(9,'admin','Operations','admin.operations.index',NULL,NULL,90,1,0,'pending_auth',NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(10,'admin','Reports','admin.reports.portfolio',NULL,NULL,100,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(11,'admin','Staff','admin.staff.index',NULL,NULL,110,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(12,'admin','Menus','admin.menus.index',NULL,NULL,115,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(13,'admin','Settings','admin.settings.index',NULL,NULL,120,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(14,'portal','Dashboard','portal.dashboard',NULL,NULL,10,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(15,'portal','My Accounts','portal.accounts.index',NULL,NULL,20,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31'),(16,'portal','My Loans','portal.loans.index',NULL,NULL,30,1,0,NULL,NULL,'2026-07-31 13:13:31','2026-07-31 13:13:31');

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

CREATE TABLE `notifications` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `customer_id` bigint unsigned DEFAULT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `body` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'info',
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `notifications_uuid_unique` (`uuid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notifications`
--

INSERT INTO `notifications` VALUES (1,'dddddddd-dddd-dddd-dddd-dddddddd0001',6,NULL,'Pending authorization','Loan LN-2026-0002 awaits disbursement authorization','action',NULL,'2026-07-28 15:38:35','2026-07-28 15:38:35'),(2,'dddddddd-dddd-dddd-dddd-dddddddd0002',2,NULL,'New loan application','Women Initiative Loan submitted by Halima Sani','info',NULL,'2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Table structure for table `permission_role`
--

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

--
-- Dumping data for table `permission_role`
--

INSERT INTO `permission_role` VALUES (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1),(11,1),(12,1),(13,1),(14,1),(15,1),(1,2),(2,2),(3,2),(4,2),(11,2),(12,2),(1,3),(2,3),(3,3),(11,3),(1,4),(5,4),(6,4),(7,4),(8,4),(9,4),(12,4),(1,5),(2,5),(9,5),(12,5),(15,5),(1,6),(3,6),(5,6),(9,6),(1,7),(3,7),(5,7),(10,7),(1,10),(2,10),(3,10),(4,10),(5,10),(6,10),(7,10),(8,10),(9,10),(10,10),(11,10),(12,10),(13,10),(14,10),(15,10);

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

CREATE TABLE `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `module` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `permissions` VALUES (1,'View Dashboard','dashboard.view','dashboard','2026-07-28 15:38:34','2026-07-28 15:38:34'),(2,'Manage Customers','customers.manage','customers','2026-07-28 15:38:34','2026-07-28 15:38:34'),(3,'Manage Loans','loans.manage','loans','2026-07-28 15:38:34','2026-07-28 15:38:34'),(4,'Approve Loans','loans.approve','loans','2026-07-28 15:38:34','2026-07-28 15:38:34'),(5,'Manage Accounts','accounts.manage','accounts','2026-07-28 15:38:34','2026-07-28 15:38:34'),(6,'Manage Investments','investments.manage','investments','2026-07-28 15:38:34','2026-07-28 15:38:34'),(7,'Manage Treasury','treasury.manage','treasury','2026-07-28 15:38:34','2026-07-28 15:38:34'),(8,'Manage Accounting','accounting.manage','accounting','2026-07-28 15:38:34','2026-07-28 15:38:34'),(9,'Authorize Operations','operations.authorize','operations','2026-07-28 15:38:34','2026-07-28 15:38:34'),(10,'Input Operations','operations.input','operations','2026-07-28 15:38:34','2026-07-28 15:38:34'),(11,'Manage CRM','crm.manage','crm','2026-07-28 15:38:34','2026-07-28 15:38:34'),(12,'View Reports','reports.view','reports','2026-07-28 15:38:34','2026-07-28 15:38:34'),(13,'Manage Staff','staff.manage','staff','2026-07-28 15:38:34','2026-07-28 15:38:34'),(14,'Manage Settings','settings.manage','settings','2026-07-28 15:38:34','2026-07-28 15:38:34'),(15,'Compliance Review','compliance.review','compliance','2026-07-28 15:38:34','2026-07-28 15:38:34');

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

CREATE TABLE `roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` 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,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `roles` VALUES (1,'Managing Director','managing-director','Executive oversight and final approvals','2026-07-28 15:38:34','2026-07-28 15:38:34'),(2,'Marketing & Credit Lead','credit-lead','Credit team leadership and underwriting','2026-07-28 15:38:34','2026-07-28 15:38:34'),(3,'Marketing/Credit Officer','credit-officer','Origination and relationship management','2026-07-28 15:38:34','2026-07-28 15:38:34'),(4,'CFO / Treasurer','cfo','Finance, treasury and accounting','2026-07-28 15:38:34','2026-07-28 15:38:34'),(5,'Internal Control & Compliance','compliance','Controls, KYC/AML and compliance','2026-07-28 15:38:34','2026-07-28 15:38:34'),(6,'Operations Authorizer','ops-authorizer','Operations dual-control authorizer','2026-07-28 15:38:34','2026-07-28 15:38:34'),(7,'Operations Inputer','ops-inputer','Operations dual-control inputer','2026-07-28 15:38:34','2026-07-28 15:38:34'),(8,'Human Resources','hr','HR administration','2026-07-28 15:38:34','2026-07-28 15:38:34'),(9,'Legal / Company Secretary','legal','Legal advisory and company secretariat','2026-07-28 15:38:34','2026-07-28 15:38:34'),(10,'System Administrator','admin','Full platform administration','2026-07-28 15:38:34','2026-07-28 15:38:34');

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` VALUES ('09Msv2IJAiHFecVA0tnP8FP0mI58reB2KqFzg9Xu',1,'::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cursor/3.13.10 Chrome/144.0.7559.236 Electron/40.10.3 Safari/537.36','eyJfdG9rZW4iOiJOcUhOajZzZTQwYmZlYkdNN205TG5uY0V0QmtoaFZKQXNQcmFyZ3ZjIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL3BvcnRhbFwvbG9hbnNcLzEiLCJyb3V0ZSI6InBvcnRhbC5sb2Fucy5zaG93In0sIl9mbGFzaCI6eyJvbGQiOltdLCJuZXciOltdfSwibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiOjEsInVybCI6W10sInBvcnRhbF9jdXN0b21lcl9pZCI6MX0=',1785505185),('4GfppUdhWWlRlMpgI1NqBkSxjmtMxwfU20WHxcae',NULL,'::1','curl/8.18.0','eyJfdG9rZW4iOiJDQm1hYU1QUFJRbXk3TUtDeWJJd2dvTG9TOUFiNXVVQnZIeUlJUVByIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2UiLCJyb3V0ZSI6ImhvbWUifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==',1785506043),('98cYk8wWuXcrzpVvAdjyVpVdhE6IVbKEgMVNP1gP',NULL,'::1','curl/8.18.0','eyJfdG9rZW4iOiJiSThObjUySkV6dmxTWUtmUkJlQUpySEhYbDdpMjVzWEFnaWtITWUxIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL3BvcnRhbFwvbG9naW4iLCJyb3V0ZSI6InBvcnRhbC5sb2dpbiJ9LCJfZmxhc2giOnsib2xkIjpbXSwibmV3IjpbXX19',1785505151),('bIqZbEAoUlT7pnCjoYzNn8L3HMohI4Qdy9GPnJRh',NULL,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','eyJfdG9rZW4iOiJ4eGN3TnZzOGZNbHVDeDltTHdFTU1jME5oOEVVMVg3Z21sQzg2MHRGIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJfcHJldmlvdXMiOnsidXJsIjoiaHR0cDpcL1wvbG9jYWxob3N0XC9jcmVkZW5jZVwvcG9ydGFsXC9sb2dpbiIsInJvdXRlIjoicG9ydGFsLmxvZ2luIn19',1785504712),('DBeDGoARrNNtSuTNg35O3zc86Gu7AUAHTMFg8EFZ',NULL,'::1','curl/8.18.0','eyJfdG9rZW4iOiJsNVdEc3ZVWU9hb1BiNWZmTWtBZ2NQbE9lc0JnanMzM2Fpclk1ZjNvIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL3BvcnRhbFwvbG9naW4iLCJyb3V0ZSI6InBvcnRhbC5sb2dpbiJ9LCJfZmxhc2giOnsib2xkIjpbXSwibmV3IjpbXX19',1785504676),('drvzU10gyN1WFQmBmLLS5TgSBlFNnPu1ZRS086vX',NULL,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','eyJfdG9rZW4iOiJQaUl0NDEwYnI0WWFkOGZHanFPTmhEbXZXa3c5Wk1PaHRjdnVFcmFTIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJfcHJldmlvdXMiOnsidXJsIjoiaHR0cDpcL1wvbG9jYWxob3N0XC9jcmVkZW5jZVwvcG9ydGFsXC9sb2dpbiIsInJvdXRlIjoicG9ydGFsLmxvZ2luIn19',1785505229),('FKlGz2YVDUBuqacwMv86hpGpQeJIOMwkPjuyn6p8',1,'::1','curl/8.18.0','eyJfdG9rZW4iOiJ0dENzOGl2ZVV6d3cyUFR5THNpTHE0aGt2aDNUWDI2ekVmREJWcTExIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL2FkbWluXC9tZW51cyIsInJvdXRlIjoiYWRtaW4ubWVudXMuaW5kZXgifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI6MX0=',1785504630),('ggOYF4CkILYmcMLDOAetec5cfQRWHs6lbTruut9I',NULL,'127.0.0.1','curl/8.18.0','eyJfdG9rZW4iOiJIdEFZYm90WEhzQnFSNjVFUjZsN2Z3S0pmMDF3V1Bxem9ieWVneGk4IiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cLzEyNy4wLjAuMVwvY3JlZGVuY2UiLCJyb3V0ZSI6ImhvbWUifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==',1785502741),('IMQDaoHYIyZ5tp8kfgazHA8da61jIqdXkLzTAunT',NULL,'127.0.0.1','curl/8.18.0','eyJfdG9rZW4iOiJzaEVVUHp1UVVkdEFpTVFOa1g1RkMxYlc2M2szN1FTQmcyWVhzUDJ2IiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cLzEyNy4wLjAuMVwvY3JlZGVuY2VcL2xvZ2luIiwicm91dGUiOiJsb2dpbiJ9LCJfZmxhc2giOnsib2xkIjpbXSwibmV3IjpbXX19',1785502942),('J2G9xdlA2nu1kjT3rFEUjWTWvh8zxGD5xIOf2cpy',NULL,'::1','curl/8.18.0','eyJfdG9rZW4iOiJkSDRhZmZkbExkbDVVY0NLUW5na25jYUlPWUF1RGxsNE91d2tPYnk0IiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL3BvcnRhbFwvZGFzaGJvYXJkIiwicm91dGUiOiJwb3J0YWwuZGFzaGJvYXJkIn0sIl9mbGFzaCI6eyJvbGQiOltdLCJuZXciOltdfSwicG9ydGFsX2N1c3RvbWVyX2lkIjoxfQ==',1785504678),('JqFkC7xJRCILgdX0fn0l0nxY674GpVX9V9b5BCwv',NULL,'127.0.0.1','curl/8.18.0','eyJfdG9rZW4iOiJPcVEzcW5pU1BBMWk4azdoVlp3dnZXQlhwMXB4djZkNmt3aGFselhNIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cLzEyNy4wLjAuMVwvY3JlZGVuY2UiLCJyb3V0ZSI6ImhvbWUifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==',1785502751),('KZozgvaMy3o4Vtl8sTxXTRfVDUO6L06EJhYho4Qh',NULL,'::1','curl/8.18.0','eyJfdG9rZW4iOiJBaUlnS1N2cFNCZnZnRDhscVRjRWpmVG1BWmN2bDR6THlmTTlZRjIwIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2UiLCJyb3V0ZSI6ImhvbWUifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==',1785506358),('N1dhSLHwJvF7mvcmDDkePavReGytEQ4AvJHON6Rz',NULL,'127.0.0.1','curl/8.18.0','eyJfdG9rZW4iOiI3N2RUZEdCdmNRYnE5R05hdHl3Y05McGIyemdXMlpVNDhJWEt6ZllRIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cLzEyNy4wLjAuMVwvY3JlZGVuY2VcL2xvZ2luP2VtYWlsPWFkbWluJTQwZnVuZGlmaW5hbmNlLm5nIiwicm91dGUiOiJsb2dpbiJ9LCJfZmxhc2giOnsib2xkIjpbXSwibmV3IjpbXX19',1785502942),('NWShFHgOJG16dwOFC4Dkryvupo5wwCMCdfIc38Vz',3,'::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cursor/3.13.10 Chrome/144.0.7559.236 Electron/40.10.3 Safari/537.36','eyJfdG9rZW4iOiJWaVdQYWZjT2lPZFhNU3B3STdBMVoybGM2MUxUNW1vN3JCQkd4UThiIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2UiLCJyb3V0ZSI6ImhvbWUifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJ1cmwiOltdLCJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI6M30=',1785506455),('O9d4ueQgpuNeLWsCjRzBEChDHLZJoHdjbzps8t8g',NULL,'::1','curl/8.18.0','eyJfdG9rZW4iOiIxN0RyV1NCampHWWZWeGMya1oyTTUxa1l0N0oyMVNCcVBEeGFGMjFtIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2UiLCJyb3V0ZSI6ImhvbWUifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==',1785504247),('P7ouvINIKtwGvcna8B496MMnDBcYkaQzAYDlGJG5',1,'::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cursor/3.13.10 Chrome/144.0.7559.236 Electron/40.10.3 Safari/537.36','eyJfdG9rZW4iOiJJNEhIb1M5QXZXajdDUnc0cGZsNUFEQk1NZTYxbWVMc0x1SEtIdDVLIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL3BvcnRhbFwvbG9naW4iLCJyb3V0ZSI6InBvcnRhbC5sb2dpbiJ9LCJfZmxhc2giOnsib2xkIjpbXSwibmV3IjpbXX0sImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjoxLCJ1cmwiOnsiaW50ZW5kZWQiOiJodHRwOlwvXC9sb2NhbGhvc3RcL2NyZWRlbmNlXC9wb3J0YWxcL2xvYW5zXC8xIn19',1785505158),('pkcn0SRYpYKSLx5iEEpvlCDIihhAOHNnulQviL4w',NULL,'127.0.0.1','curl/8.18.0','eyJfdG9rZW4iOiJLUTVOUzI0Mm9FYURqR1ZPWGN0aWd0eWphMHVmY1NldTRrWmJzazh2IiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==',1785502751),('PYFiCBFIBjw2gEdDa0iEsAtT6JHqpyZzNUJWLvIw',NULL,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','eyJfdG9rZW4iOiJSVEVaSFdMV1R2TGNzSGIyVFVFRUIzNHUxTUIwOEM1OXM1bTNVaUZUIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJfcHJldmlvdXMiOnsidXJsIjoiaHR0cDpcL1wvbG9jYWxob3N0XC9jcmVkZW5jZVwvcG9ydGFsXC9sb2dpbiIsInJvdXRlIjoicG9ydGFsLmxvZ2luIn19',1785505204),('QEpQZ0CQDCaccfWbkmDVEMJA7bhmFPG5agkVCHrD',10,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','eyJfdG9rZW4iOiIyeGpMTHRyM252QzNBM1B0OHVIOUIwVE45bW15RDM3NUtGYkY3Z0Y4IiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJfcHJldmlvdXMiOnsidXJsIjoiaHR0cDpcL1wvbG9jYWxob3N0XC9jcmVkZW5jZVwvYWRtaW5cL2xvYW5zIiwicm91dGUiOiJhZG1pbi5sb2Fucy5pbmRleCJ9LCJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI6MTB9',1785505498),('qWWTYku8EjpdcqdAad1ZZDok0KsmqtdVBV6DYKGu',1,'::1','curl/8.18.0','eyJfdG9rZW4iOiJxVjFzNVNORW8xalZ6cktnNHVjNFZkYU1Ca3RZUVM1bjQ3aUJvdnVJIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL2FkbWluXC9sb2FucyIsInJvdXRlIjoiYWRtaW4ubG9hbnMuaW5kZXgifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI6MX0=',1785504291),('rkBxTurUp9AHXrt27gmj7txBS5gsVlTv0XZye3Nk',NULL,'::1','curl/8.18.0','eyJfdG9rZW4iOiJaQm1xaHFzYURyQlQwZXp0WXFPcEFZZ1J3NU9vdHhMTGJYaU1vd1pnIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2UiLCJyb3V0ZSI6ImhvbWUifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==',1785506088),('s1kJlW1jklLmrBeiytTsBYaYNVGG6ar30IGxtvQi',NULL,'127.0.0.1','curl/8.18.0','eyJfdG9rZW4iOiJnczRNQ0xnak42T3JFMURRd3ZVbTAwZU80aU91MnExR0JjQndKQWZOIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cLzEyNy4wLjAuMVwvY3JlZGVuY2UiLCJyb3V0ZSI6ImhvbWUifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==',1785502943),('ul4rHhIvjz9RiZVqsDsidzNA9N1SaoIYF51JdJfg',1,'::1','curl/8.18.0','eyJfdG9rZW4iOiJudk82cFpGTHZZeWhYa3I5cFp0WDJxOVEwYjRtNnNpZWJkcUtGS2RsIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL2FkbWluXC9tZW51cyIsInJvdXRlIjoiYWRtaW4ubWVudXMuaW5kZXgifSwiX2ZsYXNoIjp7Im9sZCI6WyJzdWNjZXNzIl0sIm5ldyI6W119LCJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI6MSwic3VjY2VzcyI6Ik1lbnUgaXRlbSBcdTIwMWNDdXN0b21lcnNcdTIwMWQgdXBkYXRlZC4ifQ==',1785504675),('UrljAMdNqXQJecftfimLgqaazuSjpJn8m5ky10G6',NULL,'127.0.0.1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0','eyJfdG9rZW4iOiJTd0EwWlpYY1BtQVk3TDFDckNlbE8zQU81QTdYeno1QnhxZHhqZzNvIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJfcHJldmlvdXMiOnsidXJsIjoiaHR0cDpcL1wvbG9jYWxob3N0XC9jcmVkZW5jZVwvbG9naW4iLCJyb3V0ZSI6ImxvZ2luIn19',1785506617),('wSGdJVBKL5N46Hg8r1Cy8zfSz35bN3QVRsndtbGm',NULL,'::1','curl/8.18.0','eyJfdG9rZW4iOiJ6MHQxOE00YXlueHBDUDBINThOTDBLZTFkcjdyWmlXOHJQVEsyM0NrIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL3BvcnRhbFwvbG9hbnNcLzEiLCJyb3V0ZSI6InBvcnRhbC5sb2Fucy5zaG93In0sIl9mbGFzaCI6eyJvbGQiOltdLCJuZXciOltdfSwicG9ydGFsX2N1c3RvbWVyX2lkIjoxfQ==',1785505151),('Z07VhVZtHY0qJYGIMMGB7ETz880KXRPrCUMOScKt',NULL,'::1','curl/8.18.0','eyJfdG9rZW4iOiJkMk96a1hZYU5xeHljNWZsaUM3M3ZGVVZRWVNTV1phYjZjbHZyNUI1IiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdFwvY3JlZGVuY2VcL2xvZ2luIiwicm91dGUiOiJsb2dpbiJ9LCJfZmxhc2giOnsib2xkIjpbXSwibmV3IjpbXX19',1785506043);

--
-- Table structure for table `treasury_instruments`
--

CREATE TABLE `treasury_instruments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `instrument_type` enum('treasury_bill','commercial_paper','bond','money_market') COLLATE utf8mb4_unicode_ci NOT NULL,
  `issuer` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `face_value` decimal(18,2) NOT NULL,
  `coupon_rate` decimal(8,4) DEFAULT NULL,
  `discount_rate` decimal(8,4) DEFAULT NULL,
  `issue_date` date DEFAULT NULL,
  `maturity_date` date DEFAULT NULL,
  `status` enum('available','subscribed','matured','sold') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'available',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `treasury_instruments_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `treasury_instruments`
--

INSERT INTO `treasury_instruments` VALUES (1,'NTB-364-2026A','CBN Treasury Bill 364-Day','treasury_bill','Central Bank of Nigeria',10000000.00,NULL,12.5000,'2026-01-15','2027-01-14','available','2026-07-28 15:38:34','2026-07-28 15:38:34'),(2,'CP-DANG-90','Dangote CP 90-Day','commercial_paper','Dangote Industries',5000000.00,NULL,14.0000,'2026-06-01','2026-08-30','available','2026-07-28 15:38:34','2026-07-28 15:38:34'),(3,'FGN-2031','FGN Bond 2031','bond','Debt Management Office',20000000.00,13.5000,NULL,'2024-03-01','2031-03-01','subscribed','2026-07-28 15:38:34','2026-07-28 15:38:34'),(4,'MM-CALL-001','Overnight Money Market','money_market','Interbank',1000000.00,11.0000,NULL,'2026-07-28','2026-07-29','available','2026-07-28 15:38:34','2026-07-28 15:38:34');

--
-- Table structure for table `treasury_positions`
--

CREATE TABLE `treasury_positions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `position_no` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `instrument_id` bigint unsigned NOT NULL,
  `portfolio` enum('own_book','client_managed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'own_book',
  `customer_id` bigint unsigned DEFAULT NULL,
  `quantity` decimal(18,2) NOT NULL DEFAULT '1.00',
  `cost_amount` decimal(18,2) NOT NULL,
  `market_value` decimal(18,2) DEFAULT NULL,
  `purchase_date` date NOT NULL,
  `status` enum('open','closed') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `created_by` bigint unsigned DEFAULT NULL,
  `authorized_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `treasury_positions_uuid_unique` (`uuid`),
  UNIQUE KEY `treasury_positions_position_no_unique` (`position_no`),
  KEY `treasury_positions_instrument_id_foreign` (`instrument_id`),
  CONSTRAINT `treasury_positions_instrument_id_foreign` FOREIGN KEY (`instrument_id`) REFERENCES `treasury_instruments` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `treasury_positions`
--

INSERT INTO `treasury_positions` VALUES (1,'88888888-8888-8888-8888-888888888001','TRP-2026-0001',3,'own_book',NULL,1.00,19500000.00,19800000.00,'2025-11-15','open',4,1,'2026-07-28 15:38:35','2026-07-28 15:38:35');

--
-- Dumping routines for database 'fundi_finance'
--


