-- MariaDB dump 10.19  Distrib 10.4.32-MariaDB, for Win64 (AMD64)
--
-- Host: 127.0.0.1    Database: microfinance_saas
-- ------------------------------------------------------
-- Server version	10.4.32-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `accounting_accounts`
--

DROP TABLE IF EXISTS `accounting_accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounting_accounts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `code` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  `balance` decimal(14,2) NOT NULL DEFAULT 0.00,
  `is_system` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `accounting_accounts_tenant_id_code_unique` (`tenant_id`,`code`),
  KEY `accounting_accounts_tenant_id_type_index` (`tenant_id`,`type`),
  KEY `accounting_accounts_type_index` (`type`),
  CONSTRAINT `accounting_accounts_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accounting_accounts`
--

LOCK TABLES `accounting_accounts` WRITE;
/*!40000 ALTER TABLE `accounting_accounts` DISABLE KEYS */;
INSERT INTO `accounting_accounts` VALUES (1,1,'1000','Cash on Hand','asset',50000.00,1,'2026-05-08 05:25:25','2026-05-08 05:25:26'),(2,1,'1100','Loans Receivable','asset',100000.00,1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(3,1,'2000','Customer Savings Liability','liability',150000.00,1,'2026-05-08 05:25:25','2026-05-08 05:25:26'),(4,1,'3000','Owner Equity','equity',0.00,1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(5,1,'4000','Interest Income','income',0.00,1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(6,1,'4100','Other Income','income',0.00,1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(7,1,'5000','Operating Expenses','expense',0.00,1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(8,1,'5100','Penalty Income','income',0.00,1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(9,2,'1000','Cash on Hand','asset',-384000.00,1,'2026-05-08 08:50:34','2026-05-14 03:55:42'),(10,2,'1100','Loans Receivable','asset',440000.00,1,'2026-05-08 08:50:34','2026-05-10 09:39:11'),(11,2,'2000','Customer Savings Liability','liability',29000.00,1,'2026-05-08 08:50:34','2026-05-14 03:55:42'),(12,2,'3000','Owner Equity','equity',0.00,1,'2026-05-08 08:50:34','2026-05-08 08:50:34'),(13,2,'4000','Interest Income','income',27000.00,1,'2026-05-08 08:50:34','2026-05-10 09:39:11'),(14,2,'4100','Other Income','income',0.00,1,'2026-05-08 08:50:34','2026-05-08 08:50:34'),(15,2,'5000','Operating Expenses','expense',0.00,1,'2026-05-08 08:50:34','2026-05-08 08:50:34'),(16,2,'5100','Penalty Income','income',0.00,1,'2026-05-08 08:50:34','2026-05-08 08:50:34'),(17,3,'1000','Cash on Hand','asset',0.00,1,'2026-05-09 02:02:14','2026-05-09 02:02:14'),(18,3,'1100','Loans Receivable','asset',0.00,1,'2026-05-09 02:02:14','2026-05-09 02:02:14'),(19,3,'2000','Customer Savings Liability','liability',0.00,1,'2026-05-09 02:02:14','2026-05-09 02:02:14'),(20,3,'3000','Owner Equity','equity',0.00,1,'2026-05-09 02:02:14','2026-05-09 02:02:14'),(21,3,'4000','Interest Income','income',0.00,1,'2026-05-09 02:02:14','2026-05-09 02:02:14'),(22,3,'4100','Other Income','income',0.00,1,'2026-05-09 02:02:14','2026-05-09 02:02:14'),(23,3,'5000','Operating Expenses','expense',0.00,1,'2026-05-09 02:02:14','2026-05-09 02:02:14'),(24,3,'5100','Penalty Income','income',0.00,1,'2026-05-09 02:02:14','2026-05-09 02:02:14');
/*!40000 ALTER TABLE `accounting_accounts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `activity_logs`
--

DROP TABLE IF EXISTS `activity_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `activity_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `action` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `subject_type` varchar(255) DEFAULT NULL,
  `subject_id` bigint(20) unsigned DEFAULT NULL,
  `properties` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`properties`)),
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `activity_logs_user_id_foreign` (`user_id`),
  KEY `activity_logs_tenant_id_created_at_index` (`tenant_id`,`created_at`),
  KEY `activity_logs_action_index` (`action`),
  KEY `activity_logs_subject_type_index` (`subject_type`),
  KEY `activity_logs_subject_id_index` (`subject_id`),
  CONSTRAINT `activity_logs_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `activity_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `activity_logs`
--

LOCK TABLES `activity_logs` WRITE;
/*!40000 ALTER TABLE `activity_logs` DISABLE KEYS */;
INSERT INTO `activity_logs` VALUES (1,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 07:25:54','2026-05-08 07:25:54'),(2,NULL,1,'tenant_suspended','Demo Microfinance was suspended.','App\\Models\\Tenant',1,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 07:28:20','2026-05-08 07:28:20'),(3,NULL,1,'tenant_reactivated','Demo Microfinance was reactivated.','App\\Models\\Tenant',1,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 07:28:25','2026-05-08 07:28:25'),(4,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 08:47:49','2026-05-08 08:47:49'),(5,NULL,NULL,'tenant_registered','New tenant registration received for Newkipp','App\\Models\\Tenant',2,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 08:49:41','2026-05-08 08:49:41'),(6,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 08:49:57','2026-05-08 08:49:57'),(7,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 08:50:14','2026-05-08 08:50:14'),(8,NULL,1,'tenant_approved','Newkipp was approved.','App\\Models\\Tenant',2,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 08:50:34','2026-05-08 08:50:34'),(9,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 08:50:42','2026-05-08 08:50:42'),(10,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 08:51:07','2026-05-08 08:51:07'),(11,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:38:49','2026-05-08 14:38:49'),(12,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:43:08','2026-05-08 14:43:08'),(13,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:43:20','2026-05-08 14:43:20'),(14,2,6,'customer_created','Emeka Obiozor registered.','App\\Models\\Customer',4,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:50:08','2026-05-08 14:50:08'),(15,2,6,'savings_deposit','Deposit posted on NEWK-SAV-260500001','App\\Models\\SavingsTransaction',4,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:51:48','2026-05-08 14:51:48'),(16,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:54:46','2026-05-08 14:54:46'),(17,2,7,'login','Emeka Obiozor signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:54:52','2026-05-08 14:54:52'),(18,2,7,'logout','Emeka Obiozor signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:55:03','2026-05-08 14:55:03'),(19,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:55:08','2026-05-08 14:55:08'),(20,2,6,'loan_applied','Loan NEWK-LON-260500001 submitted.','App\\Models\\Loan',2,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:58:57','2026-05-08 14:58:57'),(21,2,6,'loan_approved','Loan NEWK-LON-260500001 approved.','App\\Models\\Loan',2,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:59:18','2026-05-08 14:59:18'),(22,2,6,'loan_disbursed','Loan NEWK-LON-260500001 disbursed.','App\\Models\\Loan',2,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 14:59:28','2026-05-08 14:59:28'),(23,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 15:04:22','2026-05-08 15:04:22'),(24,2,7,'login','Emeka Obiozor signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 15:04:28','2026-05-08 15:04:28'),(25,2,7,'logout','Emeka Obiozor signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 15:09:00','2026-05-08 15:09:00'),(26,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 15:09:06','2026-05-08 15:09:06'),(27,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 15:32:41','2026-05-08 15:32:41'),(28,2,7,'login','Emeka Obiozor signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 15:32:48','2026-05-08 15:32:48'),(29,2,7,'logout','Emeka Obiozor signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-08 16:07:12','2026-05-08 16:07:12'),(30,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:30:10','2026-05-09 01:30:10'),(31,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:30:33','2026-05-09 01:30:33'),(32,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:30:39','2026-05-09 01:30:39'),(33,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:36:50','2026-05-09 01:36:50'),(34,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:36:56','2026-05-09 01:36:56'),(35,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:37:57','2026-05-09 01:37:57'),(36,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:38:04','2026-05-09 01:38:04'),(37,NULL,1,'subscription_payment_approved','Payment SUB-20260509023751-VK7RK approved.','App\\Models\\TenantPayment',1,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:45:33','2026-05-09 01:45:33'),(38,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:46:03','2026-05-09 01:46:03'),(39,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:46:08','2026-05-09 01:46:08'),(40,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:47:05','2026-05-09 01:47:05'),(41,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 01:47:11','2026-05-09 01:47:11'),(42,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','node','2026-05-09 01:52:44','2026-05-09 01:52:44'),(43,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','node','2026-05-09 01:58:47','2026-05-09 01:58:47'),(44,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:00:50','2026-05-09 02:00:50'),(45,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:01:15','2026-05-09 02:01:15'),(46,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:01:22','2026-05-09 02:01:22'),(47,NULL,NULL,'tenant_auto_approved','akpaku registered and was automatically approved for a 14 day free trial.','App\\Models\\Tenant',3,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:02:14','2026-05-09 02:02:14'),(48,3,8,'logout','okolo signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:02:33','2026-05-09 02:02:33'),(49,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:02:48','2026-05-09 02:02:48'),(50,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','node','2026-05-09 02:10:23','2026-05-09 02:10:23'),(51,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','node','2026-05-09 02:15:38','2026-05-09 02:15:38'),(52,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','node','2026-05-09 02:31:23','2026-05-09 02:31:23'),(53,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','node','2026-05-09 02:42:08','2026-05-09 02:42:08'),(54,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:43:59','2026-05-09 02:43:59'),(55,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:44:09','2026-05-09 02:44:09'),(56,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','node','2026-05-09 02:45:54','2026-05-09 02:45:54'),(57,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:46:15','2026-05-09 02:46:15'),(58,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:46:21','2026-05-09 02:46:21'),(59,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','node','2026-05-09 02:50:28','2026-05-09 02:50:28'),(60,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:51:14','2026-05-09 02:51:14'),(61,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 02:51:19','2026-05-09 02:51:19'),(62,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','node','2026-05-09 02:57:15','2026-05-09 02:57:15'),(63,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 05:35:53','2026-05-09 05:35:53'),(64,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 05:38:56','2026-05-09 05:38:56'),(65,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 05:40:42','2026-05-09 05:40:42'),(66,3,8,'tenant_impersonation_started','Platform Owner entered akpaku as okolo.','App\\Models\\Tenant',3,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 06:14:16','2026-05-09 06:14:16'),(67,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 06:59:42','2026-05-09 06:59:42'),(68,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 06:59:49','2026-05-09 06:59:49'),(69,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Codex/26.506.21252 Chrome/146.0.7680.179 Electron/41.2.0 Safari/537.36','2026-05-09 07:09:22','2026-05-09 07:09:22'),(70,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 15:33:29','2026-05-09 15:33:29'),(73,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-09 23:07:17','2026-05-09 23:07:17'),(75,2,6,'member_created','Ebuka Obi registered.','App\\Models\\Customer',15,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 02:08:48','2026-05-10 02:08:48'),(76,2,6,'loan_applied','Loan NEWK-LON-260500002 submitted.','App\\Models\\Loan',3,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 02:28:54','2026-05-10 02:28:54'),(77,2,6,'loan_approved','Loan NEWK-LON-260500002 approved.','App\\Models\\Loan',3,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 02:30:02','2026-05-10 02:30:02'),(78,2,6,'loan_disbursed','Loan NEWK-LON-260500002 disbursed.','App\\Models\\Loan',3,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 02:30:07','2026-05-10 02:30:07'),(79,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 05:06:41','2026-05-10 05:06:41'),(80,2,6,'loan_applied','Loan NEWK-LON-260500003 submitted.','App\\Models\\Loan',5,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 05:22:38','2026-05-10 05:22:38'),(81,2,6,'loan_approved','Loan NEWK-LON-260500003 approved.','App\\Models\\Loan',5,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 05:22:44','2026-05-10 05:22:44'),(82,2,6,'loan_disbursed','Loan NEWK-LON-260500003 disbursed.','App\\Models\\Loan',5,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 05:22:57','2026-05-10 05:22:57'),(83,2,6,'loan_applied','Loan NEWK-LON-260500004 submitted.','App\\Models\\Loan',6,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 05:31:29','2026-05-10 05:31:29'),(84,2,6,'loan_approved','Loan NEWK-LON-260500004 approved.','App\\Models\\Loan',6,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 05:32:11','2026-05-10 05:32:11'),(85,2,6,'loan_schedule_regenerated','Repayment schedule regenerated for loan NEWK-LON-260500004.','App\\Models\\Loan',6,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 05:32:16','2026-05-10 05:32:16'),(86,2,6,'loan_disbursed','Loan NEWK-LON-260500004 disbursed.','App\\Models\\Loan',6,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 05:40:33','2026-05-10 05:40:33'),(87,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 05:51:12','2026-05-10 05:51:12'),(88,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 06:01:01','2026-05-10 06:01:01'),(89,NULL,1,'agent_created','AGU was created by super admin.','App\\Models\\Agent',1,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 06:10:29','2026-05-10 06:10:29'),(90,NULL,1,'logout','Platform Owner signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 06:11:22','2026-05-10 06:11:22'),(91,NULL,10,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 06:11:29','2026-05-10 06:11:29'),(92,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 08:52:15','2026-05-10 08:52:15'),(93,2,6,'loan_applied','Loan NEWK-LON-260500005 submitted.','App\\Models\\Loan',8,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:05:50','2026-05-10 09:05:50'),(94,2,6,'loan_approved','Loan NEWK-LON-260500005 approved.','App\\Models\\Loan',8,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:09:16','2026-05-10 09:09:16'),(95,2,6,'loan_disbursed','Loan NEWK-LON-260500005 disbursed.','App\\Models\\Loan',8,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:09:33','2026-05-10 09:09:33'),(96,2,6,'loan_schedule_regenerated','Repayment schedule regenerated for loan NEWK-LON-260500005.','App\\Models\\Loan',8,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:15:43','2026-05-10 09:15:43'),(97,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:26:56','2026-05-10 09:26:56'),(98,NULL,10,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:27:00','2026-05-10 09:27:00'),(99,NULL,10,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:27:04','2026-05-10 09:27:04'),(100,2,9,'login','Ebuka Obi signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:27:09','2026-05-10 09:27:09'),(101,2,9,'logout','Ebuka Obi signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:30:46','2026-05-10 09:30:46'),(102,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:30:52','2026-05-10 09:30:52'),(103,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:30:59','2026-05-10 09:30:59'),(104,2,11,'member_self_registered','Amaka Okonkwo joined from the public tenant link.','App\\Models\\Customer',16,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:32:30','2026-05-10 09:32:30'),(105,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-10 09:33:45','2026-05-10 09:33:45'),(106,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-10 09:34:13','2026-05-10 09:34:13'),(107,2,11,'logout','Amaka Okonkwo signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:34:39','2026-05-10 09:34:39'),(108,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:34:45','2026-05-10 09:34:45'),(109,2,6,'member_updated','Ebuka Obi profile updated.','App\\Models\\Customer',15,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:51:07','2026-05-10 09:51:07'),(110,2,6,'logout','Polite Chinwike signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:51:35','2026-05-10 09:51:35'),(111,2,11,'login','Amaka Okonkwo signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 09:51:45','2026-05-10 09:51:45'),(112,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-10 10:05:00','2026-05-10 10:05:00'),(113,1,NULL,'member_kyc_verified','Smoke Portal Member KYC verified by local profile check.','App\\Models\\Customer',17,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-10 10:05:27','2026-05-10 10:05:27'),(114,1,NULL,'member_self_registered','Smoke Portal Member joined from the public tenant link.','App\\Models\\Customer',17,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-10 10:05:27','2026-05-10 10:05:27'),(115,2,11,'logout','Amaka Okonkwo signed out.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 10:07:56','2026-05-10 10:07:56'),(116,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-10 10:08:02','2026-05-10 10:08:02'),(117,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-10 10:15:40','2026-05-10 10:15:40'),(118,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 02:51:38','2026-05-14 02:51:38'),(119,2,6,'login','Polite Chinwike signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-14 02:53:18','2026-05-14 02:53:18'),(120,2,6,'member_created','Chidi Okoye registered.','App\\Models\\Customer',18,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-14 02:55:17','2026-05-14 02:55:17'),(121,2,6,'loan_applied','Loan NEWK-MKL-260500006 submitted.','App\\Models\\Loan',9,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-14 03:06:34','2026-05-14 03:06:34'),(122,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 03:08:23','2026-05-14 03:08:23'),(123,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 03:14:28','2026-05-14 03:14:28'),(124,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 03:28:26','2026-05-14 03:28:26'),(125,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 03:33:58','2026-05-14 03:33:58'),(126,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 03:34:18','2026-05-14 03:34:18'),(127,2,6,'savings_product_updated','Savings product Thrift / Isusu Savings updated.','App\\Models\\SavingsProduct',6,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-14 03:34:46','2026-05-14 03:34:46'),(128,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 03:43:00','2026-05-14 03:43:00'),(129,2,6,'savings_account_opened','Thrift / Isusu Savings opened for Chidi Okoye.','App\\Models\\SavingsAccount',7,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-14 03:43:44','2026-05-14 03:43:44'),(130,2,6,'savings_deposit','Deposit posted on NEWK-ISU-260500003','App\\Models\\SavingsTransaction',5,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-14 03:44:24','2026-05-14 03:44:24'),(131,2,6,'savings_deposit','Deposit posted on NEWK-ISU-260500003','App\\Models\\SavingsTransaction',6,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-14 03:47:27','2026-05-14 03:47:27'),(132,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 03:52:27','2026-05-14 03:52:27'),(133,2,6,'savings_deposit','Deposit posted on NEWK-ISU-260500003','App\\Models\\SavingsTransaction',7,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-14 03:55:42','2026-05-14 03:55:42'),(134,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 03:59:45','2026-05-14 03:59:45'),(135,2,6,'savings_account_opened','Cooperative Savings opened for Amaka Okonkwo.','App\\Models\\SavingsAccount',8,'[]','127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','2026-05-14 04:06:41','2026-05-14 04:06:41'),(136,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 04:17:04','2026-05-14 04:17:04'),(137,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 04:17:31','2026-05-14 04:17:31'),(138,1,2,'investment_account_opened','Investment SHR-260500001 opened for Amina Okafor.','App\\Models\\InvestmentAccount',1,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 04:17:33','2026-05-14 04:17:33'),(139,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 04:17:57','2026-05-14 04:17:57'),(140,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 04:57:21','2026-05-14 04:57:21'),(141,NULL,1,'login','Platform Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 04:57:39','2026-05-14 04:57:39'),(142,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 04:57:57','2026-05-14 04:57:57'),(143,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 04:58:17','2026-05-14 04:58:17'),(144,1,2,'login','Demo Owner signed in.',NULL,NULL,'[]','127.0.0.1','Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.6456','2026-05-14 04:58:39','2026-05-14 04:58:39');
/*!40000 ALTER TABLE `activity_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `agent_commissions`
--

DROP TABLE IF EXISTS `agent_commissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `agent_commissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `agent_id` bigint(20) unsigned NOT NULL,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `tenant_payment_id` bigint(20) unsigned DEFAULT NULL,
  `invoice_id` bigint(20) unsigned DEFAULT NULL,
  `subscription_plan_id` bigint(20) unsigned DEFAULT NULL,
  `commissionable_amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `commission_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `commission_type` varchar(30) NOT NULL DEFAULT 'onboarding',
  `commission_amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `billing_cycle` varchar(255) NOT NULL DEFAULT 'monthly',
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `earned_at` timestamp NULL DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `agent_commissions_tenant_payment_id_unique` (`tenant_payment_id`),
  KEY `agent_commissions_invoice_id_foreign` (`invoice_id`),
  KEY `agent_commissions_subscription_plan_id_foreign` (`subscription_plan_id`),
  KEY `agent_commissions_agent_id_status_earned_at_index` (`agent_id`,`status`,`earned_at`),
  KEY `agent_commissions_tenant_id_earned_at_index` (`tenant_id`,`earned_at`),
  KEY `agent_commissions_status_index` (`status`),
  KEY `agent_commissions_earned_at_index` (`earned_at`),
  KEY `agent_commissions_commission_type_index` (`commission_type`),
  CONSTRAINT `agent_commissions_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `agents` (`id`) ON DELETE CASCADE,
  CONSTRAINT `agent_commissions_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE SET NULL,
  CONSTRAINT `agent_commissions_subscription_plan_id_foreign` FOREIGN KEY (`subscription_plan_id`) REFERENCES `subscription_plans` (`id`) ON DELETE SET NULL,
  CONSTRAINT `agent_commissions_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `agent_commissions_tenant_payment_id_foreign` FOREIGN KEY (`tenant_payment_id`) REFERENCES `tenant_payments` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `agent_commissions`
--

LOCK TABLES `agent_commissions` WRITE;
/*!40000 ALTER TABLE `agent_commissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `agent_commissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `agents`
--

DROP TABLE IF EXISTS `agents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `agents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `code` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `business_name` varchar(255) DEFAULT NULL,
  `commission_rate` decimal(5,2) NOT NULL DEFAULT 10.00,
  `merchant_type` varchar(30) NOT NULL DEFAULT 'onboarding',
  `onboarding_commission_rate` decimal(5,2) NOT NULL DEFAULT 10.00,
  `referral_commission_rate` decimal(5,2) NOT NULL DEFAULT 5.00,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `bank_name` varchar(255) DEFAULT NULL,
  `account_name` varchar(255) DEFAULT NULL,
  `account_number` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `suspended_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `agents_user_id_unique` (`user_id`),
  UNIQUE KEY `agents_code_unique` (`code`),
  UNIQUE KEY `agents_slug_unique` (`slug`),
  KEY `agents_status_index` (`status`),
  CONSTRAINT `agents_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `agents`
--

LOCK TABLES `agents` WRITE;
/*!40000 ALTER TABLE `agents` DISABLE KEYS */;
INSERT INTO `agents` VALUES (1,10,'AGT-OKX2FOI4','agu','AGU',15.00,'onboarding',15.00,15.00,'active',NULL,NULL,NULL,NULL,'2026-05-10 06:10:29',NULL,'2026-05-10 06:10:29','2026-05-10 06:10:29');
/*!40000 ALTER TABLE `agents` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `app_notifications`
--

DROP TABLE IF EXISTS `app_notifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `app_notifications` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `body` text NOT NULL,
  `type` varchar(255) NOT NULL DEFAULT 'info',
  `channel` varchar(255) NOT NULL DEFAULT 'database',
  `scheduled_for` timestamp NULL DEFAULT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `app_notifications_user_id_foreign` (`user_id`),
  KEY `app_notifications_tenant_id_read_at_index` (`tenant_id`,`read_at`),
  KEY `app_notifications_type_index` (`type`),
  KEY `app_notifications_scheduled_for_index` (`scheduled_for`),
  KEY `app_notifications_read_at_index` (`read_at`),
  CONSTRAINT `app_notifications_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `app_notifications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `app_notifications`
--

LOCK TABLES `app_notifications` WRITE;
/*!40000 ALTER TABLE `app_notifications` DISABLE KEYS */;
INSERT INTO `app_notifications` VALUES (1,2,NULL,'Subscription payment approved','Your monthly subscription is active until Jun 22, 2026.','billing','database',NULL,NULL,'2026-05-09 01:45:33','2026-05-09 01:45:33');
/*!40000 ALTER TABLE `app_notifications` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `bill_payments`
--

DROP TABLE IF EXISTS `bill_payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bill_payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `recorded_by` bigint(20) unsigned DEFAULT NULL,
  `reference` varchar(255) NOT NULL,
  `service_type` varchar(255) NOT NULL,
  `provider` varchar(255) NOT NULL,
  `customer_identifier` varchar(255) NOT NULL,
  `customer_name` varchar(255) DEFAULT NULL,
  `package_name` varchar(255) DEFAULT NULL,
  `amount` decimal(14,2) NOT NULL,
  `fee` decimal(14,2) NOT NULL DEFAULT 0.00,
  `commission` decimal(14,2) NOT NULL DEFAULT 0.00,
  `total_amount` decimal(14,2) NOT NULL,
  `payment_method` varchar(255) NOT NULL DEFAULT 'cash',
  `status` varchar(255) NOT NULL DEFAULT 'successful',
  `provider_reference` varchar(255) DEFAULT NULL,
  `token` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `bill_payments_reference_unique` (`reference`),
  KEY `bill_payments_customer_id_foreign` (`customer_id`),
  KEY `bill_payments_recorded_by_foreign` (`recorded_by`),
  KEY `bill_payments_tenant_id_service_type_created_at_index` (`tenant_id`,`service_type`,`created_at`),
  KEY `bill_payments_tenant_id_status_created_at_index` (`tenant_id`,`status`,`created_at`),
  KEY `bill_payments_tenant_id_customer_identifier_index` (`tenant_id`,`customer_identifier`),
  KEY `bill_payments_service_type_index` (`service_type`),
  KEY `bill_payments_provider_index` (`provider`),
  KEY `bill_payments_customer_identifier_index` (`customer_identifier`),
  KEY `bill_payments_payment_method_index` (`payment_method`),
  KEY `bill_payments_status_index` (`status`),
  KEY `bill_payments_provider_reference_index` (`provider_reference`),
  KEY `bill_payments_processed_at_index` (`processed_at`),
  CONSTRAINT `bill_payments_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `bill_payments_recorded_by_foreign` FOREIGN KEY (`recorded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `bill_payments_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `bill_payments`
--

LOCK TABLES `bill_payments` WRITE;
/*!40000 ALTER TABLE `bill_payments` DISABLE KEYS */;
/*!40000 ALTER TABLE `bill_payments` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `branches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `branches` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `manager_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `address` text DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `branches_tenant_id_code_unique` (`tenant_id`,`code`),
  KEY `branches_manager_id_foreign` (`manager_id`),
  KEY `branches_tenant_id_is_active_index` (`tenant_id`,`is_active`),
  KEY `branches_is_active_index` (`is_active`),
  CONSTRAINT `branches_manager_id_foreign` FOREIGN KEY (`manager_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `branches_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `branches` WRITE;
/*!40000 ALTER TABLE `branches` DISABLE KEYS */;
INSERT INTO `branches` VALUES (1,1,NULL,'Head Office','HQ','12 Market Road, Lagos','+2348000000000',1,'2026-05-08 05:25:24','2026-05-08 05:25:24'),(2,2,NULL,'Head Office','HQ','fytcvjkl;',NULL,1,'2026-05-08 08:50:34','2026-05-08 08:50:34'),(3,3,NULL,'Head Office','HQ','rrrere',NULL,1,'2026-05-09 02:02:14','2026-05-09 02:02:14');
/*!40000 ALTER TABLE `branches` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cache`
--

DROP TABLE IF EXISTS `cache`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache`
--

LOCK TABLES `cache` WRITE;
/*!40000 ALTER TABLE `cache` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cache_locks`
--

DROP TABLE IF EXISTS `cache_locks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cache_locks`
--

LOCK TABLES `cache_locks` WRITE;
/*!40000 ALTER TABLE `cache_locks` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache_locks` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `customer_groups`
--

DROP TABLE IF EXISTS `customer_groups`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_groups` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `customer_groups_tenant_id_name_unique` (`tenant_id`,`name`),
  KEY `customer_groups_tenant_id_is_active_index` (`tenant_id`,`is_active`),
  KEY `customer_groups_is_active_index` (`is_active`),
  CONSTRAINT `customer_groups_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customer_groups`
--

LOCK TABLES `customer_groups` WRITE;
/*!40000 ALTER TABLE `customer_groups` DISABLE KEYS */;
INSERT INTO `customer_groups` VALUES (2,2,'Diamond',NULL,1,'2026-05-09 16:31:17','2026-05-09 16:31:17'),(3,2,'Hope',NULL,1,'2026-05-09 16:31:43','2026-05-09 16:31:43');
/*!40000 ALTER TABLE `customer_groups` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `account_officer_id` bigint(20) unsigned DEFAULT NULL,
  `customer_group_id` bigint(20) unsigned DEFAULT NULL,
  `account_number` varchar(255) NOT NULL,
  `virtual_account_provider` varchar(255) DEFAULT NULL,
  `virtual_account_bank_name` varchar(255) DEFAULT NULL,
  `virtual_account_bank_code` varchar(255) DEFAULT NULL,
  `virtual_account_number` varchar(255) DEFAULT NULL,
  `virtual_account_name` varchar(255) DEFAULT NULL,
  `virtual_account_reference` varchar(255) DEFAULT NULL,
  `virtual_account_customer_code` varchar(255) DEFAULT NULL,
  `virtual_account_status` varchar(255) NOT NULL DEFAULT 'not_created',
  `virtual_account_assigned_at` timestamp NULL DEFAULT NULL,
  `virtual_account_metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`virtual_account_metadata`)),
  `first_name` varchar(255) NOT NULL,
  `middle_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(255) NOT NULL,
  `gender` varchar(255) DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `occupation` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `photo_path` varchar(255) DEFAULT NULL,
  `id_type` varchar(255) DEFAULT NULL,
  `id_number` varchar(255) DEFAULT NULL,
  `bvn` text DEFAULT NULL,
  `bvn_verified_at` timestamp NULL DEFAULT NULL,
  `nin` text DEFAULT NULL,
  `nin_verified_at` timestamp NULL DEFAULT NULL,
  `id_upload_path` varchar(255) DEFAULT NULL,
  `guarantor_name` varchar(255) DEFAULT NULL,
  `guarantor_phone` varchar(255) DEFAULT NULL,
  `guarantor_address` text DEFAULT NULL,
  `guarantor_relationship` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `kyc_status` varchar(255) NOT NULL DEFAULT 'pending',
  `kyc_verified_at` timestamp NULL DEFAULT NULL,
  `kyc_locked_at` timestamp NULL DEFAULT NULL,
  `kyc_verification_method` varchar(255) DEFAULT NULL,
  `kyc_provider` varchar(255) DEFAULT NULL,
  `kyc_provider_session_id` varchar(255) DEFAULT NULL,
  `kyc_provider_status` varchar(255) DEFAULT NULL,
  `kyc_provider_url` text DEFAULT NULL,
  `kyc_provider_response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`kyc_provider_response`)),
  `kyc_verification_notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `customers_tenant_id_account_number_unique` (`tenant_id`,`account_number`),
  UNIQUE KEY `customers_virtual_account_number_unique` (`virtual_account_number`),
  KEY `customers_branch_id_foreign` (`branch_id`),
  KEY `customers_user_id_foreign` (`user_id`),
  KEY `customers_tenant_id_phone_index` (`tenant_id`,`phone`),
  KEY `customers_tenant_id_status_index` (`tenant_id`,`status`),
  KEY `customers_status_index` (`status`),
  KEY `customers_kyc_status_index` (`kyc_status`),
  KEY `customers_account_officer_id_foreign` (`account_officer_id`),
  KEY `customers_tenant_id_account_officer_id_index` (`tenant_id`,`account_officer_id`),
  KEY `customers_customer_group_id_foreign` (`customer_group_id`),
  KEY `customers_tenant_id_customer_group_id_index` (`tenant_id`,`customer_group_id`),
  KEY `customers_virtual_account_provider_idx` (`virtual_account_provider`),
  KEY `customers_virtual_account_reference_idx` (`virtual_account_reference`),
  KEY `customers_tenant_virtual_status_idx` (`tenant_id`,`virtual_account_status`),
  KEY `customers_tenant_id_kyc_provider_status_index` (`tenant_id`,`kyc_provider_status`),
  CONSTRAINT `customers_account_officer_id_foreign` FOREIGN KEY (`account_officer_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `customers_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `customers_customer_group_id_foreign` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_groups` (`id`) ON DELETE SET NULL,
  CONSTRAINT `customers_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `customers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `customers` WRITE;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
INSERT INTO `customers` VALUES (1,1,1,NULL,NULL,NULL,'4306317801',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'not_created',NULL,NULL,'Amina',NULL,'Okafor',NULL,'08030000001',NULL,NULL,NULL,'Customer address',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','verified',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-08 05:25:25','2026-05-09 23:18:49'),(2,1,1,NULL,NULL,NULL,'4831506817',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'not_created',NULL,NULL,'Bola',NULL,'Adeyemi',NULL,'08030000002',NULL,NULL,NULL,'Customer address',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','verified',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-08 05:25:25','2026-05-09 23:18:49'),(3,1,1,NULL,NULL,NULL,'4127248183',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'not_created',NULL,NULL,'Chinedu',NULL,'Nwosu',NULL,'08030000003',NULL,NULL,NULL,'Customer address',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','verified',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-08 05:25:25','2026-05-09 23:18:49'),(4,2,2,7,NULL,2,'4846145119',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'not_created',NULL,NULL,'Emeka',NULL,'Obiozor','emeka@newkipp.com','09087654321','male','1992-04-20','Business',NULL,NULL,NULL,'customer-photos/S9e16QfpQPRjNbsHqPRBOzBMWOsM2otiXy8FUPyW.jpg',NULL,NULL,NULL,NULL,'eyJpdiI6IlJmY3NGUjlsZGVrbzFxT2dRR3ZUV3c9PSIsInZhbHVlIjoiM1ZWZjkrdzZhbUg0ckxMeW5XZlV1Zz09IiwibWFjIjoiZjhmNzZiZDg2NDEzMTk0ZjJjZjc4OTkwMmNmOGQ3YmY3MjI3MmI2ZjQzZjE5YzIzMjBhZmUzNDU5NTViMzY2MyIsInRhZyI6IiJ9',NULL,NULL,NULL,NULL,NULL,NULL,'active','pending',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-08 14:50:08','2026-05-10 01:17:13'),(15,2,2,9,6,3,'4916612897',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'not_created',NULL,NULL,'Ebuka',NULL,'Obi','ebuka@newkipp.com','08064664226','male','1997-05-20','Business',NULL,NULL,NULL,'customer-photos/DNKVlWl8qWU5oU56y7n36UcabAYkH5VOjAhELfxR.jpg',NULL,NULL,'eyJpdiI6IkhldFZCQ3R3MGVHT0FacnNWSWdHaUE9PSIsInZhbHVlIjoiL0lLNDlMTXBQQ0ZlR1RqYnFNUlUvdz09IiwibWFjIjoiODYwNGE5YzZiMmU2MmQxMGI5NjlkZjAyNDUyYjdkMGY2Mjc0ODdmOThjOWNkNWEzNWY0MDViNmZhMDM4N2FmNiIsInRhZyI6IiJ9',NULL,'eyJpdiI6ImgxRS9qOXNHRWZlMzRZV2ZYaGw3U1E9PSIsInZhbHVlIjoiWGQ2ZC9rbFU0Ty8rNC9TUDFyaEswQT09IiwibWFjIjoiMDRiMzAwMDVmOWRkZTkwMjZhOGQ3MmNjNDIxMzVkNGE2ZWI5NTMyNzQ0YjRjMDM0NWRhZWY1MzNlMjY5YzlmZiIsInRhZyI6IiJ9',NULL,NULL,NULL,NULL,NULL,NULL,'active','pending',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-10 02:08:48','2026-05-10 02:08:48'),(16,2,2,11,NULL,NULL,'7095341403',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'not_created',NULL,NULL,'Amaka',NULL,'Okonkwo','amaka@newkipp.com','08064678787',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','pending',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-10 09:32:30','2026-05-10 09:32:30'),(18,2,NULL,13,NULL,NULL,'4194378274',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'not_created',NULL,NULL,'Chidi',NULL,'Okoye','chidi@newkipp.com','08064664210','male','1994-03-10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','pending',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2026-05-14 02:55:17','2026-05-14 02:55:17');
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `data_import_batches`
--

DROP TABLE IF EXISTS `data_import_batches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `data_import_batches` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `import_type` varchar(60) NOT NULL,
  `original_filename` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `total_rows` int(10) unsigned NOT NULL DEFAULT 0,
  `successful_rows` int(10) unsigned NOT NULL DEFAULT 0,
  `failed_rows` int(10) unsigned NOT NULL DEFAULT 0,
  `summary` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`summary`)),
  `errors` longtext DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `data_import_batches_user_id_foreign` (`user_id`),
  KEY `data_import_batches_tenant_id_created_at_index` (`tenant_id`,`created_at`),
  KEY `data_import_batches_import_type_index` (`import_type`),
  KEY `data_import_batches_status_index` (`status`),
  CONSTRAINT `data_import_batches_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `data_import_batches_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `data_import_batches`
--

LOCK TABLES `data_import_batches` WRITE;
/*!40000 ALTER TABLE `data_import_batches` DISABLE KEYS */;
/*!40000 ALTER TABLE `data_import_batches` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `data_sync_clients`
--

DROP TABLE IF EXISTS `data_sync_clients`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `data_sync_clients` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `token_hash` varchar(255) NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `last_synced_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `data_sync_clients_tenant_id_is_active_index` (`tenant_id`,`is_active`),
  KEY `data_sync_clients_is_active_index` (`is_active`),
  CONSTRAINT `data_sync_clients_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `data_sync_clients`
--

LOCK TABLES `data_sync_clients` WRITE;
/*!40000 ALTER TABLE `data_sync_clients` DISABLE KEYS */;
/*!40000 ALTER TABLE `data_sync_clients` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `data_sync_packages`
--

DROP TABLE IF EXISTS `data_sync_packages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `data_sync_packages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `data_sync_client_id` bigint(20) unsigned DEFAULT NULL,
  `direction` varchar(20) NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `records_count` int(10) unsigned NOT NULL DEFAULT 0,
  `summary` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`summary`)),
  `errors` longtext DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `data_sync_packages_user_id_foreign` (`user_id`),
  KEY `data_sync_packages_data_sync_client_id_foreign` (`data_sync_client_id`),
  KEY `data_sync_packages_tenant_id_created_at_index` (`tenant_id`,`created_at`),
  KEY `data_sync_packages_direction_index` (`direction`),
  KEY `data_sync_packages_status_index` (`status`),
  CONSTRAINT `data_sync_packages_data_sync_client_id_foreign` FOREIGN KEY (`data_sync_client_id`) REFERENCES `data_sync_clients` (`id`) ON DELETE SET NULL,
  CONSTRAINT `data_sync_packages_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `data_sync_packages_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `data_sync_packages`
--

LOCK TABLES `data_sync_packages` WRITE;
/*!40000 ALTER TABLE `data_sync_packages` DISABLE KEYS */;
INSERT INTO `data_sync_packages` VALUES (1,1,2,NULL,'export','completed',23,'{\"branches\":1,\"customer_groups\":0,\"members\":3,\"savings_products\":4,\"savings_accounts\":3,\"savings_transactions\":3,\"loan_products\":1,\"loans\":1,\"loan_repayment_schedules\":3,\"loan_payments\":0,\"investment_products\":2,\"investment_accounts\":1,\"investment_transactions\":1}',NULL,'2026-05-14 04:58:40','2026-05-14 04:58:40','2026-05-14 04:58:40');
/*!40000 ALTER TABLE `data_sync_packages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `expenses`
--

DROP TABLE IF EXISTS `expenses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expenses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `recorded_by` bigint(20) unsigned DEFAULT NULL,
  `category` varchar(255) NOT NULL,
  `amount` decimal(14,2) NOT NULL,
  `spent_at` date NOT NULL,
  `payee` varchar(255) DEFAULT NULL,
  `method` varchar(255) NOT NULL DEFAULT 'cash',
  `notes` text DEFAULT NULL,
  `reference` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `expenses_reference_unique` (`reference`),
  KEY `expenses_recorded_by_foreign` (`recorded_by`),
  KEY `expenses_tenant_id_spent_at_index` (`tenant_id`,`spent_at`),
  KEY `expenses_category_index` (`category`),
  KEY `expenses_spent_at_index` (`spent_at`),
  CONSTRAINT `expenses_recorded_by_foreign` FOREIGN KEY (`recorded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `expenses_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `expenses`
--

LOCK TABLES `expenses` WRITE;
/*!40000 ALTER TABLE `expenses` DISABLE KEYS */;
/*!40000 ALTER TABLE `expenses` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `failed_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext 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;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `failed_jobs` WRITE;
/*!40000 ALTER TABLE `failed_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `failed_jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `gateway_payments`
--

DROP TABLE IF EXISTS `gateway_payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gateway_payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `payable_type` varchar(255) DEFAULT NULL,
  `payable_id` bigint(20) unsigned DEFAULT NULL,
  `purpose` varchar(255) NOT NULL,
  `provider` varchar(255) NOT NULL DEFAULT 'paystack',
  `amount` decimal(14,2) NOT NULL,
  `currency` varchar(10) NOT NULL DEFAULT 'NGN',
  `reference` varchar(255) NOT NULL,
  `provider_reference` varchar(255) DEFAULT NULL,
  `authorization_code` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `checkout_url` text DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `gateway_response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`gateway_response`)),
  `paid_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `gateway_payments_reference_unique` (`reference`),
  KEY `gateway_payments_user_id_foreign` (`user_id`),
  KEY `gateway_payments_customer_id_foreign` (`customer_id`),
  KEY `gateway_payments_payable_type_payable_id_index` (`payable_type`,`payable_id`),
  KEY `gateway_payments_tenant_id_purpose_status_index` (`tenant_id`,`purpose`,`status`),
  KEY `gateway_payments_tenant_id_reference_index` (`tenant_id`,`reference`),
  KEY `gateway_payments_purpose_index` (`purpose`),
  KEY `gateway_payments_provider_index` (`provider`),
  KEY `gateway_payments_provider_reference_index` (`provider_reference`),
  KEY `gateway_payments_status_index` (`status`),
  KEY `gateway_payments_paid_at_index` (`paid_at`),
  CONSTRAINT `gateway_payments_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `gateway_payments_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `gateway_payments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `gateway_payments`
--

LOCK TABLES `gateway_payments` WRITE;
/*!40000 ALTER TABLE `gateway_payments` DISABLE KEYS */;
/*!40000 ALTER TABLE `gateway_payments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `incomes`
--

DROP TABLE IF EXISTS `incomes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `incomes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `recorded_by` bigint(20) unsigned DEFAULT NULL,
  `category` varchar(255) NOT NULL,
  `amount` decimal(14,2) NOT NULL,
  `received_at` date NOT NULL,
  `payer` varchar(255) DEFAULT NULL,
  `method` varchar(255) NOT NULL DEFAULT 'cash',
  `notes` text DEFAULT NULL,
  `reference` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `incomes_reference_unique` (`reference`),
  KEY `incomes_recorded_by_foreign` (`recorded_by`),
  KEY `incomes_tenant_id_received_at_index` (`tenant_id`,`received_at`),
  KEY `incomes_category_index` (`category`),
  KEY `incomes_received_at_index` (`received_at`),
  CONSTRAINT `incomes_recorded_by_foreign` FOREIGN KEY (`recorded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `incomes_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `incomes`
--

LOCK TABLES `incomes` WRITE;
/*!40000 ALTER TABLE `incomes` DISABLE KEYS */;
/*!40000 ALTER TABLE `incomes` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `investment_accounts`
--

DROP TABLE IF EXISTS `investment_accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `investment_accounts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `investment_product_id` bigint(20) unsigned DEFAULT NULL,
  `account_number` varchar(255) NOT NULL,
  `product_name` varchar(255) NOT NULL,
  `amount` decimal(14,2) NOT NULL,
  `balance` decimal(14,2) NOT NULL DEFAULT 0.00,
  `expected_return` decimal(14,2) NOT NULL DEFAULT 0.00,
  `return_paid` decimal(14,2) NOT NULL DEFAULT 0.00,
  `interest_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `term_value` int(10) unsigned NOT NULL DEFAULT 1,
  `term_unit` varchar(20) NOT NULL DEFAULT 'months',
  `start_date` date NOT NULL,
  `maturity_date` date DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `auto_rollover` tinyint(1) NOT NULL DEFAULT 0,
  `notes` text DEFAULT NULL,
  `opened_at` timestamp NULL DEFAULT NULL,
  `matured_at` timestamp NULL DEFAULT NULL,
  `closed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `investment_accounts_tenant_id_account_number_unique` (`tenant_id`,`account_number`),
  KEY `investment_accounts_customer_id_foreign` (`customer_id`),
  KEY `investment_accounts_investment_product_id_foreign` (`investment_product_id`),
  KEY `investment_accounts_tenant_id_status_index` (`tenant_id`,`status`),
  KEY `investment_accounts_tenant_id_customer_id_index` (`tenant_id`,`customer_id`),
  KEY `investment_accounts_start_date_index` (`start_date`),
  KEY `investment_accounts_maturity_date_index` (`maturity_date`),
  KEY `investment_accounts_status_index` (`status`),
  CONSTRAINT `investment_accounts_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `investment_accounts_investment_product_id_foreign` FOREIGN KEY (`investment_product_id`) REFERENCES `investment_products` (`id`) ON DELETE SET NULL,
  CONSTRAINT `investment_accounts_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `investment_accounts`
--

LOCK TABLES `investment_accounts` WRITE;
/*!40000 ALTER TABLE `investment_accounts` DISABLE KEYS */;
INSERT INTO `investment_accounts` VALUES (1,1,1,2,'SHR-260500001','Cooperative Shares',10000.00,10000.00,0.00,0.00,0.00,12,'months','2026-05-14','2027-05-14','active',0,'Verification investment created by Codex','2026-05-14 04:17:33',NULL,NULL,'2026-05-14 04:17:33','2026-05-14 04:17:33');
/*!40000 ALTER TABLE `investment_accounts` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `investment_products`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `investment_products` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `investment_number_prefix` varchar(20) NOT NULL DEFAULT 'INV',
  `interest_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `return_type` varchar(30) NOT NULL DEFAULT 'fixed',
  `term_value` int(10) unsigned NOT NULL DEFAULT 6,
  `term_unit` varchar(20) NOT NULL DEFAULT 'months',
  `minimum_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `maximum_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `allow_member_request` tinyint(1) NOT NULL DEFAULT 1,
  `show_on_member_portal` tinyint(1) NOT NULL DEFAULT 1,
  `show_on_public_website` tinyint(1) NOT NULL DEFAULT 1,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`settings`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `investment_products_tenant_id_name_unique` (`tenant_id`,`name`),
  KEY `investment_products_tenant_id_is_active_index` (`tenant_id`,`is_active`),
  KEY `investment_products_is_active_index` (`is_active`),
  CONSTRAINT `investment_products_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `investment_products` WRITE;
/*!40000 ALTER TABLE `investment_products` DISABLE KEYS */;
INSERT INTO `investment_products` VALUES (1,1,'Fixed Investment','Fixed-term member investment with expected returns at maturity.','INV',10.00,'fixed',6,'months',10000.00,0.00,1,1,1,1,NULL,'2026-05-14 04:16:03','2026-05-14 04:16:03'),(2,1,'Cooperative Shares','Member share capital or cooperative investment balance tracking.','SHR',0.00,'fixed',12,'months',1000.00,0.00,1,1,1,1,NULL,'2026-05-14 04:16:03','2026-05-14 04:16:03'),(3,2,'Fixed Investment','Fixed-term member investment with expected returns at maturity.','INV',10.00,'fixed',6,'months',10000.00,0.00,1,1,1,1,NULL,'2026-05-14 04:16:03','2026-05-14 04:16:03'),(4,2,'Cooperative Shares','Member share capital or cooperative investment balance tracking.','SHR',0.00,'fixed',12,'months',1000.00,0.00,1,1,1,1,NULL,'2026-05-14 04:16:03','2026-05-14 04:16:03'),(5,3,'Fixed Investment','Fixed-term member investment with expected returns at maturity.','INV',10.00,'fixed',6,'months',10000.00,0.00,1,1,1,1,NULL,'2026-05-14 04:16:03','2026-05-14 04:16:03'),(6,3,'Cooperative Shares','Member share capital or cooperative investment balance tracking.','SHR',0.00,'fixed',12,'months',1000.00,0.00,1,1,1,1,NULL,'2026-05-14 04:16:03','2026-05-14 04:16:03');
/*!40000 ALTER TABLE `investment_products` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `investment_transactions`
--

DROP TABLE IF EXISTS `investment_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `investment_transactions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `investment_account_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `type` varchar(255) NOT NULL,
  `amount` decimal(14,2) NOT NULL,
  `balance_before` decimal(14,2) NOT NULL DEFAULT 0.00,
  `balance_after` decimal(14,2) NOT NULL DEFAULT 0.00,
  `reference` varchar(255) NOT NULL,
  `method` varchar(255) NOT NULL DEFAULT 'cash',
  `status` varchar(255) NOT NULL DEFAULT 'posted',
  `description` text DEFAULT NULL,
  `transacted_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `investment_transactions_reference_unique` (`reference`),
  KEY `investment_transactions_investment_account_id_foreign` (`investment_account_id`),
  KEY `investment_transactions_customer_id_foreign` (`customer_id`),
  KEY `investment_transactions_created_by_foreign` (`created_by`),
  KEY `investment_transactions_tenant_id_type_transacted_at_index` (`tenant_id`,`type`,`transacted_at`),
  KEY `investment_transactions_tenant_id_customer_id_index` (`tenant_id`,`customer_id`),
  KEY `investment_transactions_type_index` (`type`),
  KEY `investment_transactions_status_index` (`status`),
  KEY `investment_transactions_transacted_at_index` (`transacted_at`),
  CONSTRAINT `investment_transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `investment_transactions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `investment_transactions_investment_account_id_foreign` FOREIGN KEY (`investment_account_id`) REFERENCES `investment_accounts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `investment_transactions_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `investment_transactions`
--

LOCK TABLES `investment_transactions` WRITE;
/*!40000 ALTER TABLE `investment_transactions` DISABLE KEYS */;
INSERT INTO `investment_transactions` VALUES (1,1,1,1,2,'deposit',10000.00,0.00,10000.00,'INVDEP-20260514051733-NVPRN','cash','posted','Initial investment deposit','2026-05-14 04:17:33','2026-05-14 04:17:33','2026-05-14 04:17:33');
/*!40000 ALTER TABLE `investment_transactions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `invoices`
--

DROP TABLE IF EXISTS `invoices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invoices` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `tenant_payment_id` bigint(20) unsigned DEFAULT NULL,
  `invoice_number` varchar(255) NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'draft',
  `amount` decimal(12,2) NOT NULL,
  `issued_at` timestamp NULL DEFAULT NULL,
  `due_at` timestamp NULL DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `line_items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`line_items`)),
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `invoices_invoice_number_unique` (`invoice_number`),
  KEY `invoices_tenant_payment_id_foreign` (`tenant_payment_id`),
  KEY `invoices_tenant_id_status_index` (`tenant_id`,`status`),
  KEY `invoices_status_index` (`status`),
  CONSTRAINT `invoices_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `invoices_tenant_payment_id_foreign` FOREIGN KEY (`tenant_payment_id`) REFERENCES `tenant_payments` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `invoices`
--

LOCK TABLES `invoices` WRITE;
/*!40000 ALTER TABLE `invoices` DISABLE KEYS */;
INSERT INTO `invoices` VALUES (1,2,1,'INV-20260509024533-4LUWP','paid',25000.00,'2026-05-09 01:45:33','2026-05-09 01:45:33','2026-05-09 01:45:33','[{\"description\":\"Starter subscription\",\"amount\":25000}]',NULL,'2026-05-09 01:45:33','2026-05-09 01:45:33');
/*!40000 ALTER TABLE `invoices` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `job_batches`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `job_batches` WRITE;
/*!40000 ALTER TABLE `job_batches` DISABLE KEYS */;
/*!40000 ALTER TABLE `job_batches` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) unsigned NOT NULL,
  `reserved_at` int(10) unsigned DEFAULT NULL,
  `available_at` int(10) unsigned NOT NULL,
  `created_at` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `jobs` WRITE;
/*!40000 ALTER TABLE `jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `ledger_entries`
--

DROP TABLE IF EXISTS `ledger_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ledger_entries` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `accounting_account_id` bigint(20) unsigned NOT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `entry_date` date NOT NULL,
  `type` varchar(255) NOT NULL,
  `amount` decimal(14,2) NOT NULL,
  `reference` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ledger_entries_accounting_account_id_foreign` (`accounting_account_id`),
  KEY `ledger_entries_created_by_foreign` (`created_by`),
  KEY `ledger_entries_tenant_id_entry_date_index` (`tenant_id`,`entry_date`),
  KEY `ledger_entries_entry_date_index` (`entry_date`),
  KEY `ledger_entries_type_index` (`type`),
  KEY `ledger_entries_reference_index` (`reference`),
  KEY `ledger_entries_source_type_index` (`source_type`),
  KEY `ledger_entries_source_id_index` (`source_id`),
  CONSTRAINT `ledger_entries_accounting_account_id_foreign` FOREIGN KEY (`accounting_account_id`) REFERENCES `accounting_accounts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ledger_entries_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `ledger_entries_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ledger_entries`
--

LOCK TABLES `ledger_entries` WRITE;
/*!40000 ALTER TABLE `ledger_entries` DISABLE KEYS */;
INSERT INTO `ledger_entries` VALUES (1,1,1,NULL,'2026-05-08','debit',50000.00,'DEP-20260508062525-HWNJV','Savings deposit DEP-20260508062525-HWNJV','App\\Models\\SavingsTransaction',1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(2,1,3,NULL,'2026-05-08','credit',50000.00,'DEP-20260508062525-HWNJV','Customer savings liability DEP-20260508062525-HWNJV','App\\Models\\SavingsTransaction',1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(3,1,2,NULL,'2026-05-08','debit',100000.00,'DEMO-LON-260500001','Loan disbursed DEMO-LON-260500001','App\\Models\\Loan',1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(4,1,1,NULL,'2026-05-08','credit',100000.00,'DEMO-LON-260500001','Cash disbursed DEMO-LON-260500001','App\\Models\\Loan',1,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(5,1,1,NULL,'2026-05-08','debit',50000.00,'DEP-20260508062525-QTDIF','Savings deposit DEP-20260508062525-QTDIF','App\\Models\\SavingsTransaction',2,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(6,1,3,NULL,'2026-05-08','credit',50000.00,'DEP-20260508062525-QTDIF','Customer savings liability DEP-20260508062525-QTDIF','App\\Models\\SavingsTransaction',2,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(7,1,1,NULL,'2026-05-08','debit',50000.00,'DEP-20260508062525-V3ZEK','Savings deposit DEP-20260508062525-V3ZEK','App\\Models\\SavingsTransaction',3,'2026-05-08 05:25:26','2026-05-08 05:25:26'),(8,1,3,NULL,'2026-05-08','credit',50000.00,'DEP-20260508062525-V3ZEK','Customer savings liability DEP-20260508062525-V3ZEK','App\\Models\\SavingsTransaction',3,'2026-05-08 05:25:26','2026-05-08 05:25:26'),(9,2,9,6,'2026-05-08','debit',20000.00,'DEP-20260508155148-KPIYW','Savings deposit DEP-20260508155148-KPIYW','App\\Models\\SavingsTransaction',4,'2026-05-08 14:51:48','2026-05-08 14:51:48'),(10,2,11,6,'2026-05-08','credit',20000.00,'DEP-20260508155148-KPIYW','Customer savings liability DEP-20260508155148-KPIYW','App\\Models\\SavingsTransaction',4,'2026-05-08 14:51:48','2026-05-08 14:51:48'),(11,2,10,6,'2026-05-08','debit',100000.00,'NEWK-LON-260500001','Loan disbursed NEWK-LON-260500001','App\\Models\\Loan',2,'2026-05-08 14:59:28','2026-05-08 14:59:28'),(12,2,9,6,'2026-05-08','credit',100000.00,'NEWK-LON-260500001','Cash disbursed NEWK-LON-260500001','App\\Models\\Loan',2,'2026-05-08 14:59:28','2026-05-08 14:59:28'),(13,2,9,6,'2026-05-08','debit',7000.00,'LRP-20260508160018-8SDH0','Loan repayment LRP-20260508160018-8SDH0','App\\Models\\LoanPayment',1,'2026-05-08 15:00:18','2026-05-08 15:00:18'),(14,2,13,6,'2026-05-08','credit',7000.00,'LRP-20260508160018-8SDH0','Interest received LRP-20260508160018-8SDH0','App\\Models\\LoanPayment',1,'2026-05-08 15:00:18','2026-05-08 15:00:18'),(15,2,9,6,'2026-05-08','debit',17000.00,'LRP-20260508160108-HFASV','Loan repayment LRP-20260508160108-HFASV','App\\Models\\LoanPayment',2,'2026-05-08 15:01:08','2026-05-08 15:01:08'),(16,2,10,6,'2026-05-08','credit',14000.00,'LRP-20260508160108-HFASV','Principal recovered LRP-20260508160108-HFASV','App\\Models\\LoanPayment',2,'2026-05-08 15:01:08','2026-05-08 15:01:08'),(17,2,13,6,'2026-05-08','credit',3000.00,'LRP-20260508160108-HFASV','Interest received LRP-20260508160108-HFASV','App\\Models\\LoanPayment',2,'2026-05-08 15:01:08','2026-05-08 15:01:08'),(18,2,10,6,'2026-05-10','debit',100000.00,'NEWK-LON-260500002','Loan disbursed NEWK-LON-260500002','App\\Models\\Loan',3,'2026-05-10 02:30:07','2026-05-10 02:30:07'),(19,2,9,6,'2026-05-10','credit',100000.00,'NEWK-LON-260500002','Cash disbursed NEWK-LON-260500002','App\\Models\\Loan',3,'2026-05-10 02:30:07','2026-05-10 02:30:07'),(20,2,10,6,'2026-05-10','debit',100000.00,'NEWK-LON-260500003','Loan disbursed NEWK-LON-260500003','App\\Models\\Loan',5,'2026-05-10 05:22:57','2026-05-10 05:22:57'),(21,2,9,6,'2026-05-10','credit',100000.00,'NEWK-LON-260500003','Cash disbursed NEWK-LON-260500003','App\\Models\\Loan',5,'2026-05-10 05:22:57','2026-05-10 05:22:57'),(22,2,10,6,'2026-05-10','debit',100000.00,'NEWK-LON-260500004','Loan disbursed NEWK-LON-260500004','App\\Models\\Loan',6,'2026-05-10 05:40:33','2026-05-10 05:40:33'),(23,2,9,6,'2026-05-10','credit',100000.00,'NEWK-LON-260500004','Cash disbursed NEWK-LON-260500004','App\\Models\\Loan',6,'2026-05-10 05:40:33','2026-05-10 05:40:33'),(24,2,9,6,'2026-05-10','debit',10000.00,'LRP-20260510064055-Q0DKW','Loan repayment LRP-20260510064055-Q0DKW','App\\Models\\LoanPayment',3,'2026-05-10 05:40:55','2026-05-10 05:40:55'),(25,2,10,6,'2026-05-10','credit',9000.00,'LRP-20260510064055-Q0DKW','Principal recovered LRP-20260510064055-Q0DKW','App\\Models\\LoanPayment',3,'2026-05-10 05:40:55','2026-05-10 05:40:55'),(26,2,13,6,'2026-05-10','credit',1000.00,'LRP-20260510064055-Q0DKW','Interest received LRP-20260510064055-Q0DKW','App\\Models\\LoanPayment',3,'2026-05-10 05:40:55','2026-05-10 05:40:55'),(27,2,9,6,'2026-05-10','debit',35000.00,'LRP-20260510064150-VSSEZ','Loan repayment LRP-20260510064150-VSSEZ','App\\Models\\LoanPayment',4,'2026-05-10 05:41:50','2026-05-10 05:41:50'),(28,2,10,6,'2026-05-10','credit',31000.00,'LRP-20260510064150-VSSEZ','Principal recovered LRP-20260510064150-VSSEZ','App\\Models\\LoanPayment',4,'2026-05-10 05:41:50','2026-05-10 05:41:50'),(29,2,13,6,'2026-05-10','credit',4000.00,'LRP-20260510064150-VSSEZ','Interest received LRP-20260510064150-VSSEZ','App\\Models\\LoanPayment',4,'2026-05-10 05:41:50','2026-05-10 05:41:50'),(30,2,10,6,'2026-05-10','debit',200000.00,'NEWK-LON-260500005','Loan disbursed NEWK-LON-260500005','App\\Models\\Loan',8,'2026-05-10 09:09:32','2026-05-10 09:09:32'),(31,2,9,6,'2026-05-10','credit',200000.00,'NEWK-LON-260500005','Cash disbursed NEWK-LON-260500005','App\\Models\\Loan',8,'2026-05-10 09:09:33','2026-05-10 09:09:33'),(32,2,9,6,'2026-05-10','debit',25000.00,'LRP-20260510101239-JIQEP','Loan repayment LRP-20260510101239-JIQEP','App\\Models\\LoanPayment',5,'2026-05-10 09:12:39','2026-05-10 09:12:39'),(33,2,10,6,'2026-05-10','credit',21000.00,'LRP-20260510101239-JIQEP','Principal recovered LRP-20260510101239-JIQEP','App\\Models\\LoanPayment',5,'2026-05-10 09:12:39','2026-05-10 09:12:39'),(34,2,13,6,'2026-05-10','credit',4000.00,'LRP-20260510101239-JIQEP','Interest received LRP-20260510101239-JIQEP','App\\Models\\LoanPayment',5,'2026-05-10 09:12:39','2026-05-10 09:12:39'),(35,2,9,6,'2026-05-10','debit',48000.00,'LRP-20260510101333-OYPWE','Loan repayment LRP-20260510101333-OYPWE','App\\Models\\LoanPayment',6,'2026-05-10 09:13:33','2026-05-10 09:13:33'),(36,2,10,6,'2026-05-10','credit',44000.00,'LRP-20260510101333-OYPWE','Principal recovered LRP-20260510101333-OYPWE','App\\Models\\LoanPayment',6,'2026-05-10 09:13:33','2026-05-10 09:13:33'),(37,2,13,6,'2026-05-10','credit',4000.00,'LRP-20260510101333-OYPWE','Interest received LRP-20260510101333-OYPWE','App\\Models\\LoanPayment',6,'2026-05-10 09:13:33','2026-05-10 09:13:33'),(38,2,9,6,'2026-05-10','debit',30000.00,'LRP-20260510103734-Y5RMF','Loan repayment LRP-20260510103734-Y5RMF','App\\Models\\LoanPayment',7,'2026-05-10 09:37:34','2026-05-10 09:37:34'),(39,2,10,6,'2026-05-10','credit',28000.00,'LRP-20260510103734-Y5RMF','Principal recovered LRP-20260510103734-Y5RMF','App\\Models\\LoanPayment',7,'2026-05-10 09:37:34','2026-05-10 09:37:34'),(40,2,13,6,'2026-05-10','credit',2000.00,'LRP-20260510103734-Y5RMF','Interest received LRP-20260510103734-Y5RMF','App\\Models\\LoanPayment',7,'2026-05-10 09:37:34','2026-05-10 09:37:34'),(41,2,9,6,'2026-05-10','debit',15000.00,'LRP-20260510103911-V3AGV','Loan repayment LRP-20260510103911-V3AGV','App\\Models\\LoanPayment',8,'2026-05-10 09:39:11','2026-05-10 09:39:11'),(42,2,10,6,'2026-05-10','credit',13000.00,'LRP-20260510103911-V3AGV','Principal recovered LRP-20260510103911-V3AGV','App\\Models\\LoanPayment',8,'2026-05-10 09:39:11','2026-05-10 09:39:11'),(43,2,13,6,'2026-05-10','credit',2000.00,'LRP-20260510103911-V3AGV','Interest received LRP-20260510103911-V3AGV','App\\Models\\LoanPayment',8,'2026-05-10 09:39:11','2026-05-10 09:39:11'),(44,2,9,6,'2026-05-14','debit',2000.00,'DEP-20260514044424-Y2D4L','Savings deposit DEP-20260514044424-Y2D4L','App\\Models\\SavingsTransaction',5,'2026-05-14 03:44:24','2026-05-14 03:44:24'),(45,2,11,6,'2026-05-14','credit',2000.00,'DEP-20260514044424-Y2D4L','Customer savings liability DEP-20260514044424-Y2D4L','App\\Models\\SavingsTransaction',5,'2026-05-14 03:44:24','2026-05-14 03:44:24'),(46,2,9,6,'2026-05-14','debit',6000.00,'DEP-20260514044727-TL8EP','Savings deposit DEP-20260514044727-TL8EP','App\\Models\\SavingsTransaction',6,'2026-05-14 03:47:27','2026-05-14 03:47:27'),(47,2,11,6,'2026-05-14','credit',6000.00,'DEP-20260514044727-TL8EP','Customer savings liability DEP-20260514044727-TL8EP','App\\Models\\SavingsTransaction',6,'2026-05-14 03:47:27','2026-05-14 03:47:27'),(48,2,9,6,'2026-05-14','debit',1000.00,'DEP-20260514045542-2CPE0','Savings deposit DEP-20260514045542-2CPE0','App\\Models\\SavingsTransaction',7,'2026-05-14 03:55:42','2026-05-14 03:55:42'),(49,2,11,6,'2026-05-14','credit',1000.00,'DEP-20260514045542-2CPE0','Customer savings liability DEP-20260514045542-2CPE0','App\\Models\\SavingsTransaction',7,'2026-05-14 03:55:42','2026-05-14 03:55:42');
/*!40000 ALTER TABLE `ledger_entries` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `loan_guarantors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `loan_guarantors` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `loan_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `address` text DEFAULT NULL,
  `relationship` varchar(255) DEFAULT NULL,
  `id_number` varchar(255) 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`),
  KEY `loan_guarantors_tenant_id_loan_id_index` (`tenant_id`,`loan_id`),
  CONSTRAINT `loan_guarantors_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loan_guarantors_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `loan_guarantors` WRITE;
/*!40000 ALTER TABLE `loan_guarantors` DISABLE KEYS */;
/*!40000 ALTER TABLE `loan_guarantors` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `loan_payments`
--

DROP TABLE IF EXISTS `loan_payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `loan_payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `loan_id` bigint(20) unsigned NOT NULL,
  `loan_repayment_schedule_id` bigint(20) unsigned DEFAULT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `received_by` bigint(20) unsigned DEFAULT NULL,
  `amount` decimal(14,2) NOT NULL,
  `principal_component` decimal(14,2) NOT NULL DEFAULT 0.00,
  `interest_component` decimal(14,2) NOT NULL DEFAULT 0.00,
  `fee_component` decimal(14,2) NOT NULL DEFAULT 0.00,
  `penalty_component` decimal(14,2) NOT NULL DEFAULT 0.00,
  `balance_after` decimal(14,2) NOT NULL DEFAULT 0.00,
  `reference` varchar(255) NOT NULL,
  `paid_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `method` varchar(255) NOT NULL DEFAULT 'cash',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `loan_payments_reference_unique` (`reference`),
  KEY `loan_payments_loan_id_foreign` (`loan_id`),
  KEY `loan_payments_loan_repayment_schedule_id_foreign` (`loan_repayment_schedule_id`),
  KEY `loan_payments_customer_id_foreign` (`customer_id`),
  KEY `loan_payments_received_by_foreign` (`received_by`),
  KEY `loan_payments_tenant_id_paid_at_index` (`tenant_id`,`paid_at`),
  KEY `loan_payments_paid_at_index` (`paid_at`),
  CONSTRAINT `loan_payments_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loan_payments_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loan_payments_loan_repayment_schedule_id_foreign` FOREIGN KEY (`loan_repayment_schedule_id`) REFERENCES `loan_repayment_schedules` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loan_payments_received_by_foreign` FOREIGN KEY (`received_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loan_payments_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `loan_payments`
--

LOCK TABLES `loan_payments` WRITE;
/*!40000 ALTER TABLE `loan_payments` DISABLE KEYS */;
INSERT INTO `loan_payments` VALUES (1,2,2,NULL,4,6,7000.00,0.00,7000.00,0.00,0.00,103000.00,'LRP-20260508160018-8SDH0','2026-05-08 15:00:18','cash',NULL,'2026-05-08 15:00:18','2026-05-08 15:00:18'),(2,2,2,NULL,4,6,17000.00,14000.00,3000.00,0.00,0.00,86000.00,'LRP-20260508160108-HFASV','2026-05-08 15:01:08','cash',NULL,'2026-05-08 15:01:08','2026-05-08 15:01:08'),(3,2,6,61,15,6,10000.00,9000.00,1000.00,0.00,0.00,100000.00,'LRP-20260510064055-Q0DKW','2026-05-10 05:40:55','cash',NULL,'2026-05-10 05:40:55','2026-05-10 05:40:55'),(4,2,6,61,15,6,35000.00,31000.00,4000.00,0.00,0.00,65000.00,'LRP-20260510064150-VSSEZ','2026-05-10 05:41:50','cash',NULL,'2026-05-10 05:41:50','2026-05-10 05:41:50'),(5,2,8,NULL,15,6,25000.00,21000.00,4000.00,0.00,0.00,195000.00,'LRP-20260510101239-JIQEP','2026-05-10 09:12:39','cash',NULL,'2026-05-10 09:12:39','2026-05-10 09:12:39'),(6,2,8,NULL,15,6,48000.00,44000.00,4000.00,0.00,0.00,147000.00,'LRP-20260510101333-OYPWE','2026-05-10 09:13:33','transfer',NULL,'2026-05-10 09:13:33','2026-05-10 09:13:33'),(7,2,8,104,15,6,30000.00,28000.00,2000.00,0.00,0.00,117000.00,'LRP-20260510103734-Y5RMF','2026-05-10 09:37:34','cash',NULL,'2026-05-10 09:37:34','2026-05-10 09:37:34'),(8,2,8,105,15,6,15000.00,13000.00,2000.00,0.00,0.00,102000.00,'LRP-20260510103911-V3AGV','2026-05-10 09:39:11','cash',NULL,'2026-05-10 09:39:11','2026-05-10 09:39:11');
/*!40000 ALTER TABLE `loan_payments` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `loan_products`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `loan_products` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `loan_number_prefix` varchar(20) NOT NULL DEFAULT 'LON',
  `interest_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `interest_method` varchar(255) NOT NULL DEFAULT 'flat',
  `repayment_frequency` varchar(255) NOT NULL DEFAULT 'monthly',
  `term_value` int(10) unsigned NOT NULL DEFAULT 1,
  `term_unit` varchar(20) NOT NULL DEFAULT 'months',
  `term_days` int(10) unsigned NOT NULL DEFAULT 30,
  `penalty_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `penalty_type` varchar(20) NOT NULL DEFAULT 'percentage',
  `processing_fee_type` varchar(20) NOT NULL DEFAULT 'fixed',
  `processing_fee_value` decimal(14,2) NOT NULL DEFAULT 0.00,
  `minimum_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `maximum_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `guarantor_requirement` varchar(20) NOT NULL DEFAULT 'optional',
  `collateral_requirement` varchar(20) NOT NULL DEFAULT 'optional',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `show_on_member_portal` tinyint(1) NOT NULL DEFAULT 1,
  `show_on_public_website` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `loan_products_tenant_id_name_unique` (`tenant_id`,`name`),
  KEY `loan_products_tenant_id_is_active_index` (`tenant_id`,`is_active`),
  KEY `loan_products_is_active_index` (`is_active`),
  CONSTRAINT `loan_products_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `loan_products` WRITE;
/*!40000 ALTER TABLE `loan_products` DISABLE KEYS */;
INSERT INTO `loan_products` VALUES (1,1,'Market Trader Loan',NULL,'LON',8.00,'flat','monthly',3,'months',90,1.00,'percentage','fixed',0.00,10000.00,500000.00,'optional','optional',1,'2026-05-08 05:25:25','2026-05-08 05:25:25',1,1),(2,2,'Ultimate','Renews @ 65,000 Yearly','LON',10.00,'flat','monthly',10,'months',300,10.00,'percentage','fixed',0.00,1000.00,100000.00,'optional','optional',1,'2026-05-08 14:57:45','2026-05-10 05:37:56',1,1),(3,2,'Business',NULL,'LON',10.00,'flat','monthly',10,'months',300,0.00,'percentage','fixed',0.00,100.00,1000000.00,'optional','optional',1,'2026-05-10 02:27:46','2026-05-10 05:37:56',1,1),(5,2,'NOT',NULL,'NOT',10.00,'none','daily',1,'days',1,0.00,'percentage','percentage',0.00,0.00,0.00,'hidden','hidden',1,'2026-05-10 05:14:26','2026-05-10 05:37:56',1,1),(8,2,'Market Loan','Market Loan','MKL',10.00,'flat','monthly',12,'months',360,5.00,'percentage','fixed',2000.00,1000.00,1000000.00,'hidden','hidden',1,'2026-05-14 02:57:54','2026-05-14 02:57:54',1,1);
/*!40000 ALTER TABLE `loan_products` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `loan_repayment_schedules`
--

DROP TABLE IF EXISTS `loan_repayment_schedules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `loan_repayment_schedules` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `loan_id` bigint(20) unsigned NOT NULL,
  `installment_no` int(10) unsigned NOT NULL,
  `due_date` date NOT NULL,
  `principal_due` decimal(14,2) NOT NULL DEFAULT 0.00,
  `interest_due` decimal(14,2) NOT NULL DEFAULT 0.00,
  `fee_due` decimal(14,2) NOT NULL DEFAULT 0.00,
  `penalty_due` decimal(14,2) NOT NULL DEFAULT 0.00,
  `total_due` decimal(14,2) NOT NULL DEFAULT 0.00,
  `paid_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `loan_repayment_schedules_loan_id_installment_no_unique` (`loan_id`,`installment_no`),
  KEY `loan_repayment_schedules_tenant_id_status_due_date_index` (`tenant_id`,`status`,`due_date`),
  KEY `loan_repayment_schedules_due_date_index` (`due_date`),
  KEY `loan_repayment_schedules_status_index` (`status`),
  CONSTRAINT `loan_repayment_schedules_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loan_repayment_schedules_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `loan_repayment_schedules`
--

LOCK TABLES `loan_repayment_schedules` WRITE;
/*!40000 ALTER TABLE `loan_repayment_schedules` DISABLE KEYS */;
INSERT INTO `loan_repayment_schedules` VALUES (1,1,1,1,'2026-06-08',33333.33,2666.67,0.00,0.00,36000.00,0.00,'pending','2026-05-08 05:25:25','2026-05-08 05:25:25'),(2,1,1,2,'2026-07-08',33333.33,2666.67,0.00,0.00,36000.00,0.00,'pending','2026-05-08 05:25:25','2026-05-08 05:25:25'),(3,1,1,3,'2026-08-08',33333.34,2666.66,0.00,0.00,36000.00,0.00,'pending','2026-05-08 05:25:25','2026-05-08 05:25:25'),(21,2,3,1,'2026-06-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(22,2,3,2,'2026-07-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(23,2,3,3,'2026-08-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(24,2,3,4,'2026-09-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(25,2,3,5,'2026-10-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(26,2,3,6,'2026-11-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(27,2,3,7,'2026-12-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(28,2,3,8,'2027-01-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(29,2,3,9,'2027-02-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(30,2,3,10,'2027-03-10',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(31,2,5,1,'2026-05-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(32,2,5,2,'2026-06-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(33,2,5,3,'2026-07-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(34,2,5,4,'2026-08-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(35,2,5,5,'2026-09-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(36,2,5,6,'2026-10-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(37,2,5,7,'2026-11-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(38,2,5,8,'2026-12-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(39,2,5,9,'2027-01-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(40,2,5,10,'2027-02-25',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:37:56','2026-05-10 05:37:56'),(51,2,2,1,'2026-06-08',10000.00,1000.00,0.00,0.00,11000.00,11000.00,'paid','2026-05-10 05:39:45','2026-05-10 05:39:45'),(52,2,2,2,'2026-07-08',10000.00,1000.00,0.00,0.00,11000.00,11000.00,'paid','2026-05-10 05:39:45','2026-05-10 05:39:45'),(53,2,2,3,'2026-08-08',10000.00,1000.00,0.00,0.00,11000.00,2000.00,'partial','2026-05-10 05:39:45','2026-05-10 05:39:45'),(54,2,2,4,'2026-09-08',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:39:45','2026-05-10 05:39:45'),(55,2,2,5,'2026-10-08',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:39:45','2026-05-10 05:39:45'),(56,2,2,6,'2026-11-08',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:39:45','2026-05-10 05:39:45'),(57,2,2,7,'2026-12-08',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:39:45','2026-05-10 05:39:45'),(58,2,2,8,'2027-01-08',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:39:45','2026-05-10 05:39:45'),(59,2,2,9,'2027-02-08',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:39:45','2026-05-10 05:39:45'),(60,2,2,10,'2027-03-08',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:39:45','2026-05-10 05:39:45'),(61,2,6,1,'2026-06-06',10000.00,1000.00,0.00,0.00,11000.00,11000.00,'paid','2026-05-10 05:40:33','2026-05-10 05:41:50'),(62,2,6,2,'2026-07-06',10000.00,1000.00,0.00,0.00,11000.00,11000.00,'paid','2026-05-10 05:40:33','2026-05-10 05:41:50'),(63,2,6,3,'2026-08-06',10000.00,1000.00,0.00,0.00,11000.00,11000.00,'paid','2026-05-10 05:40:33','2026-05-10 05:41:50'),(64,2,6,4,'2026-09-06',10000.00,1000.00,0.00,0.00,11000.00,11000.00,'paid','2026-05-10 05:40:33','2026-05-10 05:41:50'),(65,2,6,5,'2026-10-06',10000.00,1000.00,0.00,0.00,11000.00,1000.00,'partial','2026-05-10 05:40:33','2026-05-10 05:41:50'),(66,2,6,6,'2026-11-06',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:40:33','2026-05-10 05:40:33'),(67,2,6,7,'2026-12-06',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:40:33','2026-05-10 05:40:33'),(68,2,6,8,'2027-01-06',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:40:33','2026-05-10 05:40:33'),(69,2,6,9,'2027-02-06',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:40:33','2026-05-10 05:40:33'),(70,2,6,10,'2027-03-06',10000.00,1000.00,0.00,0.00,11000.00,0.00,'pending','2026-05-10 05:40:33','2026-05-10 05:40:33'),(101,2,8,1,'2026-06-10',20000.00,2000.00,0.00,0.00,22000.00,22000.00,'paid','2026-05-10 09:15:43','2026-05-10 09:15:43'),(102,2,8,2,'2026-07-10',20000.00,2000.00,0.00,0.00,22000.00,22000.00,'paid','2026-05-10 09:15:43','2026-05-10 09:15:43'),(103,2,8,3,'2026-08-10',20000.00,2000.00,0.00,0.00,22000.00,22000.00,'paid','2026-05-10 09:15:43','2026-05-10 09:15:43'),(104,2,8,4,'2026-09-10',20000.00,2000.00,0.00,0.00,22000.00,22000.00,'paid','2026-05-10 09:15:43','2026-05-10 09:37:34'),(105,2,8,5,'2026-10-10',20000.00,2000.00,0.00,0.00,22000.00,22000.00,'paid','2026-05-10 09:15:43','2026-05-10 09:39:10'),(106,2,8,6,'2026-11-10',20000.00,2000.00,0.00,0.00,22000.00,8000.00,'partial','2026-05-10 09:15:43','2026-05-10 09:39:11'),(107,2,8,7,'2026-12-10',20000.00,2000.00,0.00,0.00,22000.00,0.00,'pending','2026-05-10 09:15:43','2026-05-10 09:15:43'),(108,2,8,8,'2027-01-10',20000.00,2000.00,0.00,0.00,22000.00,0.00,'pending','2026-05-10 09:15:43','2026-05-10 09:15:43'),(109,2,8,9,'2027-02-10',20000.00,2000.00,0.00,0.00,22000.00,0.00,'pending','2026-05-10 09:15:43','2026-05-10 09:15:43'),(110,2,8,10,'2027-03-10',20000.00,2000.00,0.00,0.00,22000.00,0.00,'pending','2026-05-10 09:15:43','2026-05-10 09:15:43'),(111,2,9,1,'2026-06-13',8333.33,833.33,2000.00,0.00,11166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(112,2,9,2,'2026-07-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(113,2,9,3,'2026-08-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(114,2,9,4,'2026-09-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(115,2,9,5,'2026-10-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(116,2,9,6,'2026-11-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(117,2,9,7,'2026-12-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(118,2,9,8,'2027-01-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(119,2,9,9,'2027-02-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(120,2,9,10,'2027-03-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(121,2,9,11,'2027-04-13',8333.33,833.33,0.00,0.00,9166.66,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34'),(122,2,9,12,'2027-05-13',8333.37,833.37,0.00,0.00,9166.74,0.00,'pending','2026-05-14 03:06:34','2026-05-14 03:06:34');
/*!40000 ALTER TABLE `loan_repayment_schedules` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `loans`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `loans` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `loan_product_id` bigint(20) unsigned DEFAULT NULL,
  `loan_number` varchar(255) NOT NULL,
  `principal` decimal(14,2) NOT NULL,
  `interest_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `interest_method` varchar(40) NOT NULL DEFAULT 'flat',
  `interest_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `processing_fee` decimal(14,2) NOT NULL DEFAULT 0.00,
  `total_payable` decimal(14,2) NOT NULL DEFAULT 0.00,
  `amount_disbursed` decimal(14,2) NOT NULL DEFAULT 0.00,
  `balance` decimal(14,2) NOT NULL DEFAULT 0.00,
  `repayment_frequency` varchar(255) NOT NULL DEFAULT 'monthly',
  `term_days` int(10) unsigned NOT NULL DEFAULT 30,
  `term_value` int(10) unsigned NOT NULL DEFAULT 1,
  `term_unit` varchar(20) NOT NULL DEFAULT 'months',
  `status` varchar(255) NOT NULL DEFAULT 'applied',
  `purpose` text DEFAULT NULL,
  `collateral` text DEFAULT NULL,
  `application_date` date NOT NULL,
  `first_repayment_date` date DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `approved_by` bigint(20) unsigned DEFAULT NULL,
  `disbursed_at` timestamp NULL DEFAULT NULL,
  `disbursed_by` bigint(20) unsigned DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `rejected_reason` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `loans_tenant_id_loan_number_unique` (`tenant_id`,`loan_number`),
  KEY `loans_branch_id_foreign` (`branch_id`),
  KEY `loans_customer_id_foreign` (`customer_id`),
  KEY `loans_loan_product_id_foreign` (`loan_product_id`),
  KEY `loans_approved_by_foreign` (`approved_by`),
  KEY `loans_disbursed_by_foreign` (`disbursed_by`),
  KEY `loans_tenant_id_status_index` (`tenant_id`,`status`),
  KEY `loans_tenant_id_due_date_index` (`tenant_id`,`due_date`),
  KEY `loans_status_index` (`status`),
  KEY `loans_application_date_index` (`application_date`),
  KEY `loans_due_date_index` (`due_date`),
  CONSTRAINT `loans_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loans_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loans_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loans_disbursed_by_foreign` FOREIGN KEY (`disbursed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loans_loan_product_id_foreign` FOREIGN KEY (`loan_product_id`) REFERENCES `loan_products` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loans_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `loans` WRITE;
/*!40000 ALTER TABLE `loans` DISABLE KEYS */;
INSERT INTO `loans` VALUES (1,1,1,1,1,'DEMO-LON-260500001',100000.00,8.00,'flat',8000.00,0.00,108000.00,100000.00,108000.00,'monthly',90,3,'months','active','Working capital',NULL,'2026-05-08',NULL,'2026-05-08 05:25:25',NULL,'2026-05-08 05:25:25',NULL,'2026-08-06',NULL,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(2,2,2,4,2,'NEWK-LON-260500001',100000.00,10.00,'flat',10000.00,0.00,110000.00,100000.00,86000.00,'monthly',300,10,'months','active','food','yes','2026-05-08',NULL,'2026-05-08 14:59:18',6,'2026-05-08 14:59:28',6,'2027-03-08',NULL,'2026-05-08 14:58:57','2026-05-10 05:39:45'),(3,2,NULL,15,3,'NEWK-LON-260500002',100000.00,10.00,'flat',10000.00,0.00,110000.00,100000.00,110000.00,'monthly',300,10,'months','active',NULL,NULL,'2026-05-10',NULL,'2026-05-10 02:30:02',6,'2026-05-10 02:30:07',6,'2027-03-10',NULL,'2026-05-10 02:28:54','2026-05-10 05:37:56'),(5,2,NULL,15,3,'NEWK-LON-260500003',100000.00,10.00,'flat',10000.00,0.00,110000.00,100000.00,110000.00,'monthly',300,10,'months','active',NULL,NULL,'2026-05-10','2026-05-25','2026-05-10 05:22:44',6,'2026-05-10 05:22:57',6,'2027-02-25',NULL,'2026-05-10 05:22:38','2026-05-10 05:37:56'),(6,2,NULL,15,3,'NEWK-LON-260500004',100000.00,10.00,'flat',10000.00,0.00,110000.00,100000.00,65000.00,'monthly',300,10,'months','active',NULL,NULL,'2026-05-10','2026-06-06','2026-05-10 05:32:11',6,'2026-05-10 05:40:33',6,'2027-03-06',NULL,'2026-05-10 05:31:29','2026-05-10 05:41:50'),(8,2,NULL,15,3,'NEWK-LON-260500005',200000.00,10.00,'flat',20000.00,0.00,220000.00,200000.00,102000.00,'monthly',300,10,'months','active','Goood',NULL,'2026-05-10','2026-06-10','2026-05-10 09:09:16',6,'2026-05-10 09:09:32',6,'2027-03-10',NULL,'2026-05-10 09:05:50','2026-05-10 09:39:11'),(9,2,2,18,8,'NEWK-MKL-260500006',100000.00,10.00,'flat',10000.00,2000.00,112000.00,0.00,112000.00,'monthly',360,12,'months','applied','Market',NULL,'2026-05-14','2026-06-13',NULL,NULL,NULL,NULL,'2027-05-13',NULL,'2026-05-14 03:06:34','2026-05-14 03:06:34');
/*!40000 ALTER TABLE `loans` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES (1,'0001_01_01_000000_create_users_table',1),(2,'0001_01_01_000001_create_cache_table',1),(3,'0001_01_01_000002_create_jobs_table',1),(4,'2026_05_08_000000_create_microfinance_saas_tables',1),(5,'2026_05_08_010000_add_auto_approval_impersonation_and_recurring_billing',2),(6,'2026_05_08_020000_create_gateway_payments_for_self_service',3),(7,'2026_05_09_000000_create_notification_campaigns',4),(8,'2026_05_09_010000_seed_integration_system_settings',5),(9,'2026_05_09_020000_extend_notification_campaigns_for_customers_and_whatsapp',6),(10,'2026_05_09_020100_seed_whatsapp_system_settings',6),(11,'2026_05_09_030000_add_homepage_settings_and_tenant_reminder_tracking',7),(12,'2026_05_09_060000_create_bill_payments_table',8),(13,'2026_05_09_070000_create_role_profiles_table',9),(14,'2026_05_09_080000_add_account_officer_to_customers_table',10),(15,'2026_05_09_090000_create_customer_groups_table',11),(16,'2026_05_09_100000_backfill_missing_customer_account_numbers',12),(17,'2026_05_10_000000_convert_customer_account_numbers_to_10_digits',13),(18,'2026_05_10_010000_remove_serial_customer_account_number_mode',14),(19,'2026_05_10_020000_add_virtual_account_fields_to_customers_table',15),(20,'2026_05_10_030000_add_member_identity_and_kyc_fields_to_customers_table',16),(21,'2026_05_10_040000_upgrade_loan_products_and_repayment_schedules',17),(22,'2026_05_10_050000_normalize_loan_terms_as_period_counts',18),(23,'2026_05_10_060000_create_agents_and_commissions',19),(24,'2026_05_10_070000_add_kyc_provider_lock_fields_to_customers_table',20),(25,'2026_05_14_010000_add_savings_products_and_product_visibility',21),(26,'2026_05_14_020000_add_processing_fee_to_savings_products',22),(27,'2026_05_14_030000_add_savings_account_plan_dates',23),(28,'2026_05_14_040000_add_account_number_prefix_to_savings_products',24),(29,'2026_05_14_050000_create_investment_tables',24),(30,'2026_05_14_060000_create_import_and_sync_tables',25),(31,'2026_05_14_070000_extend_agents_to_merchants',25);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `notification_campaign_recipients`
--

DROP TABLE IF EXISTS `notification_campaign_recipients`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notification_campaign_recipients` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `notification_campaign_id` bigint(20) unsigned NOT NULL,
  `tenant_id` bigint(20) unsigned DEFAULT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `tenant_name` varchar(255) NOT NULL,
  `customer_name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email_status` varchar(255) NOT NULL DEFAULT 'not_selected',
  `sms_status` varchar(255) NOT NULL DEFAULT 'not_selected',
  `portal_alert_status` varchar(255) NOT NULL DEFAULT 'not_selected',
  `whatsapp_status` varchar(255) NOT NULL DEFAULT 'not_selected',
  `email_error` text DEFAULT NULL,
  `sms_error` text DEFAULT NULL,
  `whatsapp_error` text DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notif_recip_campaign_fk` (`notification_campaign_id`),
  KEY `notification_campaign_recipients_tenant_id_created_at_index` (`tenant_id`,`created_at`),
  KEY `notification_campaign_recipients_email_status_index` (`email_status`),
  KEY `notification_campaign_recipients_sms_status_index` (`sms_status`),
  KEY `notification_campaign_recipients_portal_alert_status_index` (`portal_alert_status`),
  KEY `notification_campaign_recipients_sent_at_index` (`sent_at`),
  KEY `notif_recip_customer_created_idx` (`customer_id`,`created_at`),
  KEY `notification_campaign_recipients_whatsapp_status_index` (`whatsapp_status`),
  CONSTRAINT `notif_recip_campaign_fk` FOREIGN KEY (`notification_campaign_id`) REFERENCES `notification_campaigns` (`id`) ON DELETE CASCADE,
  CONSTRAINT `notification_campaign_recipients_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `notification_campaign_recipients_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `notification_campaign_recipients`
--

LOCK TABLES `notification_campaign_recipients` WRITE;
/*!40000 ALTER TABLE `notification_campaign_recipients` DISABLE KEYS */;
/*!40000 ALTER TABLE `notification_campaign_recipients` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `notification_campaigns`
--

DROP TABLE IF EXISTS `notification_campaigns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notification_campaigns` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `recipient_type` varchar(255) NOT NULL DEFAULT 'tenant',
  `subject` varchar(255) NOT NULL,
  `message` longtext NOT NULL,
  `channels` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`channels`)),
  `audience_type` varchar(255) NOT NULL,
  `audience_filters` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`audience_filters`)),
  `status` varchar(255) NOT NULL DEFAULT 'completed',
  `total_recipients` int(10) unsigned NOT NULL DEFAULT 0,
  `email_sent_count` int(10) unsigned NOT NULL DEFAULT 0,
  `sms_sent_count` int(10) unsigned NOT NULL DEFAULT 0,
  `portal_alert_count` int(10) unsigned NOT NULL DEFAULT 0,
  `whatsapp_sent_count` int(10) unsigned NOT NULL DEFAULT 0,
  `failed_count` int(10) unsigned NOT NULL DEFAULT 0,
  `sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `notification_campaigns_created_by_foreign` (`created_by`),
  KEY `notification_campaigns_audience_type_index` (`audience_type`),
  KEY `notification_campaigns_status_index` (`status`),
  KEY `notification_campaigns_sent_at_index` (`sent_at`),
  KEY `notif_campaign_tenant_type_created_idx` (`tenant_id`,`recipient_type`,`created_at`),
  KEY `notification_campaigns_recipient_type_index` (`recipient_type`),
  CONSTRAINT `notification_campaigns_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `notification_campaigns_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `notification_campaigns`
--

LOCK TABLES `notification_campaigns` WRITE;
/*!40000 ALTER TABLE `notification_campaigns` DISABLE KEYS */;
/*!40000 ALTER TABLE `notification_campaigns` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `password_reset_tokens`
--

DROP TABLE IF EXISTS `password_reset_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `password_reset_tokens`
--

LOCK TABLES `password_reset_tokens` WRITE;
/*!40000 ALTER TABLE `password_reset_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_reset_tokens` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `role_profiles`
--

DROP TABLE IF EXISTS `role_profiles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role_profiles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `base_role` varchar(255) DEFAULT NULL,
  `permissions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`permissions`)),
  `is_system` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_profiles_tenant_id_name_unique` (`tenant_id`,`name`),
  KEY `role_profiles_tenant_id_is_active_index` (`tenant_id`,`is_active`),
  KEY `role_profiles_base_role_index` (`base_role`),
  KEY `role_profiles_is_active_index` (`is_active`),
  CONSTRAINT `role_profiles_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `role_profiles`
--

LOCK TABLES `role_profiles` WRITE;
/*!40000 ALTER TABLE `role_profiles` DISABLE KEYS */;
INSERT INTO `role_profiles` VALUES (1,1,'Tenant Admin','Full owner access to all tenant modules and settings.','tenant_admin','[\"dashboard.view\",\"customers.view\",\"customers.manage\",\"savings.view\",\"savings.manage\",\"loans.view\",\"loans.create\",\"loans.approve\",\"loans.disburse\",\"repayments.view\",\"repayments.record\",\"loan_products.manage\",\"investments.view\",\"expenses.view\",\"expenses.create\",\"accounting.view\",\"accounting.income.create\",\"accounting.journals.create\",\"billing.view\",\"billing.manage\",\"bill_payments.view\",\"bill_payments.manage\",\"reports.view\",\"reports.export\",\"notifications.view\",\"notifications.send\",\"bulk_sms.send\",\"support.view\",\"settings.manage\",\"branches.manage\",\"staff.manage\",\"role_profiles.manage\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(2,1,'Manager','Broad operational access for branch or company managers.','manager','[\"dashboard.view\",\"customers.view\",\"customers.manage\",\"savings.view\",\"savings.manage\",\"loans.view\",\"loans.create\",\"loans.approve\",\"loans.disburse\",\"repayments.view\",\"repayments.record\",\"loan_products.manage\",\"investments.view\",\"expenses.view\",\"expenses.create\",\"accounting.view\",\"accounting.income.create\",\"accounting.journals.create\",\"billing.view\",\"billing.manage\",\"bill_payments.view\",\"bill_payments.manage\",\"reports.view\",\"reports.export\",\"notifications.view\",\"notifications.send\",\"bulk_sms.send\",\"support.view\",\"settings.manage\",\"branches.manage\",\"staff.manage\",\"role_profiles.manage\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(3,1,'Loan Officer','Customer, savings, loans, repayments, reports, and support access.','loan_officer','[\"dashboard.view\",\"customers.view\",\"customers.manage\",\"savings.view\",\"savings.manage\",\"loans.view\",\"loans.create\",\"repayments.view\",\"repayments.record\",\"investments.view\",\"reports.view\",\"notifications.view\",\"support.view\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(4,1,'Accountant','Finance, accounting, repayments, billing, bill payment, and report access.','accountant','[\"dashboard.view\",\"customers.view\",\"savings.view\",\"loans.view\",\"repayments.view\",\"repayments.record\",\"expenses.view\",\"expenses.create\",\"accounting.view\",\"accounting.income.create\",\"accounting.journals.create\",\"billing.view\",\"billing.manage\",\"bill_payments.view\",\"bill_payments.manage\",\"reports.view\",\"reports.export\",\"notifications.view\",\"support.view\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(5,2,'Tenant Admin','Full owner access to all tenant modules and settings.','tenant_admin','[\"dashboard.view\",\"customers.view\",\"customers.manage\",\"savings.view\",\"savings.manage\",\"loans.view\",\"loans.create\",\"loans.approve\",\"loans.disburse\",\"repayments.view\",\"repayments.record\",\"loan_products.manage\",\"investments.view\",\"expenses.view\",\"expenses.create\",\"accounting.view\",\"accounting.income.create\",\"accounting.journals.create\",\"billing.view\",\"billing.manage\",\"bill_payments.view\",\"bill_payments.manage\",\"reports.view\",\"reports.export\",\"notifications.view\",\"notifications.send\",\"bulk_sms.send\",\"support.view\",\"settings.manage\",\"branches.manage\",\"staff.manage\",\"role_profiles.manage\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(6,2,'Manager','Broad operational access for branch or company managers.','manager','[\"dashboard.view\",\"customers.view\",\"customers.manage\",\"savings.view\",\"savings.manage\",\"loans.view\",\"loans.create\",\"loans.approve\",\"loans.disburse\",\"repayments.view\",\"repayments.record\",\"loan_products.manage\",\"investments.view\",\"expenses.view\",\"expenses.create\",\"accounting.view\",\"accounting.income.create\",\"accounting.journals.create\",\"billing.view\",\"billing.manage\",\"bill_payments.view\",\"bill_payments.manage\",\"reports.view\",\"reports.export\",\"notifications.view\",\"notifications.send\",\"bulk_sms.send\",\"support.view\",\"settings.manage\",\"branches.manage\",\"staff.manage\",\"role_profiles.manage\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(7,2,'Loan Officer','Customer, savings, loans, repayments, reports, and support access.','loan_officer','[\"dashboard.view\",\"customers.view\",\"customers.manage\",\"savings.view\",\"savings.manage\",\"loans.view\",\"loans.create\",\"repayments.view\",\"repayments.record\",\"investments.view\",\"reports.view\",\"notifications.view\",\"support.view\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(8,2,'Accountant','Finance, accounting, repayments, billing, bill payment, and report access.','accountant','[\"dashboard.view\",\"customers.view\",\"savings.view\",\"loans.view\",\"repayments.view\",\"repayments.record\",\"expenses.view\",\"expenses.create\",\"accounting.view\",\"accounting.income.create\",\"accounting.journals.create\",\"billing.view\",\"billing.manage\",\"bill_payments.view\",\"bill_payments.manage\",\"reports.view\",\"reports.export\",\"notifications.view\",\"support.view\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(9,3,'Tenant Admin','Full owner access to all tenant modules and settings.','tenant_admin','[\"dashboard.view\",\"customers.view\",\"customers.manage\",\"savings.view\",\"savings.manage\",\"loans.view\",\"loans.create\",\"loans.approve\",\"loans.disburse\",\"repayments.view\",\"repayments.record\",\"loan_products.manage\",\"investments.view\",\"expenses.view\",\"expenses.create\",\"accounting.view\",\"accounting.income.create\",\"accounting.journals.create\",\"billing.view\",\"billing.manage\",\"bill_payments.view\",\"bill_payments.manage\",\"reports.view\",\"reports.export\",\"notifications.view\",\"notifications.send\",\"bulk_sms.send\",\"support.view\",\"settings.manage\",\"branches.manage\",\"staff.manage\",\"role_profiles.manage\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(10,3,'Manager','Broad operational access for branch or company managers.','manager','[\"dashboard.view\",\"customers.view\",\"customers.manage\",\"savings.view\",\"savings.manage\",\"loans.view\",\"loans.create\",\"loans.approve\",\"loans.disburse\",\"repayments.view\",\"repayments.record\",\"loan_products.manage\",\"investments.view\",\"expenses.view\",\"expenses.create\",\"accounting.view\",\"accounting.income.create\",\"accounting.journals.create\",\"billing.view\",\"billing.manage\",\"bill_payments.view\",\"bill_payments.manage\",\"reports.view\",\"reports.export\",\"notifications.view\",\"notifications.send\",\"bulk_sms.send\",\"support.view\",\"settings.manage\",\"branches.manage\",\"staff.manage\",\"role_profiles.manage\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(11,3,'Loan Officer','Customer, savings, loans, repayments, reports, and support access.','loan_officer','[\"dashboard.view\",\"customers.view\",\"customers.manage\",\"savings.view\",\"savings.manage\",\"loans.view\",\"loans.create\",\"repayments.view\",\"repayments.record\",\"investments.view\",\"reports.view\",\"notifications.view\",\"support.view\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(12,3,'Accountant','Finance, accounting, repayments, billing, bill payment, and report access.','accountant','[\"dashboard.view\",\"customers.view\",\"savings.view\",\"loans.view\",\"repayments.view\",\"repayments.record\",\"expenses.view\",\"expenses.create\",\"accounting.view\",\"accounting.income.create\",\"accounting.journals.create\",\"billing.view\",\"billing.manage\",\"bill_payments.view\",\"bill_payments.manage\",\"reports.view\",\"reports.export\",\"notifications.view\",\"support.view\"]',1,1,'2026-05-09 07:59:51','2026-05-09 07:59:51'),(13,2,'Field Officer','Collect Money',NULL,'[\"dashboard.view\",\"notifications.view\"]',0,1,'2026-05-09 15:34:43','2026-05-09 15:34:43'),(14,2,'Account Officer',NULL,NULL,'[\"dashboard.view\",\"customers.view\",\"customers.manage\"]',0,1,'2026-05-09 16:09:07','2026-05-09 16:09:17');
/*!40000 ALTER TABLE `role_profiles` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `savings_accounts`
--

DROP TABLE IF EXISTS `savings_accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savings_accounts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `savings_product_id` bigint(20) unsigned DEFAULT NULL,
  `account_number` varchar(255) NOT NULL,
  `product_name` varchar(255) NOT NULL DEFAULT 'Regular Savings',
  `product_type` varchar(40) NOT NULL DEFAULT 'regular',
  `start_date` date DEFAULT NULL,
  `balance` decimal(14,2) NOT NULL DEFAULT 0.00,
  `processing_fee_type` varchar(40) DEFAULT NULL,
  `processing_fee_amount` decimal(14,2) NOT NULL DEFAULT 0.00,
  `target_amount` decimal(14,2) DEFAULT NULL,
  `target_date` date DEFAULT NULL,
  `contribution_amount` decimal(14,2) DEFAULT NULL,
  `contribution_frequency` varchar(30) DEFAULT NULL,
  `contribution_periods` int(10) unsigned DEFAULT NULL,
  `planned_total_amount` decimal(14,2) DEFAULT NULL,
  `maturity_date` date DEFAULT NULL,
  `cooperative_group_name` varchar(255) DEFAULT NULL,
  `locked_until` date DEFAULT NULL,
  `metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`metadata`)),
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `opened_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `savings_accounts_tenant_id_account_number_unique` (`tenant_id`,`account_number`),
  KEY `savings_accounts_customer_id_foreign` (`customer_id`),
  KEY `savings_accounts_tenant_id_status_index` (`tenant_id`,`status`),
  KEY `savings_accounts_status_index` (`status`),
  KEY `savings_accounts_savings_product_id_foreign` (`savings_product_id`),
  CONSTRAINT `savings_accounts_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `savings_accounts_savings_product_id_foreign` FOREIGN KEY (`savings_product_id`) REFERENCES `savings_products` (`id`) ON DELETE SET NULL,
  CONSTRAINT `savings_accounts_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `savings_accounts`
--

LOCK TABLES `savings_accounts` WRITE;
/*!40000 ALTER TABLE `savings_accounts` DISABLE KEYS */;
INSERT INTO `savings_accounts` VALUES (1,1,1,1,'DEMO-SAV-260500001','Regular Savings','regular',NULL,50000.00,NULL,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','2026-05-08 05:25:25','2026-05-08 05:25:25','2026-05-08 05:25:25'),(2,1,2,1,'DEMO-SAV-260500002','Regular Savings','regular',NULL,50000.00,NULL,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','2026-05-08 05:25:25','2026-05-08 05:25:25','2026-05-08 05:25:25'),(3,1,3,1,'DEMO-SAV-260500003','Regular Savings','regular',NULL,50000.00,NULL,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','2026-05-08 05:25:25','2026-05-08 05:25:25','2026-05-08 05:25:25'),(4,2,4,5,'NEWK-SAV-260500001','Regular Savings','regular',NULL,20000.00,NULL,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','2026-05-08 14:51:27','2026-05-08 14:51:27','2026-05-08 14:51:48'),(5,2,16,5,'NEWK-SAV-260500002','Regular Savings','regular',NULL,0.00,NULL,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'active','2026-05-10 09:32:30','2026-05-10 09:32:30','2026-05-10 09:32:30'),(7,2,18,6,'NEWK-ISU-260500003','Thrift / Isusu Savings','thrift_isusu','2026-05-14',9000.00,'contribution_amount',2000.00,NULL,NULL,2000.00,'daily',30,60000.00,'2026-06-13',NULL,'2026-06-13',NULL,'active','2026-05-14 03:43:44','2026-05-14 03:43:44','2026-05-14 03:55:42'),(8,2,16,8,'COP-260500004','Cooperative Savings','cooperative','2026-05-14',0.00,'contribution_amount',50000.00,NULL,NULL,50000.00,'monthly',5,250000.00,'2026-10-14','Aria',NULL,NULL,'active','2026-05-14 04:06:41','2026-05-14 04:06:41','2026-05-14 04:06:41');
/*!40000 ALTER TABLE `savings_accounts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `savings_products`
--

DROP TABLE IF EXISTS `savings_products`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savings_products` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(40) NOT NULL DEFAULT 'regular',
  `description` text DEFAULT NULL,
  `account_number_prefix` varchar(20) NOT NULL DEFAULT 'SAV',
  `interest_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `minimum_opening_balance` decimal(14,2) NOT NULL DEFAULT 0.00,
  `minimum_balance` decimal(14,2) NOT NULL DEFAULT 0.00,
  `processing_fee_type` varchar(40) NOT NULL DEFAULT 'fixed',
  `processing_fee_value` decimal(14,2) NOT NULL DEFAULT 0.00,
  `contribution_amount` decimal(14,2) DEFAULT NULL,
  `contribution_frequency` varchar(30) DEFAULT NULL,
  `duration_days` int(10) unsigned DEFAULT NULL,
  `withdrawal_policy` varchar(50) NOT NULL DEFAULT 'flexible',
  `allow_member_create` tinyint(1) NOT NULL DEFAULT 1,
  `show_on_member_portal` tinyint(1) NOT NULL DEFAULT 1,
  `show_on_public_website` tinyint(1) NOT NULL DEFAULT 1,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`settings`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `savings_products_tenant_id_name_unique` (`tenant_id`,`name`),
  KEY `savings_products_tenant_id_type_is_active_index` (`tenant_id`,`type`,`is_active`),
  KEY `savings_products_type_index` (`type`),
  KEY `savings_products_is_active_index` (`is_active`),
  CONSTRAINT `savings_products_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `savings_products`
--

LOCK TABLES `savings_products` WRITE;
/*!40000 ALTER TABLE `savings_products` DISABLE KEYS */;
INSERT INTO `savings_products` VALUES (1,1,'Regular Savings','regular','Flexible savings account for deposits, withdrawals, statements, and balance tracking.','SAV',0.00,0.00,0.00,'fixed',0.00,NULL,NULL,NULL,'flexible',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:10:59'),(2,1,'Thrift / Isusu Savings','thrift_isusu','Daily, weekly, or monthly contribution savings with maturity tracking.','ISU',0.00,0.00,0.00,'contribution_amount',0.00,NULL,'daily',NULL,'locked_until_maturity',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:10:59'),(3,1,'Target Savings','target','Goal-based savings for rent, school fees, business stock, equipment, or personal targets.','TSA',0.00,0.00,0.00,'contribution_amount',0.00,NULL,'monthly',NULL,'locked_until_maturity',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:10:59'),(4,1,'Cooperative Savings','cooperative','Group and cooperative savings with pooled contribution tracking.','COP',0.00,0.00,0.00,'contribution_amount',0.00,NULL,'monthly',NULL,'admin_approval',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:10:59'),(5,2,'Regular Savings','regular','Flexible savings account for deposits, withdrawals, statements, and balance tracking.','SAV',0.00,0.00,0.00,'fixed',0.00,NULL,NULL,NULL,'flexible',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:23:02'),(6,2,'Thrift / Isusu Savings','thrift_isusu','Daily, weekly, or monthly contribution savings with maturity tracking.','ISU',0.00,1000.00,0.00,'contribution_amount',0.00,NULL,'daily',30,'locked_until_maturity',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:34:46'),(7,2,'Target Savings','target','Goal-based savings for rent, school fees, business stock, equipment, or personal targets.','TSA',0.00,0.00,0.00,'contribution_amount',0.00,NULL,'monthly',NULL,'locked_until_maturity',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:23:02'),(8,2,'Cooperative Savings','cooperative','Group and cooperative savings with pooled contribution tracking.','COP',0.00,0.00,0.00,'contribution_amount',0.00,NULL,'monthly',NULL,'admin_approval',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:23:02'),(9,3,'Regular Savings','regular','Flexible savings account for deposits, withdrawals, statements, and member balance tracking.','SAV',0.00,0.00,0.00,'fixed',0.00,NULL,NULL,NULL,'flexible',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:07:35'),(10,3,'Thrift / Isusu Savings','thrift_isusu','Contribution savings for daily, weekly, or monthly thrift collections with maturity tracking.','ISU',0.00,0.00,0.00,'contribution_amount',0.00,NULL,'daily',NULL,'locked_until_maturity',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:07:35'),(11,3,'Target Savings','target','Goal-based savings for school fees, rent, business stock, equipment, and personal targets.','TSA',0.00,0.00,0.00,'contribution_amount',0.00,NULL,'monthly',NULL,'locked_until_maturity',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:07:35'),(12,3,'Cooperative Savings','cooperative','Group and cooperative member savings with pooled contribution tracking.','COP',0.00,0.00,0.00,'contribution_amount',0.00,NULL,'monthly',NULL,'admin_approval',1,1,1,1,NULL,'2026-05-14 03:07:35','2026-05-14 03:07:35');
/*!40000 ALTER TABLE `savings_products` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `savings_transactions`
--

DROP TABLE IF EXISTS `savings_transactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savings_transactions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `savings_account_id` bigint(20) unsigned NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `type` varchar(255) NOT NULL,
  `amount` decimal(14,2) NOT NULL,
  `balance_before` decimal(14,2) NOT NULL DEFAULT 0.00,
  `balance_after` decimal(14,2) NOT NULL DEFAULT 0.00,
  `reference` varchar(255) NOT NULL,
  `method` varchar(255) NOT NULL DEFAULT 'cash',
  `description` text DEFAULT NULL,
  `transacted_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `savings_transactions_reference_unique` (`reference`),
  KEY `savings_transactions_savings_account_id_foreign` (`savings_account_id`),
  KEY `savings_transactions_customer_id_foreign` (`customer_id`),
  KEY `savings_transactions_created_by_foreign` (`created_by`),
  KEY `savings_transactions_tenant_id_type_transacted_at_index` (`tenant_id`,`type`,`transacted_at`),
  KEY `savings_transactions_type_index` (`type`),
  KEY `savings_transactions_transacted_at_index` (`transacted_at`),
  CONSTRAINT `savings_transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `savings_transactions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `savings_transactions_savings_account_id_foreign` FOREIGN KEY (`savings_account_id`) REFERENCES `savings_accounts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `savings_transactions_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `savings_transactions`
--

LOCK TABLES `savings_transactions` WRITE;
/*!40000 ALTER TABLE `savings_transactions` DISABLE KEYS */;
INSERT INTO `savings_transactions` VALUES (1,1,1,1,NULL,'deposit',50000.00,0.00,50000.00,'DEP-20260508062525-HWNJV','cash','Opening deposit','2026-05-08 05:25:25','2026-05-08 05:25:25','2026-05-08 05:25:25'),(2,1,2,2,NULL,'deposit',50000.00,0.00,50000.00,'DEP-20260508062525-QTDIF','cash','Opening deposit','2026-05-08 05:25:25','2026-05-08 05:25:25','2026-05-08 05:25:25'),(3,1,3,3,NULL,'deposit',50000.00,0.00,50000.00,'DEP-20260508062525-V3ZEK','cash','Opening deposit','2026-05-08 05:25:25','2026-05-08 05:25:25','2026-05-08 05:25:25'),(4,2,4,4,6,'deposit',20000.00,0.00,20000.00,'DEP-20260508155148-KPIYW','cash','savings','2026-05-08 14:51:48','2026-05-08 14:51:48','2026-05-08 14:51:48'),(5,2,7,18,6,'deposit',2000.00,0.00,2000.00,'DEP-20260514044424-Y2D4L','cash',NULL,'2026-05-14 03:44:24','2026-05-14 03:44:24','2026-05-14 03:44:24'),(6,2,7,18,6,'deposit',6000.00,2000.00,8000.00,'DEP-20260514044727-TL8EP','cash',NULL,'2026-05-14 03:47:27','2026-05-14 03:47:27','2026-05-14 03:47:27'),(7,2,7,18,6,'deposit',1000.00,8000.00,9000.00,'DEP-20260514045542-2CPE0','cash',NULL,'2026-05-14 03:55:42','2026-05-14 03:55:42','2026-05-14 03:55:42');
/*!40000 ALTER TABLE `savings_transactions` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `sessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) 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;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `sessions` WRITE;
/*!40000 ALTER TABLE `sessions` DISABLE KEYS */;
INSERT INTO `sessions` VALUES ('aNfCY7iyRIO3g60MFxjNJoxjUwzj0EmB2jja7YEq',6,'127.0.0.1','Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0','YTo0OntzOjY6Il90b2tlbiI7czo0MDoiZFhuMnZUWU9tcG5PMFdrejA4RmlTTG42ZjJrYkVnblY0WDdlZjdNMSI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MzE6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9hcHAvc3RhZmYiO3M6NToicm91dGUiO3M6MTg6InRlbmFudC5zdGFmZi5pbmRleCI7fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjY7fQ==',1778233898);
/*!40000 ALTER TABLE `sessions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `subscription_plans`
--

DROP TABLE IF EXISTS `subscription_plans`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subscription_plans` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `price_monthly` decimal(12,2) NOT NULL DEFAULT 0.00,
  `price_yearly` decimal(12,2) NOT NULL DEFAULT 0.00,
  `staff_limit` int(10) unsigned NOT NULL DEFAULT 3,
  `customer_limit` int(10) unsigned NOT NULL DEFAULT 200,
  `branch_limit` int(10) unsigned NOT NULL DEFAULT 1,
  `storage_limit_mb` int(10) unsigned NOT NULL DEFAULT 500,
  `features` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`features`)),
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subscription_plans_slug_unique` (`slug`),
  KEY `subscription_plans_is_active_index` (`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `subscription_plans`
--

LOCK TABLES `subscription_plans` WRITE;
/*!40000 ALTER TABLE `subscription_plans` DISABLE KEYS */;
INSERT INTO `subscription_plans` VALUES (1,'Basic','starter','Starter plan for microfinance operators.',7950.00,93000.00,3,500,1,1024,'[\"Customer KYC\",\"Savings\",\"Loans\",\"Basic reports\"]',1,'2026-05-08 05:25:23','2026-05-09 05:41:08'),(2,'Standard','growth','Growth plan for microfinance operators.',12950.00,150000.00,10,2000,1,1024,'[\"All Starter features\",\"Accounting\",\"Branch management\",\"PDF reports\"]',1,'2026-05-08 05:25:23','2026-05-09 05:42:51'),(3,'Premium','enterprise','Enterprise plan for microfinance operators.',17950.00,210000.00,20,5000,1,1024,'[\"All Growth features\",\"Priority support\",\"Advanced limits\"]',1,'2026-05-08 05:25:23','2026-05-09 05:44:14');
/*!40000 ALTER TABLE `subscription_plans` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `subscriptions`
--

DROP TABLE IF EXISTS `subscriptions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subscriptions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `subscription_plan_id` bigint(20) unsigned NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'trial',
  `billing_cycle` varchar(255) NOT NULL DEFAULT 'monthly',
  `amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `starts_at` timestamp NULL DEFAULT NULL,
  `ends_at` timestamp NULL DEFAULT NULL,
  `trial_ends_at` timestamp NULL DEFAULT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `subscriptions_subscription_plan_id_foreign` (`subscription_plan_id`),
  KEY `subscriptions_tenant_id_status_index` (`tenant_id`,`status`),
  KEY `subscriptions_status_index` (`status`),
  KEY `subscriptions_ends_at_index` (`ends_at`),
  KEY `subscriptions_reference_index` (`reference`),
  CONSTRAINT `subscriptions_subscription_plan_id_foreign` FOREIGN KEY (`subscription_plan_id`) REFERENCES `subscription_plans` (`id`) ON DELETE CASCADE,
  CONSTRAINT `subscriptions_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `subscriptions`
--

LOCK TABLES `subscriptions` WRITE;
/*!40000 ALTER TABLE `subscriptions` DISABLE KEYS */;
INSERT INTO `subscriptions` VALUES (1,1,2,'active','monthly',60000.00,'2026-05-08 05:25:25','2026-06-08 05:25:25',NULL,'SEED-SUBSCRIPTION','2026-05-08 05:25:25','2026-05-08 05:25:25'),(2,2,1,'trial','monthly',0.00,'2026-05-08 08:50:34','2026-05-22 08:50:34','2026-05-22 08:50:34','TRIAL-20260508095034-M4ZF2','2026-05-08 08:50:34','2026-05-08 08:50:34'),(3,2,1,'active','monthly',25000.00,'2026-05-22 08:50:34','2026-06-22 08:50:34',NULL,'SUB-20260509023751-VK7RK','2026-05-09 01:45:33','2026-05-09 01:45:33'),(4,3,2,'trial','monthly',0.00,'2026-05-09 02:02:14','2026-05-23 02:02:14','2026-05-23 02:02:14','TRIAL-20260509030214-2HE5K','2026-05-09 02:02:14','2026-05-09 02:02:14');
/*!40000 ALTER TABLE `subscriptions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `support_tickets`
--

DROP TABLE IF EXISTS `support_tickets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `support_tickets` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `ticket_number` varchar(255) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `category` varchar(255) NOT NULL DEFAULT 'general',
  `priority` varchar(255) NOT NULL DEFAULT 'normal',
  `status` varchar(255) NOT NULL DEFAULT 'open',
  `message` longtext NOT NULL,
  `admin_response` longtext DEFAULT NULL,
  `resolved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `support_tickets_ticket_number_unique` (`ticket_number`),
  KEY `support_tickets_user_id_foreign` (`user_id`),
  KEY `support_tickets_tenant_id_status_index` (`tenant_id`,`status`),
  KEY `support_tickets_category_index` (`category`),
  KEY `support_tickets_priority_index` (`priority`),
  KEY `support_tickets_status_index` (`status`),
  CONSTRAINT `support_tickets_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `support_tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `support_tickets`
--

LOCK TABLES `support_tickets` WRITE;
/*!40000 ALTER TABLE `support_tickets` DISABLE KEYS */;
/*!40000 ALTER TABLE `support_tickets` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `system_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `system_settings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(255) NOT NULL,
  `value` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `system_settings_key_unique` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `system_settings`
--

LOCK TABLES `system_settings` WRITE;
/*!40000 ALTER TABLE `system_settings` DISABLE KEYS */;
INSERT INTO `system_settings` VALUES (1,'platform_name','NewKipp Microfinance Solution'),(2,'support_email','support@example.com'),(3,'trial_days','14'),(4,'bank_details','Bank: Demo Bank\nAccount Name: NewKipp Microfinance Solution\nAccount Number: 0000000000'),(5,'mail_mailer','log'),(6,'mail_host','127.0.0.1'),(7,'mail_port','2525'),(8,'mail_username',NULL),(9,'mail_password',NULL),(10,'mail_scheme',NULL),(11,'mail_from_address','hello@example.com'),(12,'mail_from_name','NewKipp Microfinance Solution'),(13,'sms_driver','log'),(14,'sms_gateway_url',''),(15,'sms_gateway_method','POST'),(16,'sms_gateway_token',''),(17,'sms_from','NewKipp Microfinance Solution'),(18,'sms_to_param','to'),(19,'sms_message_param','message'),(20,'sms_sender_param','from'),(21,'payment_gateway_provider','none'),(22,'paystack_secret_key',''),(23,'paystack_base_url','https://api.paystack.co'),(24,'whatsapp_driver','log'),(25,'whatsapp_gateway_url',NULL),(26,'whatsapp_gateway_method','POST'),(27,'whatsapp_gateway_token',NULL),(28,'whatsapp_from','NewKipp Microfinance Solution'),(29,'whatsapp_to_param','to'),(30,'whatsapp_message_param','message'),(31,'whatsapp_sender_param','from'),(32,'homepage_hero_title','Run your entire Microfinance from one modern platform.'),(33,'homepage_hero_subtitle','Smart Solution, manage savings and loans, automate repayment schedules, collect online payments, sell airtime, data and electricity bills, and get a branded customer portal.'),(34,'homepage_primary_cta','Start 14-day trial'),(35,'homepage_about_title','Built for daily microfinance work.'),(36,'homepage_about_body','NewKipp helps microfinance and cooperative teams manage members, collect savings, disburse loans, track repayments, sell bill payments, and view clear reports from one organized workspace.'),(37,'homepage_contact_email','hello@microfinance-saas.test'),(38,'homepage_contact_phone','+234 800 000 0000'),(39,'homepage_whatsapp_number','2348000000000'),(40,'homepage_testimonials','[{\"name\":\"Amina Bello\",\"role\":\"Cooperative Manager\",\"quote\":\"The dashboard gives us one place for savings, loans, repayments, and member records.\"},{\"name\":\"Chinedu Okafor\",\"role\":\"Microfinance Owner\",\"quote\":\"The branded customer portal helps our members register and apply without waiting for staff.\"},{\"name\":\"Grace Adeyemi\",\"role\":\"Accountant\",\"quote\":\"Receipts, ledgers, cashbook, and billing are connected. Reconciliation is easier now.\"},{\"name\":\"Tunde Balogun\",\"role\":\"Branch Manager\",\"quote\":\"Our loan officers can track schedules and repayments without jumping between spreadsheets.\"},{\"name\":\"Ngozi Eze\",\"role\":\"Credit Lead\",\"quote\":\"The KYC and guarantor records make customer review faster and more organized.\"},{\"name\":\"Sadiq Musa\",\"role\":\"SaaS Operator\",\"quote\":\"Multi-tenant controls let us support different companies from one cPanel-friendly install.\"},{\"name\":\"Bola Martins\",\"role\":\"Operations Manager\",\"quote\":\"The trial countdown and subscription controls make tenant onboarding very clear.\"},{\"name\":\"Ifeoma Nwankwo\",\"role\":\"Finance Officer\",\"quote\":\"The profit and loss view gives management a quick picture of business health.\"},{\"name\":\"Kunle Ajayi\",\"role\":\"Field Officer\",\"quote\":\"Customer self-service reduced routine calls about schedules and balances.\"},{\"name\":\"Rukayat Lawal\",\"role\":\"Platform Admin\",\"quote\":\"It feels built for the Nigerian market, from local payments to customer communication.\"}]'),(41,'tenant_lifecycle_email_enabled','1'),(42,'tenant_lifecycle_sms_enabled','0'),(43,'tenant_lifecycle_whatsapp_enabled','0'),(44,'tenant_lifecycle_portal_enabled','1');
/*!40000 ALTER TABLE `system_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tenant_payments`
--

DROP TABLE IF EXISTS `tenant_payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tenant_payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned NOT NULL,
  `subscription_plan_id` bigint(20) unsigned NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `billing_cycle` varchar(255) NOT NULL DEFAULT 'monthly',
  `payment_channel` varchar(255) NOT NULL DEFAULT 'manual',
  `is_auto_billed` tinyint(1) NOT NULL DEFAULT 0,
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `reference` varchar(255) NOT NULL,
  `gateway_reference` varchar(255) DEFAULT NULL,
  `proof_path` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `approved_by` bigint(20) unsigned DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `rejected_reason` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tenant_payments_reference_unique` (`reference`),
  KEY `tenant_payments_subscription_plan_id_foreign` (`subscription_plan_id`),
  KEY `tenant_payments_approved_by_foreign` (`approved_by`),
  KEY `tenant_payments_tenant_id_status_index` (`tenant_id`,`status`),
  KEY `tenant_payments_status_index` (`status`),
  KEY `tenant_payments_payment_channel_index` (`payment_channel`),
  KEY `tenant_payments_is_auto_billed_index` (`is_auto_billed`),
  KEY `tenant_payments_gateway_reference_index` (`gateway_reference`),
  CONSTRAINT `tenant_payments_approved_by_foreign` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tenant_payments_subscription_plan_id_foreign` FOREIGN KEY (`subscription_plan_id`) REFERENCES `subscription_plans` (`id`) ON DELETE CASCADE,
  CONSTRAINT `tenant_payments_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tenant_payments`
--

LOCK TABLES `tenant_payments` WRITE;
/*!40000 ALTER TABLE `tenant_payments` DISABLE KEYS */;
INSERT INTO `tenant_payments` VALUES (1,2,1,25000.00,'monthly','manual',0,'approved','SUB-20260509023751-VK7RK',NULL,'payment-proofs/YSi49Z3LRSTTZ4XvmRl6oFIEcJYXCB7f0Qmb7iwX.jpg',NULL,1,'2026-05-09 01:45:33','2026-05-09 01:45:33',NULL,'2026-05-09 01:37:51','2026-05-09 01:45:33');
/*!40000 ALTER TABLE `tenant_payments` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `tenants`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tenants` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `subscription_plan_id` bigint(20) unsigned DEFAULT NULL,
  `agent_id` bigint(20) unsigned DEFAULT NULL,
  `agent_assigned_at` timestamp NULL DEFAULT NULL,
  `agent_commission_type` varchar(30) NOT NULL DEFAULT 'onboarding',
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `subdomain` varchar(255) DEFAULT NULL,
  `owner_name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `logo_path` varchar(255) DEFAULT NULL,
  `primary_color` varchar(20) NOT NULL DEFAULT '#155e75',
  `status` varchar(255) NOT NULL DEFAULT 'pending',
  `settings` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`settings`)),
  `auto_billing_enabled` tinyint(1) NOT NULL DEFAULT 0,
  `auto_billing_cycle` varchar(255) DEFAULT NULL,
  `auto_billing_method` varchar(255) DEFAULT NULL,
  `auto_billing_reference` varchar(255) DEFAULT NULL,
  `auto_billing_status` varchar(255) NOT NULL DEFAULT 'inactive',
  `auto_billing_started_at` timestamp NULL DEFAULT NULL,
  `auto_billing_last_charged_at` timestamp NULL DEFAULT NULL,
  `auto_billing_next_charge_at` timestamp NULL DEFAULT NULL,
  `auto_billing_failed_at` timestamp NULL DEFAULT NULL,
  `auto_billing_failure_reason` text DEFAULT NULL,
  `trial_ends_at` timestamp NULL DEFAULT NULL,
  `trial_reminder_sent_at` timestamp NULL DEFAULT NULL,
  `subscription_ends_at` timestamp NULL DEFAULT NULL,
  `overdue_reminder_sent_at` timestamp NULL DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `rejected_at` timestamp NULL DEFAULT NULL,
  `rejected_reason` text DEFAULT NULL,
  `suspended_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tenants_slug_unique` (`slug`),
  UNIQUE KEY `tenants_email_unique` (`email`),
  UNIQUE KEY `tenants_subdomain_unique` (`subdomain`),
  KEY `tenants_subscription_plan_id_foreign` (`subscription_plan_id`),
  KEY `tenants_status_index` (`status`),
  KEY `tenants_trial_ends_at_index` (`trial_ends_at`),
  KEY `tenants_subscription_ends_at_index` (`subscription_ends_at`),
  KEY `tenants_auto_billing_enabled_index` (`auto_billing_enabled`),
  KEY `tenants_auto_billing_status_index` (`auto_billing_status`),
  KEY `tenants_auto_billing_next_charge_at_index` (`auto_billing_next_charge_at`),
  KEY `tenants_trial_reminder_sent_at_index` (`trial_reminder_sent_at`),
  KEY `tenants_overdue_reminder_sent_at_index` (`overdue_reminder_sent_at`),
  KEY `tenants_agent_id_status_index` (`agent_id`,`status`),
  KEY `tenants_agent_commission_type_index` (`agent_commission_type`),
  CONSTRAINT `tenants_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `agents` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tenants_subscription_plan_id_foreign` FOREIGN KEY (`subscription_plan_id`) REFERENCES `subscription_plans` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `tenants` WRITE;
/*!40000 ALTER TABLE `tenants` DISABLE KEYS */;
INSERT INTO `tenants` VALUES (1,2,NULL,NULL,'onboarding','Demo Microfinance','demo-microfinance','demo-microfinance','Demo Owner','owner@demo.test','+2348000000000','12 Market Road, Lagos',NULL,'#155e75','active','{\"currency\":\"NGN\",\"interest_rate\":5,\"penalty_rate\":1}',0,NULL,NULL,NULL,'inactive',NULL,NULL,NULL,NULL,NULL,'2026-05-22 05:25:24',NULL,'2026-06-08 05:25:24',NULL,'2026-05-08 05:25:24',NULL,NULL,NULL,'2026-05-08 05:25:24','2026-05-10 00:38:51'),(2,1,NULL,NULL,'onboarding','Newkipp','newkipp','newkipp','Polite Chinwike','polite@newkipp.com','08064664220','fytcvjkl;','tenant-logos/LXafZ6SIA9PocyInqpDlxhtPV52EAWLYOaPPOwEP.jpg','#155e75','active','{\"currency\":\"NGN\",\"interest_rate\":\"5\",\"penalty_rate\":\"1\",\"timezone\":\"UTC\",\"mail_mailer\":\"log\",\"mail_host\":null,\"mail_port\":\"465\",\"mail_username\":null,\"mail_password\":null,\"mail_scheme\":null,\"mail_from_address\":\"polite@newkipp.com\",\"mail_from_name\":\"Newkipp\",\"sms_driver\":\"log\",\"sms_gateway_url\":null,\"sms_gateway_method\":\"POST\",\"sms_gateway_token\":null,\"sms_from\":\"Newkipp\",\"sms_to_param\":\"to\",\"sms_message_param\":\"message\",\"sms_sender_param\":\"from\",\"payment_gateway_provider\":\"paystack\",\"paystack_secret_key\":null,\"paystack_base_url\":\"https:\\/\\/api.paystack.co\",\"whatsapp_driver\":\"log\",\"whatsapp_gateway_url\":null,\"whatsapp_gateway_method\":\"POST\",\"whatsapp_gateway_token\":null,\"whatsapp_from\":\"Newkipp\",\"whatsapp_to_param\":\"to\",\"whatsapp_message_param\":\"message\",\"whatsapp_sender_param\":\"from\",\"paystack_preferred_bank\":null,\"account_number_mode\":\"random\",\"account_number_prefixes\":null,\"account_number_serial_next\":null,\"account_number_serial_end\":null,\"monnify_api_key\":null,\"monnify_secret_key\":null,\"monnify_contract_code\":null,\"monnify_base_url\":\"https:\\/\\/api.monnify.com\",\"flutterwave_secret_key\":null,\"flutterwave_base_url\":\"https:\\/\\/api.flutterwave.com\\/v3\",\"providus_client_id\":null,\"providus_client_secret\":null,\"providus_base_url\":null,\"wema_client_id\":null,\"wema_client_secret\":null,\"wema_base_url\":null,\"kyc_provider\":\"local\",\"didit_api_key\":null,\"didit_workflow_id\":null,\"didit_base_url\":\"https:\\/\\/verification.didit.me\"}',0,NULL,NULL,NULL,'inactive',NULL,NULL,NULL,NULL,NULL,'2026-05-22 08:50:34',NULL,'2026-06-22 08:50:34',NULL,'2026-05-08 08:50:34',NULL,NULL,NULL,'2026-05-08 08:49:40','2026-05-10 10:12:16'),(3,2,NULL,NULL,'onboarding','akpaku','akpaku','akpaku','okolo','okolo@newistt.com','08064664222','rrrere',NULL,'#155e75','active','{\"currency\":\"NGN\",\"interest_rate\":5,\"penalty_rate\":1,\"timezone\":\"UTC\"}',0,NULL,NULL,NULL,'inactive',NULL,NULL,NULL,NULL,NULL,'2026-05-23 02:02:14',NULL,'2026-05-23 02:02:14',NULL,'2026-05-09 02:02:14',NULL,NULL,NULL,'2026-05-09 02:02:14','2026-05-10 00:38:51');
/*!40000 ALTER TABLE `tenants` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) unsigned DEFAULT NULL,
  `branch_id` bigint(20) unsigned DEFAULT NULL,
  `role` varchar(255) NOT NULL DEFAULT 'customer',
  `role_profile_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `last_login_at` timestamp NULL DEFAULT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  KEY `users_tenant_id_index` (`tenant_id`),
  KEY `users_branch_id_index` (`branch_id`),
  KEY `users_role_index` (`role`),
  KEY `users_status_index` (`status`),
  KEY `users_role_profile_id_foreign` (`role_profile_id`),
  CONSTRAINT `users_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `users_role_profile_id_foreign` FOREIGN KEY (`role_profile_id`) REFERENCES `role_profiles` (`id`) ON DELETE SET NULL,
  CONSTRAINT `users_tenant_id_foreign` FOREIGN KEY (`tenant_id`) REFERENCES `tenants` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,NULL,NULL,'super_admin',NULL,'Platform Owner','admin@microfinance.test',NULL,NULL,'$2y$12$E0RxIjaSm4z4cLYqNprrCODxrDxIxec3AMpdCGLDTF3.cGqXtrbg.','active','2026-05-14 04:57:39',NULL,'2026-05-08 05:25:24','2026-05-14 04:57:39'),(2,1,1,'tenant_admin',1,'Demo Owner','owner@demo.test',NULL,NULL,'$2y$12$iVhZmF1ygvFcBy4dXdGyKOIJneASPlHh4trADvNeL9wFsdGgAqPi2','active','2026-05-14 04:58:39',NULL,'2026-05-08 05:25:24','2026-05-14 04:58:39'),(3,1,1,'manager',2,'Branch Manager','manager@demo.test',NULL,NULL,'$2y$12$ffSQrSc0bQLi0WrLS9IPG.zO8ciUCiVcfN63AOhkOzfmGLPbWRNMe','active',NULL,NULL,'2026-05-08 05:25:24','2026-05-08 05:25:24'),(4,1,1,'loan_officer',3,'Loan Officer','loan@demo.test',NULL,NULL,'$2y$12$pXfdxbIIvicv5HCpGbyklOckQBFObsXQPxsKMPqJsKrtOa8MmuRIu','active',NULL,NULL,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(5,1,1,'accountant',4,'Accountant','accountant@demo.test',NULL,NULL,'$2y$12$EPAwwHg1eNztz7c8IbLC2.xK.fTTj9kWL3UW1pT5LzCbA..ySXW86','active',NULL,NULL,'2026-05-08 05:25:25','2026-05-08 05:25:25'),(6,2,NULL,'tenant_admin',5,'Polite Chinwike','polite@newkipp.com','08064664220',NULL,'$2y$12$fKaeioFailnPRuvM6tmbW.2JPz37ieGY9SsVaFfxZZDAgBup9HV8u','active','2026-05-14 02:53:18',NULL,'2026-05-08 08:49:41','2026-05-14 02:53:18'),(7,2,2,'customer',NULL,'Emeka Obiozor','emeka@newkipp.com','09087654321',NULL,'$2y$12$GlG7bq4WUBB5juH9W1ayLeGsqLHhTHJtHXOAI2hgvTrMAdCvZuyQu','active','2026-05-08 15:32:48',NULL,'2026-05-08 14:50:08','2026-05-08 15:32:48'),(8,3,NULL,'tenant_admin',9,'okolo','okolo@newistt.com','08064664222',NULL,'$2y$12$QJv8yjYqwyeTGCVRJV3b2uk2Tj6zttr6n5BTJRVEYQsGR0feNvZxi','active',NULL,NULL,'2026-05-09 02:02:14','2026-05-09 02:02:14'),(9,2,2,'customer',NULL,'Ebuka Obi','ebuka@newkipp.com','08064664226',NULL,'$2y$12$yYQ10i6nDzTf0cdK6KJpLOZsRmJuWPhpO18iV64A43vQQ6u87rzzK','active','2026-05-10 09:27:09',NULL,'2026-05-10 02:08:48','2026-05-10 09:27:09'),(10,NULL,NULL,'agent',NULL,'Polite Chinwike','agu@newkipp.com',NULL,NULL,'$2y$12$p9biWvfLXrOE9RMvQiirT.eQFhAwcmwAMfT6tKf0Xa.b.WZ9R/Hma','active','2026-05-10 09:27:00',NULL,'2026-05-10 06:10:29','2026-05-10 09:27:00'),(11,2,2,'customer',NULL,'Amaka Okonkwo','amaka@newkipp.com','08064678787',NULL,'$2y$12$aWvTcttdAMGAqiJusgWl7e1Zn15I6nKrjWLqNMqsgKjrnAPGw5fpu','active','2026-05-10 09:51:45',NULL,'2026-05-10 09:32:30','2026-05-10 09:51:45'),(13,2,NULL,'customer',NULL,'Chidi Okoye','chidi@newkipp.com','08064664210',NULL,'$2y$12$4pcE/CE2LoWILG17PSEyDeWajBlU9mAlj4IQR9Tui0RBSUWcI9G3C','active',NULL,NULL,'2026-05-14 02:55:17','2026-05-14 02:55:17');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-05-14  6:59:38
