-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 30, 2026 at 11:45 AM
-- Server version: 10.11.19-MariaDB-cll-lve
-- PHP Version: 8.4.27

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!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 */;

--
-- Database: `pachaspa_simple_loan_db`
--

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

--
-- Table structure for table `application_fee_payments`
--

CREATE TABLE `application_fee_payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `application_id` bigint(20) UNSIGNED NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `payment_method` enum('cash','mpesa','tigo_pesa','airtel_money','bank','other') NOT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `payment_date` datetime NOT NULL DEFAULT current_timestamp(),
  `received_by` int(10) UNSIGNED DEFAULT NULL,
  `status` enum('confirmed','reversed') NOT NULL DEFAULT 'confirmed',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `application_fee_payments`
--

INSERT INTO `application_fee_payments` (`id`, `application_id`, `amount`, `payment_method`, `reference_no`, `payment_date`, `received_by`, `status`, `notes`, `created_at`) VALUES
(6, 6, 10000.00, 'cash', NULL, '2026-11-16 20:09:12', 1, 'confirmed', NULL, '2026-11-16 17:09:12'),
(7, 7, 10000.00, 'cash', NULL, '2026-11-16 21:07:26', 1, 'confirmed', NULL, '2026-11-16 18:07:26'),
(8, 8, 10000.00, 'cash', NULL, '2026-11-16 21:19:16', 1, 'confirmed', NULL, '2026-11-16 18:19:16'),
(9, 9, 10000.00, 'cash', NULL, '2026-11-17 06:52:11', 1, 'confirmed', NULL, '2026-11-17 03:52:11'),
(10, 10, 10000.00, 'cash', NULL, '2026-11-26 03:54:47', 2, 'confirmed', NULL, '2026-11-26 00:54:47'),
(11, 11, 10000.00, 'cash', NULL, '2026-11-26 04:19:52', 2, 'confirmed', 'Kwaajili ya Business', '2026-11-26 01:19:52'),
(12, 12, 10000.00, 'cash', NULL, '2026-11-26 05:37:37', 2, 'confirmed', NULL, '2026-11-26 02:37:37'),
(13, 13, 10000.00, 'cash', NULL, '2026-11-26 18:38:21', 1, 'confirmed', NULL, '2026-11-26 15:38:21'),
(14, 14, 10000.00, 'cash', NULL, '2026-11-28 08:32:56', 1, 'confirmed', NULL, '2026-11-28 05:32:56');

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

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

CREATE TABLE `audit_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED DEFAULT NULL,
  `action` varchar(100) NOT NULL,
  `table_name` varchar(100) NOT NULL,
  `record_id` varchar(100) DEFAULT NULL,
  `old_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`old_values`)),
  `new_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`new_values`)),
  `ip_address` varchar(45) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `audit_logs` (`id`, `user_id`, `action`, `table_name`, `record_id`, `old_values`, `new_values`, `ip_address`, `created_at`) VALUES
(1, 1, 'insurance_transaction_created', 'insurance_transactions', '1', '[]', '{\"loan_id\":1,\"transaction_type\":\"charge\",\"amount\":1000,\"reference_no\":null,\"status\":\"confirmed\"}', '197.186.18.186', '2026-10-23 21:03:02');

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

--
-- Table structure for table `collection_targets`
--

CREATE TABLE `collection_targets` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `staff_id` int(10) UNSIGNED NOT NULL,
  `target_date` date NOT NULL,
  `target_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `notes` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `customers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_no` varchar(40) NOT NULL,
  `full_name` varchar(180) NOT NULL,
  `gender` enum('male','female','other','unspecified') NOT NULL DEFAULT 'unspecified',
  `date_of_birth` date DEFAULT NULL,
  `phone` varchar(30) NOT NULL,
  `alternative_phone` varchar(30) DEFAULT NULL,
  `email` varchar(150) DEFAULT NULL,
  `national_id` varchar(100) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `occupation` varchar(150) DEFAULT NULL,
  `photo_path` varchar(255) DEFAULT NULL,
  `status` enum('active','inactive','blocked') NOT NULL DEFAULT 'active',
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `customers` (`id`, `customer_no`, `full_name`, `gender`, `date_of_birth`, `phone`, `alternative_phone`, `email`, `national_id`, `address`, `occupation`, `photo_path`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'CUS-20261023-12B8F2', 'Edward Costantino Tinda', 'male', '2026-10-23', '0682531800', '0717180809', 'cmwitinda@yahoo.com', '12345678901234567889900', 'Dsm', 'Engineer', 'uploads/customers/3eba2e4e3ce9ba7edccaa6f145a0b721.jpg', 'active', 1, '2026-10-23 10:53:52', '2026-10-23 10:53:52'),
(2, 'CUS-20261025-A782CF', 'Julius Missokia', 'male', '2000-12-31', '+255798074987', '0717180809', 'juliusmissokia@hotmail.com', '12345678901234567889900', 'Mikocheni', 'Engineer', 'uploads/customers/2f6efb24cf354b289551e67f260e9c22.jpg', 'active', 1, '2026-10-25 19:51:51', '2026-10-25 19:51:51'),
(3, 'CUS-20261027-2E0556', 'Maria Ignas Mkeya', 'female', '2025-06-27', '0798074987', NULL, 'mariamkeya90@gmail.com', '12345678901234567889900', 'MADUKANI-KIPONZELO', 'Engineer', 'uploads/customers/4478cd8e5cd260575279894299130d4f.jpg', 'active', 1, '2026-10-27 07:09:24', '2026-11-26 01:18:52'),
(4, 'CUS-20261030-5FCAFD', 'Christina Tinda', 'female', '2026-10-30', '0798074987', '0798074987', 'ectcommunication@gmail.com', '12345678901234567889900', 'MADUKANI-KIPONZELO', NULL, NULL, 'active', 1, '2026-10-30 05:56:19', '2026-10-30 05:56:19'),
(5, 'CUS-20261030-72C0FE', 'Binuel Tinda', 'male', '2000-02-10', '0798074987', '0798074987', 'binueltinda@gmail.com', '12345678901234567889900', 'KIGOGO-LANDABAR', 'Doctor', NULL, 'active', 1, '2026-10-30 06:44:02', '2026-10-30 06:44:02'),
(6, 'CUS-20261126-AE6A4C', 'IGNASI SIMON MKEYA', 'male', '1970-09-16', '0798074987', '0798074987', 'mariamkeya90@gmail.com', '12345678901234567889900', 'MADUKANI-KIPONZELO', 'Doctor', NULL, 'active', 2, '2026-11-26 00:51:34', '2026-11-26 00:51:34'),
(7, 'CUS-20261126-DE6928', 'SARAH', 'female', '2026-11-26', '0798074987', '0798074987', 'salah@gmail.com', '12345678901234567889900', 'MADUKANI-KIPONZELO', NULL, NULL, 'active', 2, '2026-11-26 02:36:23', '2026-11-26 02:36:23');

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

--
-- Table structure for table `customer_portal_accounts`
--

CREATE TABLE `customer_portal_accounts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `status` enum('active','disabled') NOT NULL DEFAULT 'active',
  `last_login` datetime DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `customer_portal_accounts`
--

INSERT INTO `customer_portal_accounts` (`id`, `customer_id`, `password_hash`, `status`, `last_login`, `created_at`, `updated_at`) VALUES
(1, 1, '$2y$10$Eah3n.qDAflgQkKMt41MWOG/Wspx1q5LPD644Kk6mSaDpxxiAlY0O', 'active', '2026-11-17 06:48:36', '2026-10-24 16:44:12', '2026-11-17 03:48:36'),
(2, 2, '$2y$10$3SaHoBEwZm5AFWhNPmBy3.vW/VS2gm2xazlZ5mfLWeruq07PoIMdK', 'active', '2026-11-16 23:54:15', '2026-10-26 09:37:12', '2026-11-16 20:54:15');

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

--
-- Table structure for table `customer_savings`
--

CREATE TABLE `customer_savings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `loan_id` bigint(20) UNSIGNED DEFAULT NULL,
  `transaction_type` enum('loan_deduction','deposit','withdrawal','adjustment','reversal') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `direction` enum('credit','debit') NOT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `transaction_date` datetime NOT NULL DEFAULT current_timestamp(),
  `processed_by` int(10) UNSIGNED DEFAULT NULL,
  `status` enum('confirmed','reversed') NOT NULL DEFAULT 'confirmed',
  `notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `customer_savings`
--

INSERT INTO `customer_savings` (`id`, `customer_id`, `loan_id`, `transaction_type`, `amount`, `direction`, `reference_no`, `transaction_date`, `processed_by`, `status`, `notes`) VALUES
(2, 2, 6, 'loan_deduction', 10000.00, 'credit', 'DISBURSEMENT-5', '2026-11-16 21:44:45', 1, 'confirmed', '10% savings contribution recorded from confirmed loan disbursement #5'),
(3, 5, 4, 'loan_deduction', 10000.00, 'credit', 'DISBURSEMENT-4', '2026-11-16 21:35:27', 1, 'confirmed', '10% savings contribution recorded from confirmed loan disbursement #4'),
(4, 4, 5, 'loan_deduction', 10000.00, 'credit', 'DISBURSEMENT-6', '2026-11-16 23:43:35', 1, 'confirmed', '10% customer savings contribution from confirmed loan disbursement #6'),
(5, 1, 7, 'loan_deduction', 10000.00, 'credit', 'DISBURSEMENT-7', '2026-11-17 07:08:50', 1, 'confirmed', '10% customer savings contribution from confirmed loan disbursement #7'),
(6, 3, 9, 'loan_deduction', 10000.00, 'credit', NULL, '2026-11-26 00:00:00', NULL, 'confirmed', NULL),
(7, 6, 8, 'loan_deduction', 10000.00, 'credit', NULL, '2026-11-26 00:00:00', NULL, 'confirmed', NULL),
(9, 5, 11, 'loan_deduction', 15000.00, 'credit', 'DISBURSEMENT-11', '2026-11-26 18:40:10', 1, 'confirmed', '10% customer savings contribution from confirmed loan disbursement #11');

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

--
-- Table structure for table `defaulter_followups`
--

CREATE TABLE `defaulter_followups` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `loan_id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `followup_date` datetime NOT NULL DEFAULT current_timestamp(),
  `contact_method` enum('phone','visit','sms','whatsapp','other') NOT NULL DEFAULT 'phone',
  `outcome` enum('contacted','no_answer','promise_to_pay','refused','not_found','other') NOT NULL DEFAULT 'contacted',
  `promised_amount` decimal(15,2) DEFAULT NULL,
  `promised_date` date DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `next_followup_date` date DEFAULT NULL,
  `contacted_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `expenses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `expense_no` varchar(50) NOT NULL,
  `category` varchar(100) NOT NULL,
  `description` text NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `expense_date` date NOT NULL,
  `payment_method` enum('cash','mpesa','tigo_pesa','airtel_money','bank','other') NOT NULL DEFAULT 'cash',
  `reference_no` varchar(100) DEFAULT NULL,
  `receipt_path` varchar(255) DEFAULT NULL,
  `status` enum('pending','approved','rejected','paid','reversed') NOT NULL DEFAULT 'pending',
  `requested_by` int(10) UNSIGNED DEFAULT NULL,
  `approved_by` int(10) UNSIGNED DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `paid_by` int(10) UNSIGNED DEFAULT NULL,
  `paid_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `approval_comment` text DEFAULT NULL,
  `rejection_reason` text DEFAULT NULL,
  `voucher_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `expenses` (`id`, `expense_no`, `category`, `description`, `amount`, `expense_date`, `payment_method`, `reference_no`, `receipt_path`, `status`, `requested_by`, `approved_by`, `approved_at`, `paid_by`, `paid_at`, `created_at`, `approval_comment`, `rejection_reason`, `voucher_no`) VALUES
(1, 'EXP-20261024-FDE13A1F', 'umeme', 'Kwaajili ya ofisini', 5000.00, '2026-10-24', 'cash', '', NULL, 'paid', 1, 1, '2026-10-24 00:27:47', 1, '2026-10-24 11:51:09', '2026-10-23 21:27:30', NULL, NULL, NULL),
(2, 'EXP-20261024-C39497E2', 'Maji', 'Maji kwaajili ya Mgeni wa Ofisi', 500.00, '2026-10-24', 'cash', '', NULL, 'paid', 1, 1, '2026-10-24 11:50:42', 1, '2026-10-24 11:51:25', '2026-10-24 08:50:32', NULL, NULL, NULL);

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

--
-- Table structure for table `insurance_transactions`
--

CREATE TABLE `insurance_transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `loan_id` bigint(20) UNSIGNED NOT NULL,
  `transaction_type` enum('charge','refund','adjustment') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `transaction_date` datetime NOT NULL DEFAULT current_timestamp(),
  `processed_by` int(10) UNSIGNED DEFAULT NULL,
  `status` enum('confirmed','reversed') NOT NULL DEFAULT 'confirmed',
  `notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `loans` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `loan_no` varchar(50) NOT NULL,
  `application_id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `loan_product_id` int(10) UNSIGNED NOT NULL,
  `principal` decimal(15,2) NOT NULL,
  `interest_rate` decimal(7,4) NOT NULL,
  `interest_amount` decimal(15,2) NOT NULL,
  `insurance_rate` decimal(7,4) NOT NULL,
  `insurance_amount` decimal(15,2) NOT NULL,
  `savings_rate` decimal(7,4) NOT NULL,
  `savings_amount` decimal(15,2) NOT NULL,
  `application_fee` decimal(15,2) NOT NULL DEFAULT 10000.00,
  `total_payable` decimal(15,2) NOT NULL,
  `net_disbursement` decimal(15,2) NOT NULL,
  `term_months` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `application_date` date NOT NULL,
  `disbursement_date` date DEFAULT NULL,
  `first_repayment_date` date DEFAULT NULL,
  `maturity_date` date DEFAULT NULL,
  `scheduled_days` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `status` enum('approved','active','overdue','closed','written_off','cancelled') NOT NULL DEFAULT 'approved',
  `approved_by` int(10) UNSIGNED DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `disbursed_by` int(10) UNSIGNED DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `loans` (`id`, `loan_no`, `application_id`, `customer_id`, `loan_product_id`, `principal`, `interest_rate`, `interest_amount`, `insurance_rate`, `insurance_amount`, `savings_rate`, `savings_amount`, `application_fee`, `total_payable`, `net_disbursement`, `term_months`, `application_date`, `disbursement_date`, `first_repayment_date`, `maturity_date`, `scheduled_days`, `status`, `approved_by`, `approved_at`, `disbursed_by`, `notes`, `created_at`) VALUES
(4, 'SL-20261116-2C53F6E70B', 6, 5, 7, 100000.00, 20.0000, 20000.00, 1.0000, 1000.00, 10.0000, 10000.00, 10000.00, 120000.00, 89000.00, 1, '2026-11-16', '2026-11-16', '2026-11-02', '2026-12-17', 40, 'active', 1, '2026-11-16 20:50:16', 1, 'Created from approved application APP-20261116-02A9EB6D', '2026-11-16 17:50:16'),
(5, 'SL-20261116-A68FA0AD36', 7, 4, 7, 100000.00, 20.0000, 20000.00, 1.0000, 1000.00, 10.0000, 10000.00, 10000.00, 120000.00, 89000.00, 1, '2026-11-16', '2026-11-16', '2026-11-12', '2026-12-28', 40, 'active', 1, '2026-11-16 21:12:44', 1, 'Created from approved application APP-20261116-56019C25', '2026-11-16 18:12:44'),
(6, 'LN-20261116-A8AE1A2C', 8, 2, 7, 100000.00, 20.0000, 20000.00, 1.0000, 1000.00, 10.0000, 10000.00, 10000.00, 120000.00, 89000.00, 1, '2026-11-16', '2026-11-16', '2026-11-16', '2026-12-31', 40, 'active', 1, '2026-11-16 21:24:02', 1, 'Approved from application APP-20261116-E750BD82', '2026-11-16 18:24:02'),
(7, 'LN-20261117-B66F656E', 9, 1, 7, 100000.00, 20.0000, 20000.00, 1.0000, 1000.00, 10.0000, 10000.00, 10000.00, 120000.00, 89000.00, 1, '2026-11-17', '2026-11-17', '2026-11-02', '2026-12-17', 40, 'active', 1, '2026-11-17 07:06:03', 1, 'Approved from application APP-20261117-86C3263F', '2026-11-17 04:06:03'),
(8, 'LN-20261126-C40D69FB', 10, 6, 7, 100000.00, 20.0000, 20000.00, 1.0000, 1000.00, 10.0000, 10000.00, 10000.00, 120000.00, 89000.00, 1, '2026-11-26', '2026-11-26', '2026-11-27', '2027-01-12', 40, 'active', 2, '2026-11-26 04:04:05', 2, 'Approved from application APP-20261126-C042BF53', '2026-11-26 01:04:05'),
(9, 'LN-20261126-4313CCAD', 11, 3, 7, 100000.00, 20.0000, 20000.00, 1.0000, 1000.00, 10.0000, 10000.00, 10000.00, 120000.00, 89000.00, 1, '2026-11-26', '2026-11-26', '2026-11-27', '2027-01-12', 40, 'active', 2, '2026-11-26 04:28:35', 2, 'Approved from application APP-20261126-53DBE16C', '2026-11-26 01:28:35'),
(10, 'LN-20261126-ABA2675B', 12, 7, 7, 100000.00, 20.0000, 20000.00, 1.0000, 1000.00, 10.0000, 10000.00, 10000.00, 120000.00, 89000.00, 1, '2026-11-26', '2026-11-26', '2026-11-26', '2027-01-11', 40, 'active', 2, '2026-11-26 05:46:12', 2, 'Approved from application APP-20261126-94E7129B\nReview notes: Form returned', '2026-11-26 02:46:12'),
(11, 'LN-20261126-973466A8', 13, 5, 8, 150000.00, 20.0000, 30000.00, 1.0000, 1500.00, 10.0000, 15000.00, 10000.00, 180000.00, 133500.00, 1, '2026-11-26', '2026-11-26', '2026-11-25', '2027-01-09', 40, 'active', 1, '2026-11-26 18:39:13', 1, 'Approved from application APP-20261126-72D143CB\nReview notes: waiting', '2026-11-26 15:39:13');

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

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

CREATE TABLE `loan_applications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `application_no` varchar(50) NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `loan_product_id` int(10) UNSIGNED NOT NULL,
  `requested_amount` decimal(15,2) NOT NULL,
  `requested_term_months` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `requested_term_days` int(10) UNSIGNED NOT NULL DEFAULT 40,
  `purpose` text DEFAULT NULL,
  `status` enum('pending_fee','pending','under_review','approved','rejected','cancelled','disbursed') NOT NULL DEFAULT 'pending_fee',
  `applied_at` datetime NOT NULL DEFAULT current_timestamp(),
  `reviewed_by` int(10) UNSIGNED DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `review_notes` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `loan_applications` (`id`, `application_no`, `customer_id`, `loan_product_id`, `requested_amount`, `requested_term_months`, `requested_term_days`, `purpose`, `status`, `applied_at`, `reviewed_by`, `reviewed_at`, `review_notes`, `created_by`, `updated_at`) VALUES
(6, 'APP-20261116-02A9EB6D', 5, 7, 100000.00, 1, 40, NULL, 'approved', '2026-11-16 20:08:23', 1, '2026-11-16 20:14:48', '', 1, '2026-11-16 17:14:48'),
(7, 'APP-20261116-56019C25', 4, 7, 100000.00, 1, 40, 'Business', 'approved', '2026-11-16 21:06:57', 1, '2026-11-16 21:12:44', '', 1, '2026-11-16 18:12:44'),
(8, 'APP-20261116-E750BD82', 2, 7, 100000.00, 1, 40, NULL, 'approved', '2026-11-16 21:18:44', 1, '2026-11-16 21:24:02', '', 1, '2026-11-16 18:24:02'),
(9, 'APP-20261117-86C3263F', 1, 7, 100000.00, 1, 40, 'Business', 'approved', '2026-11-17 06:51:16', 1, '2026-11-17 07:06:03', '', 1, '2026-11-17 04:06:03'),
(10, 'APP-20261126-C042BF53', 6, 7, 100000.00, 1, 40, NULL, 'approved', '2026-11-26 03:53:54', 2, '2026-11-26 04:04:05', '', 2, '2026-11-26 01:04:05'),
(11, 'APP-20261126-53DBE16C', 3, 7, 100000.00, 1, 40, 'huhiu', 'approved', '2026-11-26 04:18:16', 2, '2026-11-26 04:28:35', '', 2, '2026-11-26 01:28:35'),
(12, 'APP-20261126-94E7129B', 7, 7, 100000.00, 1, 40, NULL, 'approved', '2026-11-26 05:37:12', 2, '2026-11-26 05:46:12', 'Form returned', 2, '2026-11-26 02:46:12'),
(13, 'APP-20261126-72D143CB', 5, 8, 150000.00, 1, 40, NULL, 'approved', '2026-11-26 18:34:21', 1, '2026-11-26 18:39:13', 'waiting', 1, '2026-11-26 15:39:13'),
(14, 'APP-20261128-894B96E0', 4, 7, 100000.00, 1, 40, 'jhkj', 'pending', '2026-11-28 08:31:28', NULL, NULL, NULL, 1, '2026-11-28 05:32:56');

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

--
-- Table structure for table `loan_collateral`
--

CREATE TABLE `loan_collateral` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `application_id` bigint(20) UNSIGNED NOT NULL,
  `collateral_type` varchar(100) NOT NULL,
  `description` text NOT NULL,
  `estimated_value` decimal(15,2) NOT NULL DEFAULT 0.00,
  `serial_number` varchar(150) DEFAULT NULL,
  `ownership_document` varchar(255) DEFAULT NULL,
  `status` enum('pledged','held','released','forfeited') NOT NULL DEFAULT 'pledged',
  `notes` text DEFAULT NULL,
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `loan_collaterals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `application_id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `collateral_type` enum('motorcycle','vehicle','land','house','equipment','livestock','other') NOT NULL DEFAULT 'other',
  `description` text NOT NULL,
  `owner_name` varchar(180) NOT NULL,
  `estimated_value` decimal(15,2) NOT NULL DEFAULT 0.00,
  `registration_no` varchar(100) DEFAULT NULL,
  `serial_no` varchar(100) DEFAULT NULL,
  `location` text DEFAULT NULL,
  `document_path` varchar(255) DEFAULT NULL,
  `image_path` varchar(255) DEFAULT NULL,
  `verification_status` enum('pending','verified','rejected','released') NOT NULL DEFAULT 'pending',
  `verification_notes` text DEFAULT NULL,
  `verified_by` int(10) UNSIGNED DEFAULT NULL,
  `verified_at` datetime DEFAULT NULL,
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `loan_collaterals` (`id`, `application_id`, `customer_id`, `collateral_type`, `description`, `owner_name`, `estimated_value`, `registration_no`, `serial_no`, `location`, `document_path`, `image_path`, `verification_status`, `verification_notes`, `verified_by`, `verified_at`, `created_by`, `created_at`, `updated_at`) VALUES
(7, 6, 5, 'land', 'klkljp', '', 500000.00, '', '', '', NULL, NULL, 'verified', '', 1, '2026-11-16 21:11:59', 1, '2026-11-16 18:11:32', '2026-11-16 18:11:59'),
(8, 8, 2, 'house', 'jhlkj', 'julius', 20000000.00, '', '', '', NULL, NULL, 'verified', 'jkkj', 1, '2026-11-16 21:23:26', 1, '2026-11-16 18:21:33', '2026-11-16 18:23:26'),
(9, 7, 4, 'house', 'efrytyt', '', 20000000.00, '', '', '', NULL, NULL, 'verified', '', 1, '2026-11-16 23:42:44', 1, '2026-11-16 20:42:19', '2026-11-16 20:42:44'),
(10, 9, 1, 'house', 'House', 'Edward Tinda', 20000000.00, '', '', '', NULL, NULL, 'verified', 'yugyug', 1, '2026-11-17 06:57:15', 1, '2026-11-17 03:55:31', '2026-11-17 03:57:15'),
(11, 10, 6, 'other', 'hggyuguy', 'IGNASI SIMON MKEYA', 300000.00, '', '', '', NULL, NULL, 'verified', '', 2, '2026-11-26 04:24:23', 2, '2026-11-26 00:59:23', '2026-11-26 01:24:23'),
(12, 11, 3, 'house', 'uiuuoip', 'maria mkeya', 2000000.00, '', '', 'Kimara Stopover Kapinga Street', NULL, NULL, 'verified', '', 2, '2026-11-26 04:24:54', 2, '2026-11-26 01:23:49', '2026-11-26 01:24:54'),
(13, 12, 7, 'motorcycle', 'HJHJ', 'SARAH', 2000000.00, '', '', '', NULL, NULL, 'verified', '', 1, '2026-11-26 15:14:35', 2, '2026-11-26 02:41:36', '2026-11-26 12:14:35'),
(14, 13, 5, 'land', 'dfgjnhj', 'Binuel Tinda', 300000.00, '', '', '', NULL, NULL, 'verified', '', 1, '2026-11-26 18:37:16', 1, '2026-11-26 15:35:26', '2026-11-26 15:37:16');

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

--
-- Table structure for table `loan_disbursements`
--

CREATE TABLE `loan_disbursements` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `loan_id` bigint(20) UNSIGNED NOT NULL,
  `principal_amount` decimal(15,2) NOT NULL,
  `insurance_deduction` decimal(15,2) NOT NULL DEFAULT 0.00,
  `savings_deduction` decimal(15,2) NOT NULL DEFAULT 0.00,
  `other_deductions` decimal(15,2) NOT NULL DEFAULT 0.00,
  `net_amount` decimal(15,2) NOT NULL,
  `payment_method` enum('cash','mpesa','tigo_pesa','airtel_money','bank','other') NOT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `disbursement_date` datetime NOT NULL DEFAULT current_timestamp(),
  `disbursed_by` int(10) UNSIGNED DEFAULT NULL,
  `status` enum('confirmed','reversed') NOT NULL DEFAULT 'confirmed',
  `notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `loan_disbursements`
--

INSERT INTO `loan_disbursements` (`id`, `loan_id`, `principal_amount`, `insurance_deduction`, `savings_deduction`, `other_deductions`, `net_amount`, `payment_method`, `reference_no`, `disbursement_date`, `disbursed_by`, `status`, `notes`) VALUES
(4, 4, 100000.00, 1000.00, 10000.00, 0.00, 89000.00, 'cash', NULL, '2026-11-16 21:35:27', 1, 'confirmed', ''),
(5, 6, 100000.00, 1000.00, 10000.00, 0.00, 89000.00, 'cash', NULL, '2026-11-16 21:44:45', 1, 'confirmed', ''),
(6, 5, 100000.00, 1000.00, 10000.00, 0.00, 89000.00, 'cash', NULL, '2026-11-16 23:43:35', 1, 'confirmed', ''),
(7, 7, 100000.00, 1000.00, 10000.00, 0.00, 89000.00, 'cash', NULL, '2026-11-17 07:08:50', 1, 'confirmed', ''),
(8, 8, 100000.00, 1000.00, 10000.00, 0.00, 89000.00, 'cash', '', '2026-11-26 04:07:00', 2, 'confirmed', ''),
(9, 9, 100000.00, 1000.00, 10000.00, 0.00, 89000.00, 'cash', '', '2026-11-26 04:31:00', 2, 'confirmed', ''),
(10, 10, 100000.00, 1000.00, 10000.00, 0.00, 89000.00, 'cash', '', '2026-11-26 05:47:00', 2, 'confirmed', ''),
(11, 11, 150000.00, 1500.00, 15000.00, 0.00, 133500.00, 'cash', NULL, '2026-11-26 18:40:10', 1, 'confirmed', '');

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

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

CREATE TABLE `loan_guarantors` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `application_id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `existing_customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `full_name` varchar(180) NOT NULL,
  `phone` varchar(30) NOT NULL,
  `alternative_phone` varchar(30) DEFAULT NULL,
  `national_id` varchar(100) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `occupation` varchar(150) DEFAULT NULL,
  `relationship_to_borrower` varchar(100) DEFAULT NULL,
  `guarantee_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `consent_status` enum('pending','consented','declined') NOT NULL DEFAULT 'pending',
  `verification_status` enum('pending','verified','rejected') NOT NULL DEFAULT 'pending',
  `verification_notes` text DEFAULT NULL,
  `verified_by` int(10) UNSIGNED DEFAULT NULL,
  `verified_at` datetime DEFAULT NULL,
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `loan_guarantors` (`id`, `application_id`, `customer_id`, `existing_customer_id`, `full_name`, `phone`, `alternative_phone`, `national_id`, `address`, `occupation`, `relationship_to_borrower`, `guarantee_amount`, `consent_status`, `verification_status`, `verification_notes`, `verified_by`, `verified_at`, `created_by`, `created_at`, `updated_at`) VALUES
(5, 6, 5, NULL, 'LUCY SIMON MKEYA', '0798074987', '0798074987', '12345678901234567889900', 'KIGOGO-KATI\r\nKaribu na Shule ya Msingi Kigogo', 'Engineer', 'Mother', 100000.00, 'consented', 'verified', NULL, 1, '2026-11-16 21:08:01', 1, '2026-11-16 17:11:18', '2026-11-16 18:08:01'),
(6, 7, 4, NULL, 'EDWARD TINDA', '0798074987', '0798074987', '12345678901234567889900', 'MADUKANI-KIPONZELO', 'Doctor', 'Father', 0.00, 'consented', 'verified', NULL, 1, '2026-11-16 21:10:34', 1, '2026-11-16 18:08:58', '2026-11-16 18:10:34'),
(7, 8, 2, NULL, 'IGNASI SIMON MKEYA', '0798074987', '0798074987', '12345678901234567889900', 'MADUKANI-KIPONZELO', 'Engineer', 'Grand Father', 0.00, 'consented', 'verified', NULL, 1, '2026-11-17 07:07:50', 1, '2026-11-16 18:22:58', '2026-11-17 04:07:50'),
(8, 9, 1, NULL, 'LUCY SIMON MKEYA', '0798074987', '0798074987', '12345678901234567889900', 'KIGOGO-KATI\r\nKaribu na Shule ya Msingi Kigogo', 'Doctor', 'Wife', 0.00, 'consented', 'verified', NULL, 1, '2026-11-17 07:18:20', 1, '2026-11-17 04:18:10', '2026-11-17 04:18:20'),
(9, 10, 6, 5, 'Binuel Tinda', '0798074987', '0798074987', '12345678901234567889900', 'MADUKANI-KIPONZELO', 'Doctor', 'uncle', 300000.00, 'consented', 'verified', 'tfgfhgg', 2, '2026-11-26 04:02:48', 2, '2026-11-26 01:02:24', '2026-11-26 01:02:48'),
(10, 11, 3, 1, 'EDWARD TINDA', '0798074987', '0798074987', '12345678901234567889900', 'KIGOGO-KATI\r\nKaribu na Shule ya Msingi Kigogo', 'Engineer', 'uncle', 2000000.00, 'consented', 'verified', NULL, 2, '2026-11-26 04:27:19', 2, '2026-11-26 01:27:04', '2026-11-26 01:27:19'),
(11, 12, 7, NULL, 'PROSPER MWITINDA', 'PROSPER MWITINDA', '0798074987', '12345678901234567889900', 'MADUKANI-KIPONZELO', 'Engineer', 'HUSBAND', 2000000.00, 'consented', 'verified', NULL, 2, '2026-11-26 05:44:15', 2, '2026-11-26 02:44:05', '2026-11-26 02:44:15'),
(12, 13, 5, 1, 'EDWARD TINDA', '0798074987', '0798074987', NULL, 'MADUKANI-KIPONZELO', NULL, NULL, 300000.00, 'consented', 'verified', NULL, 1, '2026-11-26 18:36:40', 1, '2026-11-26 15:36:31', '2026-11-26 15:36:40'),
(13, 13, 5, NULL, 'binueldhhjbhj', '0798074987', '0798074987', '12345678901234567889900', 'MADUKANI-KIPONZELO', 'Engineer', 'Mother', 0.00, 'consented', 'verified', NULL, 1, '2026-11-28 08:40:12', 1, '2026-11-28 05:37:26', '2026-11-28 05:40:12');

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

--
-- Table structure for table `loan_penalties`
--

CREATE TABLE `loan_penalties` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `loan_id` bigint(20) UNSIGNED NOT NULL,
  `schedule_id` bigint(20) UNSIGNED NOT NULL,
  `missed_date` date NOT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT 1000.00,
  `amount_paid` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('unpaid','partial','paid','waived','reversed') NOT NULL DEFAULT 'unpaid',
  `assessed_at` datetime NOT NULL DEFAULT current_timestamp(),
  `assessed_by` int(10) UNSIGNED DEFAULT NULL,
  `notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `loan_penalties`
--

INSERT INTO `loan_penalties` (`id`, `loan_id`, `schedule_id`, `missed_date`, `amount`, `amount_paid`, `status`, `assessed_at`, `assessed_by`, `notes`) VALUES
(30, 4, 121, '2026-11-02', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(31, 4, 122, '2026-11-03', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(32, 4, 123, '2026-11-04', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(33, 4, 124, '2026-11-05', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(34, 4, 125, '2026-11-06', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(35, 4, 126, '2026-11-07', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(36, 4, 127, '2026-11-09', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(37, 4, 128, '2026-11-10', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(38, 4, 129, '2026-11-11', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(39, 4, 130, '2026-11-12', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(40, 4, 131, '2026-11-13', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(41, 4, 132, '2026-11-14', 1000.00, 1000.00, 'paid', '2026-11-16 21:49:35', 1, 'Automatically assessed for an overdue scheduled repayment date.'),
(42, 5, 201, '2026-11-12', 1000.00, 1000.00, 'paid', '2026-11-16 23:44:57', 1, 'Automatically assessed when the dashboard was opened.'),
(43, 5, 202, '2026-11-13', 1000.00, 1000.00, 'paid', '2026-11-16 23:44:57', 1, 'Automatically assessed when the dashboard was opened.'),
(44, 5, 203, '2026-11-14', 1000.00, 1000.00, 'paid', '2026-11-16 23:44:57', 1, 'Automatically assessed when the dashboard was opened.'),
(45, 4, 133, '2026-11-16', 1000.00, 1000.00, 'paid', '2026-11-17 00:01:07', 1, 'Automatically assessed when the dashboard was opened.'),
(46, 6, 161, '2026-11-16', 1000.00, 1000.00, 'paid', '2026-11-17 00:01:07', 1, 'Automatically assessed when the dashboard was opened.'),
(47, 5, 204, '2026-11-16', 1000.00, 1000.00, 'paid', '2026-11-17 00:01:07', 1, 'Automatically assessed when the dashboard was opened.'),
(48, 7, 241, '2026-11-02', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(49, 7, 242, '2026-11-03', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(50, 7, 243, '2026-11-04', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(51, 7, 244, '2026-11-05', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(52, 7, 245, '2026-11-06', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(53, 7, 246, '2026-11-07', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(54, 7, 247, '2026-11-09', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(55, 7, 248, '2026-11-10', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(56, 7, 249, '2026-11-11', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(57, 7, 250, '2026-11-12', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(58, 7, 251, '2026-11-13', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(59, 7, 252, '2026-11-14', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(60, 7, 253, '2026-11-16', 1000.00, 1000.00, 'paid', '2026-11-17 07:11:48', 1, 'Automatically assessed when the dashboard was opened.'),
(61, 4, 134, '2026-11-17', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(62, 6, 162, '2026-11-17', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(63, 5, 205, '2026-11-17', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(64, 7, 254, '2026-11-17', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(65, 4, 135, '2026-11-18', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(66, 6, 163, '2026-11-18', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(67, 5, 206, '2026-11-18', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(68, 7, 255, '2026-11-18', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(69, 4, 136, '2026-11-19', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(70, 6, 164, '2026-11-19', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(71, 5, 207, '2026-11-19', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(72, 7, 256, '2026-11-19', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(73, 4, 137, '2026-11-20', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(74, 6, 165, '2026-11-20', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(75, 5, 208, '2026-11-20', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(76, 7, 257, '2026-11-20', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(77, 4, 138, '2026-11-21', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(78, 6, 166, '2026-11-21', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(79, 5, 209, '2026-11-21', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(80, 7, 258, '2026-11-21', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(81, 4, 139, '2026-11-23', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(82, 6, 167, '2026-11-23', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(83, 5, 210, '2026-11-23', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(84, 7, 259, '2026-11-23', 1000.00, 1000.00, 'paid', '2026-11-24 14:48:48', 1, 'Automatically assessed when the dashboard was opened.'),
(85, 4, 140, '2026-11-24', 1000.00, 1000.00, 'paid', '2026-11-25 08:37:44', 1, 'Automatically assessed when the dashboard was opened.'),
(86, 6, 168, '2026-11-24', 1000.00, 1000.00, 'paid', '2026-11-25 08:37:44', 1, 'Automatically assessed when the dashboard was opened.'),
(87, 5, 211, '2026-11-24', 1000.00, 1000.00, 'paid', '2026-11-25 08:37:44', 1, 'Automatically assessed when the dashboard was opened.'),
(88, 7, 260, '2026-11-24', 1000.00, 1000.00, 'paid', '2026-11-25 08:37:44', 1, 'Automatically assessed when the dashboard was opened.'),
(89, 4, 141, '2026-11-25', 1000.00, 1000.00, 'paid', '2026-11-26 03:29:03', 1, 'Automatically assessed when the dashboard was opened.'),
(90, 6, 169, '2026-11-25', 1000.00, 1000.00, 'paid', '2026-11-26 03:29:03', 1, 'Automatically assessed when the dashboard was opened.'),
(91, 5, 212, '2026-11-25', 1000.00, 1000.00, 'paid', '2026-11-26 03:29:03', 1, 'Automatically assessed when the dashboard was opened.'),
(92, 7, 261, '2026-11-25', 1000.00, 1000.00, 'paid', '2026-11-26 03:29:03', 1, 'Automatically assessed when the dashboard was opened.');

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

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

CREATE TABLE `loan_products` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_name` varchar(150) NOT NULL,
  `description` text DEFAULT NULL,
  `min_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `max_amount` decimal(15,2) DEFAULT NULL,
  `minimum_term_months` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `interest_method` enum('flat') NOT NULL DEFAULT 'flat',
  `interest_rate` decimal(7,4) NOT NULL DEFAULT 20.0000,
  `interest_period` enum('entire_term') NOT NULL DEFAULT 'entire_term',
  `insurance_rate` decimal(7,4) NOT NULL DEFAULT 1.0000,
  `savings_rate` decimal(7,4) NOT NULL DEFAULT 2.0000,
  `application_fee` decimal(15,2) NOT NULL DEFAULT 10000.00,
  `penalty_per_missed_day` decimal(15,2) NOT NULL DEFAULT 1000.00,
  `repayment_frequency` enum('daily') NOT NULL DEFAULT 'daily',
  `exclude_sunday` tinyint(1) NOT NULL DEFAULT 1,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `minimum_term_days` int(10) UNSIGNED NOT NULL DEFAULT 30,
  `maximum_term_days` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `loan_products` (`id`, `product_name`, `description`, `min_amount`, `max_amount`, `minimum_term_months`, `interest_method`, `interest_rate`, `interest_period`, `insurance_rate`, `savings_rate`, `application_fee`, `penalty_per_missed_day`, `repayment_frequency`, `exclude_sunday`, `is_active`, `created_at`, `minimum_term_days`, `maximum_term_days`) VALUES
(7, 'Business Loan 1', 'For  Business Starting', 100000.00, 100000.00, 1, 'flat', 20.0000, 'entire_term', 1.0000, 10.0000, 10000.00, 1000.00, 'daily', 1, 1, '2026-11-16 16:58:35', 40, NULL),
(8, 'Business Loan 2', NULL, 150000.00, 150000.00, 1, 'flat', 20.0000, 'entire_term', 1.0000, 10.0000, 10000.00, 1000.00, 'daily', 1, 1, '2026-11-16 17:04:05', 40, NULL),
(9, 'Business Loan 3', NULL, 200000.00, 200000.00, 1, 'flat', 20.0000, 'entire_term', 1.0000, 10.0000, 10000.00, 1000.00, 'daily', 1, 1, '2026-11-16 17:05:36', 48, NULL),
(10, 'Business Loan 4', NULL, 250000.00, 250000.00, 1, 'flat', 20.0000, 'entire_term', 1.0000, 10.0000, 10000.00, 1000.00, 'daily', 1, 1, '2026-11-16 17:06:39', 46, NULL);

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

--
-- Table structure for table `penalty_payments`
--

CREATE TABLE `penalty_payments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `penalty_id` bigint(20) UNSIGNED NOT NULL,
  `receipt_no` varchar(50) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `payment_method` enum('cash','mpesa','bank','tigo_pesa','airtel_money') NOT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `payment_date` datetime NOT NULL DEFAULT current_timestamp(),
  `received_by` int(10) UNSIGNED DEFAULT NULL,
  `status` enum('confirmed','reversed') NOT NULL DEFAULT 'confirmed',
  `notes` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `penalty_payments`
--

INSERT INTO `penalty_payments` (`id`, `penalty_id`, `receipt_no`, `amount`, `payment_method`, `reference_no`, `payment_date`, `received_by`, `status`, `notes`, `created_at`) VALUES
(11, 46, 'PEN-20261117000411-A47016', 1000.00, 'cash', NULL, '2026-11-17 00:04:11', 1, 'confirmed', '', '2026-11-17 00:04:11'),
(12, 60, 'PEN-20261117221547-4B1C43', 1000.00, 'cash', NULL, '2026-11-17 22:15:47', 1, 'confirmed', '', '2026-11-17 22:15:47'),
(13, 65, 'PEN-20261124145229-EC0CF5', 1000.00, 'cash', NULL, '2026-11-24 14:52:29', 1, 'confirmed', '', '2026-11-24 14:52:29'),
(14, 64, 'PEN-20261124145414-6364E6', 1000.00, 'cash', NULL, '2026-11-24 14:54:14', 1, 'confirmed', '', '2026-11-24 14:54:14'),
(15, 67, 'PEN-20261126045239-924C46', 1000.00, 'cash', NULL, '2026-11-26 04:52:39', 1, 'confirmed', '', '2026-11-26 04:52:39');

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

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

CREATE TABLE `permissions` (
  `id` int(10) UNSIGNED NOT NULL,
  `permission_key` varchar(100) NOT NULL,
  `permission_name` varchar(150) NOT NULL,
  `module_name` varchar(100) NOT NULL,
  `description` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `permissions` (`id`, `permission_key`, `permission_name`, `module_name`, `description`) VALUES
(1, 'dashboard.view', 'View Dashboard', 'Dashboard', 'View dashboard'),
(2, 'users.manage', 'Manage Users', 'Administration', 'Manage system users'),
(3, 'roles.manage', 'Manage Roles and Permissions', 'Administration', 'Manage roles and permissions'),
(4, 'customers.view', 'View Customers', 'Customers', 'View customers'),
(5, 'customers.manage', 'Manage Customers', 'Customers', 'Create and edit customers'),
(6, 'loan_products.manage', 'Manage Loan Products', 'Loan Products', 'Manage loan products'),
(7, 'applications.view', 'View Loan Applications', 'Applications', 'View loan applications'),
(8, 'applications.manage', 'Manage Loan Applications', 'Applications', 'Create and review loan applications'),
(9, 'loans.view', 'View Loans', 'Loans', 'View loans'),
(10, 'loans.approve', 'Approve Loans', 'Loans', 'Approve loans'),
(11, 'loans.disburse', 'Disburse Loans', 'Loans', 'Disburse approved loans'),
(12, 'repayments.manage', 'Manage Repayments', 'Repayments', 'Receive repayments'),
(13, 'penalties.manage', 'Manage Penalties', 'Penalties', 'Manage overdue penalties'),
(14, 'savings.view', 'View Customer Savings', 'Savings', 'View customer savings'),
(15, 'expenses.manage', 'Manage Expenses', 'Expenses', 'Record expenses'),
(16, 'reports.view', 'View Reports', 'Reports', 'View reports'),
(17, 'audit.view', 'View Audit Logs', 'Audit', 'View audit history');

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

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

CREATE TABLE `repayments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `receipt_no` varchar(50) NOT NULL,
  `loan_id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `payment_method` enum('cash','mpesa','tigo_pesa','airtel_money','bank','other') NOT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `payment_date` datetime NOT NULL DEFAULT current_timestamp(),
  `received_by` int(10) UNSIGNED DEFAULT NULL,
  `status` enum('confirmed','reversed') NOT NULL DEFAULT 'confirmed',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `repayments` (`id`, `receipt_no`, `loan_id`, `customer_id`, `amount`, `payment_method`, `reference_no`, `payment_date`, `received_by`, `status`, `notes`, `created_at`) VALUES
(35, 'RCP-20261117000230-8C8D25', 6, 2, 3000.00, 'cash', NULL, '2026-11-17 00:02:30', 1, 'confirmed', NULL, '2026-11-16 21:02:30'),
(36, 'RCT-20261117071457-2B5D8F0C', 7, 1, 30000.00, 'cash', NULL, '2026-11-17 07:14:57', 1, 'confirmed', NULL, '2026-11-17 04:14:57'),
(37, 'PNL-20261117-3F38928D', 4, 5, 1000.00, 'cash', '', '2026-11-17 22:14:28', 1, 'confirmed', 'Penalty payment for penalty ID 30, missed repayment date 2026-11-02', '2026-11-17 19:14:28'),
(38, 'RCP-20261124145124-795874', 4, 5, 10000.00, 'cash', NULL, '2026-11-24 14:51:24', 1, 'confirmed', NULL, '2026-11-24 11:51:24'),
(39, 'RCT-20261126043426-264872F5', 4, 5, 60000.00, 'cash', NULL, '2026-11-26 04:34:26', 2, 'confirmed', NULL, '2026-11-26 01:34:26'),
(40, 'RCT-20261126043609-904278B0', 4, 5, 50000.00, 'cash', NULL, '2026-11-26 04:36:09', 2, 'confirmed', NULL, '2026-11-26 01:36:09'),
(41, 'PNL-20261126-BC6142B4', 4, 5, 19000.00, 'cash', '', '2026-11-26 04:51:10', 1, 'confirmed', 'Lump-sum penalty payment allocated to outstanding penalties for loan SL-20261116-2C53F6E70B.', '2026-11-26 01:51:10'),
(42, 'RCT-20261126045850-85ECF740', 7, 1, 90000.00, 'cash', NULL, '2026-11-26 04:58:50', 1, 'confirmed', NULL, '2026-11-26 01:58:50'),
(43, 'PNL-20261126-2FEDE88F', 7, 1, 19000.00, 'cash', '', '2026-11-26 05:00:21', 1, 'confirmed', 'Lump-sum penalty payment allocated to outstanding penalties for loan LN-20261117-B66F656E.', '2026-11-26 02:00:21'),
(44, 'PNL-20261126-D90EDCC2', 5, 4, 11000.00, 'cash', '', '2026-11-26 05:01:05', 1, 'confirmed', 'Lump-sum penalty payment allocated to outstanding penalties for loan SL-20261116-A68FA0AD36.', '2026-11-26 02:01:05'),
(45, 'PNL-20261126-B6474091', 6, 2, 8000.00, 'cash', '', '2026-11-26 05:01:24', 1, 'confirmed', 'Lump-sum penalty payment allocated to outstanding penalties for loan LN-20261116-A8AE1A2C.', '2026-11-26 02:01:24'),
(46, 'RCT-20261126055555-248F8D92', 6, 2, 117000.00, 'cash', NULL, '2026-11-26 05:55:55', 3, 'confirmed', NULL, '2026-11-26 02:55:55'),
(47, 'RCT-20261126152615-192CB9A5', 5, 4, 120000.00, 'cash', NULL, '2026-11-26 15:26:15', 1, 'confirmed', NULL, '2026-11-26 12:26:15'),
(48, 'RCT-20261126183134-9D77C151', 10, 7, 120000.00, 'cash', NULL, '2026-11-26 18:31:34', 1, 'confirmed', NULL, '2026-11-26 15:31:34'),
(49, 'RCT-20261126183210-4E8D0F84', 9, 3, 120000.00, 'cash', NULL, '2026-11-26 18:32:10', 1, 'confirmed', NULL, '2026-11-26 15:32:10'),
(50, 'RCT-20261126183233-641FEC8E', 8, 6, 120000.00, 'cash', NULL, '2026-11-26 18:32:33', 1, 'confirmed', NULL, '2026-11-26 15:32:33'),
(51, 'RCT-20261126184645-4B634F14', 11, 5, 30000.00, 'cash', NULL, '2026-11-26 18:46:45', 1, 'confirmed', NULL, '2026-11-26 15:46:45'),
(52, 'RCT-20261127115742-A9B9CF30', 11, 5, 20000.00, 'cash', NULL, '2026-11-27 11:57:42', 1, 'confirmed', NULL, '2026-11-27 08:57:42'),
(53, 'RCT-20261128072139-846F954D', 11, 5, 9800.00, 'cash', NULL, '2026-11-28 07:21:39', 1, 'confirmed', NULL, '2026-11-28 04:21:39');

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

--
-- Table structure for table `repayment_allocations`
--

CREATE TABLE `repayment_allocations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `repayment_id` bigint(20) UNSIGNED NOT NULL,
  `schedule_id` bigint(20) UNSIGNED DEFAULT NULL,
  `penalty_id` bigint(20) UNSIGNED DEFAULT NULL,
  `component` enum('principal','interest','insurance','savings','penalty','other') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `repayment_allocations`
--

INSERT INTO `repayment_allocations` (`id`, `repayment_id`, `schedule_id`, `penalty_id`, `component`, `amount`, `created_at`) VALUES
(267, 35, 161, NULL, 'interest', 500.00, '2026-11-16 21:02:30'),
(268, 35, 161, NULL, 'principal', 2500.00, '2026-11-16 21:02:30'),
(269, 36, 241, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(270, 36, 241, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(271, 36, 242, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(272, 36, 242, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(273, 36, 243, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(274, 36, 243, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(275, 36, 244, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(276, 36, 244, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(277, 36, 245, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(278, 36, 245, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(279, 36, 246, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(280, 36, 246, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(281, 36, 247, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(282, 36, 247, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(283, 36, 248, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(284, 36, 248, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(285, 36, 249, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(286, 36, 249, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(287, 36, 250, NULL, 'principal', 2500.00, '2026-11-17 04:14:57'),
(288, 36, 250, NULL, 'interest', 500.00, '2026-11-17 04:14:57'),
(289, 37, 121, 30, 'penalty', 1000.00, '2026-11-17 19:14:28'),
(290, 38, 121, NULL, 'interest', 500.00, '2026-11-24 11:51:24'),
(291, 38, 121, NULL, 'principal', 2500.00, '2026-11-24 11:51:24'),
(292, 38, 122, NULL, 'interest', 500.00, '2026-11-24 11:51:24'),
(293, 38, 122, NULL, 'principal', 2500.00, '2026-11-24 11:51:24'),
(294, 38, 123, NULL, 'interest', 500.00, '2026-11-24 11:51:24'),
(295, 38, 123, NULL, 'principal', 2500.00, '2026-11-24 11:51:24'),
(296, 38, 124, NULL, 'interest', 500.00, '2026-11-24 11:51:24'),
(297, 38, 124, NULL, 'principal', 500.00, '2026-11-24 11:51:24'),
(298, 39, 124, NULL, 'principal', 2000.00, '2026-11-26 01:34:26'),
(299, 39, 125, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(300, 39, 125, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(301, 39, 126, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(302, 39, 126, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(303, 39, 127, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(304, 39, 127, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(305, 39, 128, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(306, 39, 128, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(307, 39, 129, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(308, 39, 129, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(309, 39, 130, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(310, 39, 130, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(311, 39, 131, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(312, 39, 131, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(313, 39, 132, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(314, 39, 132, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(315, 39, 133, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(316, 39, 133, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(317, 39, 134, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(318, 39, 134, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(319, 39, 135, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(320, 39, 135, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(321, 39, 136, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(322, 39, 136, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(323, 39, 137, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(324, 39, 137, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(325, 39, 138, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(326, 39, 138, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(327, 39, 139, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(328, 39, 139, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(329, 39, 140, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(330, 39, 140, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(331, 39, 141, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(332, 39, 141, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(333, 39, 142, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(334, 39, 142, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(335, 39, 143, NULL, 'principal', 2500.00, '2026-11-26 01:34:26'),
(336, 39, 143, NULL, 'interest', 500.00, '2026-11-26 01:34:26'),
(337, 39, 144, NULL, 'principal', 1000.00, '2026-11-26 01:34:26'),
(338, 40, 144, NULL, 'principal', 1500.00, '2026-11-26 01:36:09'),
(339, 40, 144, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(340, 40, 145, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(341, 40, 145, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(342, 40, 146, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(343, 40, 146, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(344, 40, 147, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(345, 40, 147, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(346, 40, 148, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(347, 40, 148, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(348, 40, 149, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(349, 40, 149, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(350, 40, 150, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(351, 40, 150, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(352, 40, 151, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(353, 40, 151, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(354, 40, 152, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(355, 40, 152, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(356, 40, 153, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(357, 40, 153, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(358, 40, 154, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(359, 40, 154, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(360, 40, 155, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(361, 40, 155, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(362, 40, 156, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(363, 40, 156, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(364, 40, 157, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(365, 40, 157, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(366, 40, 158, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(367, 40, 158, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(368, 40, 159, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(369, 40, 159, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(370, 40, 160, NULL, 'principal', 2500.00, '2026-11-26 01:36:09'),
(371, 40, 160, NULL, 'interest', 500.00, '2026-11-26 01:36:09'),
(372, 41, 122, 31, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(373, 41, 123, 32, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(374, 41, 124, 33, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(375, 41, 125, 34, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(376, 41, 126, 35, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(377, 41, 127, 36, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(378, 41, 128, 37, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(379, 41, 129, 38, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(380, 41, 130, 39, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(381, 41, 131, 40, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(382, 41, 132, 41, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(383, 41, 133, 45, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(384, 41, 134, 61, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(385, 41, 136, 69, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(386, 41, 137, 73, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(387, 41, 138, 77, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(388, 41, 139, 81, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(389, 41, 140, 85, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(390, 41, 141, 89, 'penalty', 1000.00, '2026-11-26 01:51:10'),
(391, 42, 251, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(392, 42, 251, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(393, 42, 252, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(394, 42, 252, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(395, 42, 253, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(396, 42, 253, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(397, 42, 254, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(398, 42, 254, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(399, 42, 255, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(400, 42, 255, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(401, 42, 256, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(402, 42, 256, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(403, 42, 257, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(404, 42, 257, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(405, 42, 258, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(406, 42, 258, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(407, 42, 259, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(408, 42, 259, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(409, 42, 260, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(410, 42, 260, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(411, 42, 261, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(412, 42, 261, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(413, 42, 262, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(414, 42, 262, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(415, 42, 263, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(416, 42, 263, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(417, 42, 264, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(418, 42, 264, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(419, 42, 265, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(420, 42, 265, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(421, 42, 266, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(422, 42, 266, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(423, 42, 267, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(424, 42, 267, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(425, 42, 268, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(426, 42, 268, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(427, 42, 269, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(428, 42, 269, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(429, 42, 270, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(430, 42, 270, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(431, 42, 271, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(432, 42, 271, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(433, 42, 272, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(434, 42, 272, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(435, 42, 273, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(436, 42, 273, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(437, 42, 274, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(438, 42, 274, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(439, 42, 275, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(440, 42, 275, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(441, 42, 276, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(442, 42, 276, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(443, 42, 277, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(444, 42, 277, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(445, 42, 278, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(446, 42, 278, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(447, 42, 279, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(448, 42, 279, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(449, 42, 280, NULL, 'principal', 2500.00, '2026-11-26 01:58:50'),
(450, 42, 280, NULL, 'interest', 500.00, '2026-11-26 01:58:50'),
(451, 43, 241, 48, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(452, 43, 242, 49, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(453, 43, 243, 50, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(454, 43, 244, 51, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(455, 43, 245, 52, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(456, 43, 246, 53, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(457, 43, 247, 54, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(458, 43, 248, 55, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(459, 43, 249, 56, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(460, 43, 250, 57, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(461, 43, 251, 58, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(462, 43, 252, 59, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(463, 43, 255, 68, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(464, 43, 256, 72, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(465, 43, 257, 76, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(466, 43, 258, 80, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(467, 43, 259, 84, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(468, 43, 260, 88, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(469, 43, 261, 92, 'penalty', 1000.00, '2026-11-26 02:00:21'),
(470, 44, 201, 42, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(471, 44, 202, 43, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(472, 44, 203, 44, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(473, 44, 204, 47, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(474, 44, 205, 63, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(475, 44, 207, 71, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(476, 44, 208, 75, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(477, 44, 209, 79, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(478, 44, 210, 83, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(479, 44, 211, 87, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(480, 44, 212, 91, 'penalty', 1000.00, '2026-11-26 02:01:05'),
(481, 45, 162, 62, 'penalty', 1000.00, '2026-11-26 02:01:24'),
(482, 45, 163, 66, 'penalty', 1000.00, '2026-11-26 02:01:24'),
(483, 45, 164, 70, 'penalty', 1000.00, '2026-11-26 02:01:24'),
(484, 45, 165, 74, 'penalty', 1000.00, '2026-11-26 02:01:24'),
(485, 45, 166, 78, 'penalty', 1000.00, '2026-11-26 02:01:24'),
(486, 45, 167, 82, 'penalty', 1000.00, '2026-11-26 02:01:24'),
(487, 45, 168, 86, 'penalty', 1000.00, '2026-11-26 02:01:24'),
(488, 45, 169, 90, 'penalty', 1000.00, '2026-11-26 02:01:24'),
(489, 46, 162, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(490, 46, 162, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(491, 46, 163, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(492, 46, 163, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(493, 46, 164, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(494, 46, 164, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(495, 46, 165, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(496, 46, 165, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(497, 46, 166, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(498, 46, 166, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(499, 46, 167, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(500, 46, 167, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(501, 46, 168, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(502, 46, 168, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(503, 46, 169, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(504, 46, 169, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(505, 46, 170, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(506, 46, 170, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(507, 46, 171, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(508, 46, 171, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(509, 46, 172, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(510, 46, 172, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(511, 46, 173, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(512, 46, 173, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(513, 46, 174, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(514, 46, 174, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(515, 46, 175, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(516, 46, 175, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(517, 46, 176, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(518, 46, 176, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(519, 46, 177, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(520, 46, 177, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(521, 46, 178, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(522, 46, 178, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(523, 46, 179, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(524, 46, 179, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(525, 46, 180, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(526, 46, 180, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(527, 46, 181, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(528, 46, 181, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(529, 46, 182, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(530, 46, 182, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(531, 46, 183, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(532, 46, 183, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(533, 46, 184, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(534, 46, 184, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(535, 46, 185, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(536, 46, 185, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(537, 46, 186, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(538, 46, 186, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(539, 46, 187, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(540, 46, 187, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(541, 46, 188, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(542, 46, 188, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(543, 46, 189, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(544, 46, 189, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(545, 46, 190, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(546, 46, 190, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(547, 46, 191, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(548, 46, 191, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(549, 46, 192, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(550, 46, 192, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(551, 46, 193, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(552, 46, 193, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(553, 46, 194, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(554, 46, 194, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(555, 46, 195, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(556, 46, 195, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(557, 46, 196, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(558, 46, 196, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(559, 46, 197, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(560, 46, 197, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(561, 46, 198, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(562, 46, 198, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(563, 46, 199, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(564, 46, 199, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(565, 46, 200, NULL, 'principal', 2500.00, '2026-11-26 02:55:55'),
(566, 46, 200, NULL, 'interest', 500.00, '2026-11-26 02:55:55'),
(567, 47, 201, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(568, 47, 201, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(569, 47, 202, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(570, 47, 202, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(571, 47, 203, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(572, 47, 203, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(573, 47, 204, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(574, 47, 204, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(575, 47, 205, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(576, 47, 205, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(577, 47, 206, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(578, 47, 206, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(579, 47, 207, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(580, 47, 207, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(581, 47, 208, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(582, 47, 208, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(583, 47, 209, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(584, 47, 209, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(585, 47, 210, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(586, 47, 210, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(587, 47, 211, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(588, 47, 211, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(589, 47, 212, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(590, 47, 212, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(591, 47, 213, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(592, 47, 213, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(593, 47, 214, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(594, 47, 214, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(595, 47, 215, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(596, 47, 215, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(597, 47, 216, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(598, 47, 216, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(599, 47, 217, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(600, 47, 217, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(601, 47, 218, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(602, 47, 218, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(603, 47, 219, NULL, 'principal', 2500.00, '2026-11-26 12:26:15'),
(604, 47, 219, NULL, 'interest', 500.00, '2026-11-26 12:26:15'),
(605, 47, 220, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(606, 47, 220, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(607, 47, 221, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(608, 47, 221, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(609, 47, 222, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(610, 47, 222, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(611, 47, 223, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(612, 47, 223, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(613, 47, 224, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(614, 47, 224, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(615, 47, 225, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(616, 47, 225, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(617, 47, 226, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(618, 47, 226, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(619, 47, 227, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(620, 47, 227, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(621, 47, 228, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(622, 47, 228, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(623, 47, 229, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(624, 47, 229, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(625, 47, 230, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(626, 47, 230, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(627, 47, 231, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(628, 47, 231, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(629, 47, 232, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(630, 47, 232, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(631, 47, 233, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(632, 47, 233, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(633, 47, 234, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(634, 47, 234, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(635, 47, 235, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(636, 47, 235, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(637, 47, 236, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(638, 47, 236, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(639, 47, 237, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(640, 47, 237, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(641, 47, 238, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(642, 47, 238, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(643, 47, 239, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(644, 47, 239, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(645, 47, 240, NULL, 'principal', 2500.00, '2026-11-26 12:26:16'),
(646, 47, 240, NULL, 'interest', 500.00, '2026-11-26 12:26:16'),
(647, 48, 361, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(648, 48, 361, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(649, 48, 362, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(650, 48, 362, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(651, 48, 363, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(652, 48, 363, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(653, 48, 364, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(654, 48, 364, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(655, 48, 365, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(656, 48, 365, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(657, 48, 366, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(658, 48, 366, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(659, 48, 367, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(660, 48, 367, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(661, 48, 368, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(662, 48, 368, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(663, 48, 369, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(664, 48, 369, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(665, 48, 370, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(666, 48, 370, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(667, 48, 371, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(668, 48, 371, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(669, 48, 372, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(670, 48, 372, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(671, 48, 373, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(672, 48, 373, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(673, 48, 374, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(674, 48, 374, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(675, 48, 375, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(676, 48, 375, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(677, 48, 376, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(678, 48, 376, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(679, 48, 377, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(680, 48, 377, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(681, 48, 378, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(682, 48, 378, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(683, 48, 379, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(684, 48, 379, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(685, 48, 380, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(686, 48, 380, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(687, 48, 381, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(688, 48, 381, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(689, 48, 382, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(690, 48, 382, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(691, 48, 383, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(692, 48, 383, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(693, 48, 384, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(694, 48, 384, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(695, 48, 385, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(696, 48, 385, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(697, 48, 386, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(698, 48, 386, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(699, 48, 387, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(700, 48, 387, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(701, 48, 388, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(702, 48, 388, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(703, 48, 389, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(704, 48, 389, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(705, 48, 390, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(706, 48, 390, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(707, 48, 391, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(708, 48, 391, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(709, 48, 392, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(710, 48, 392, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(711, 48, 393, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(712, 48, 393, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(713, 48, 394, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(714, 48, 394, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(715, 48, 395, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(716, 48, 395, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(717, 48, 396, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(718, 48, 396, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(719, 48, 397, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(720, 48, 397, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(721, 48, 398, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(722, 48, 398, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(723, 48, 399, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(724, 48, 399, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(725, 48, 400, NULL, 'principal', 2500.00, '2026-11-26 15:31:34'),
(726, 48, 400, NULL, 'interest', 500.00, '2026-11-26 15:31:34'),
(727, 49, 321, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(728, 49, 321, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(729, 49, 322, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(730, 49, 322, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(731, 49, 323, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(732, 49, 323, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(733, 49, 324, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(734, 49, 324, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(735, 49, 325, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(736, 49, 325, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(737, 49, 326, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(738, 49, 326, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(739, 49, 327, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(740, 49, 327, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(741, 49, 328, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(742, 49, 328, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(743, 49, 329, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(744, 49, 329, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(745, 49, 330, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(746, 49, 330, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(747, 49, 331, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(748, 49, 331, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(749, 49, 332, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(750, 49, 332, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(751, 49, 333, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(752, 49, 333, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(753, 49, 334, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(754, 49, 334, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(755, 49, 335, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(756, 49, 335, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(757, 49, 336, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(758, 49, 336, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(759, 49, 337, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(760, 49, 337, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(761, 49, 338, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(762, 49, 338, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(763, 49, 339, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(764, 49, 339, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(765, 49, 340, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(766, 49, 340, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(767, 49, 341, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(768, 49, 341, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(769, 49, 342, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(770, 49, 342, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(771, 49, 343, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(772, 49, 343, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(773, 49, 344, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(774, 49, 344, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(775, 49, 345, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(776, 49, 345, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(777, 49, 346, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(778, 49, 346, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(779, 49, 347, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(780, 49, 347, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(781, 49, 348, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(782, 49, 348, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(783, 49, 349, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(784, 49, 349, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(785, 49, 350, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(786, 49, 350, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(787, 49, 351, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(788, 49, 351, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(789, 49, 352, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(790, 49, 352, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(791, 49, 353, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(792, 49, 353, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(793, 49, 354, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(794, 49, 354, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(795, 49, 355, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(796, 49, 355, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(797, 49, 356, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(798, 49, 356, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(799, 49, 357, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(800, 49, 357, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(801, 49, 358, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(802, 49, 358, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(803, 49, 359, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(804, 49, 359, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(805, 49, 360, NULL, 'principal', 2500.00, '2026-11-26 15:32:10'),
(806, 49, 360, NULL, 'interest', 500.00, '2026-11-26 15:32:10'),
(807, 50, 281, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(808, 50, 281, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(809, 50, 282, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(810, 50, 282, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(811, 50, 283, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(812, 50, 283, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(813, 50, 284, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(814, 50, 284, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(815, 50, 285, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(816, 50, 285, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(817, 50, 286, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(818, 50, 286, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(819, 50, 287, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(820, 50, 287, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(821, 50, 288, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(822, 50, 288, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(823, 50, 289, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(824, 50, 289, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(825, 50, 290, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(826, 50, 290, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(827, 50, 291, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(828, 50, 291, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(829, 50, 292, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(830, 50, 292, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(831, 50, 293, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(832, 50, 293, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(833, 50, 294, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(834, 50, 294, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(835, 50, 295, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(836, 50, 295, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(837, 50, 296, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(838, 50, 296, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(839, 50, 297, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(840, 50, 297, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(841, 50, 298, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(842, 50, 298, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(843, 50, 299, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(844, 50, 299, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(845, 50, 300, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(846, 50, 300, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(847, 50, 301, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(848, 50, 301, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(849, 50, 302, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(850, 50, 302, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(851, 50, 303, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(852, 50, 303, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(853, 50, 304, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(854, 50, 304, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(855, 50, 305, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(856, 50, 305, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(857, 50, 306, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(858, 50, 306, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(859, 50, 307, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(860, 50, 307, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(861, 50, 308, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(862, 50, 308, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(863, 50, 309, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(864, 50, 309, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(865, 50, 310, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(866, 50, 310, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(867, 50, 311, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(868, 50, 311, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(869, 50, 312, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(870, 50, 312, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(871, 50, 313, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(872, 50, 313, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(873, 50, 314, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(874, 50, 314, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(875, 50, 315, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(876, 50, 315, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(877, 50, 316, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(878, 50, 316, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(879, 50, 317, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(880, 50, 317, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(881, 50, 318, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(882, 50, 318, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(883, 50, 319, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(884, 50, 319, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(885, 50, 320, NULL, 'principal', 2500.00, '2026-11-26 15:32:33'),
(886, 50, 320, NULL, 'interest', 500.00, '2026-11-26 15:32:33'),
(887, 51, 401, NULL, 'principal', 3750.00, '2026-11-26 15:46:45'),
(888, 51, 401, NULL, 'interest', 750.00, '2026-11-26 15:46:45'),
(889, 51, 402, NULL, 'principal', 3750.00, '2026-11-26 15:46:45'),
(890, 51, 402, NULL, 'interest', 750.00, '2026-11-26 15:46:45'),
(891, 51, 403, NULL, 'principal', 3750.00, '2026-11-26 15:46:45'),
(892, 51, 403, NULL, 'interest', 750.00, '2026-11-26 15:46:45'),
(893, 51, 404, NULL, 'principal', 3750.00, '2026-11-26 15:46:45'),
(894, 51, 404, NULL, 'interest', 750.00, '2026-11-26 15:46:45'),
(895, 51, 405, NULL, 'principal', 3750.00, '2026-11-26 15:46:45'),
(896, 51, 405, NULL, 'interest', 750.00, '2026-11-26 15:46:45'),
(897, 51, 406, NULL, 'principal', 3750.00, '2026-11-26 15:46:45'),
(898, 51, 406, NULL, 'interest', 750.00, '2026-11-26 15:46:45'),
(899, 51, 407, NULL, 'principal', 3000.00, '2026-11-26 15:46:45'),
(900, 52, 407, NULL, 'principal', 750.00, '2026-11-27 08:57:42'),
(901, 52, 407, NULL, 'interest', 750.00, '2026-11-27 08:57:42'),
(902, 52, 408, NULL, 'principal', 3750.00, '2026-11-27 08:57:42'),
(903, 52, 408, NULL, 'interest', 750.00, '2026-11-27 08:57:42'),
(904, 52, 409, NULL, 'principal', 3750.00, '2026-11-27 08:57:42'),
(905, 52, 409, NULL, 'interest', 750.00, '2026-11-27 08:57:42'),
(906, 52, 410, NULL, 'principal', 3750.00, '2026-11-27 08:57:42'),
(907, 52, 410, NULL, 'interest', 750.00, '2026-11-27 08:57:42'),
(908, 52, 411, NULL, 'principal', 3750.00, '2026-11-27 08:57:42'),
(909, 52, 411, NULL, 'interest', 750.00, '2026-11-27 08:57:42'),
(910, 52, 412, NULL, 'principal', 500.00, '2026-11-27 08:57:42'),
(911, 53, 412, NULL, 'principal', 3250.00, '2026-11-28 04:21:39'),
(912, 53, 412, NULL, 'interest', 750.00, '2026-11-28 04:21:39'),
(913, 53, 413, NULL, 'principal', 3750.00, '2026-11-28 04:21:39'),
(914, 53, 413, NULL, 'interest', 750.00, '2026-11-28 04:21:39'),
(915, 53, 414, NULL, 'principal', 1300.00, '2026-11-28 04:21:39');

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

--
-- Table structure for table `repayment_schedule`
--

CREATE TABLE `repayment_schedule` (
  `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(15,2) NOT NULL DEFAULT 0.00,
  `interest_due` decimal(15,2) NOT NULL DEFAULT 0.00,
  `total_due` decimal(15,2) NOT NULL,
  `principal_paid` decimal(15,2) NOT NULL DEFAULT 0.00,
  `interest_paid` decimal(15,2) NOT NULL DEFAULT 0.00,
  `status` enum('pending','partial','paid','overdue','waived','Penalty') NOT NULL DEFAULT 'pending',
  `paid_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `repayment_schedule`
--

INSERT INTO `repayment_schedule` (`id`, `loan_id`, `installment_no`, `due_date`, `principal_due`, `interest_due`, `total_due`, `principal_paid`, `interest_paid`, `status`, `paid_at`, `created_at`) VALUES
(121, 4, 1, '2026-11-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-24 14:51:24', '2026-11-16 18:37:42'),
(122, 4, 2, '2026-11-03', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-24 14:51:24', '2026-11-16 18:37:42'),
(123, 4, 3, '2026-11-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-24 14:51:24', '2026-11-16 18:37:42'),
(124, 4, 4, '2026-11-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(125, 4, 5, '2026-11-06', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(126, 4, 6, '2026-11-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(127, 4, 7, '2026-11-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(128, 4, 8, '2026-11-10', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(129, 4, 9, '2026-11-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(130, 4, 10, '2026-11-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(131, 4, 11, '2026-11-13', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(132, 4, 12, '2026-11-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(133, 4, 13, '2026-11-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(134, 4, 14, '2026-11-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(135, 4, 15, '2026-11-18', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(136, 4, 16, '2026-11-19', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(137, 4, 17, '2026-11-20', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(138, 4, 18, '2026-11-21', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(139, 4, 19, '2026-11-23', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(140, 4, 20, '2026-11-24', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(141, 4, 21, '2026-11-25', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(142, 4, 22, '2026-11-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(143, 4, 23, '2026-11-27', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:34:26', '2026-11-16 18:37:42'),
(144, 4, 24, '2026-11-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(145, 4, 25, '2026-11-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(146, 4, 26, '2026-12-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(147, 4, 27, '2026-12-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(148, 4, 28, '2026-12-03', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(149, 4, 29, '2026-12-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(150, 4, 30, '2026-12-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(151, 4, 31, '2026-12-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(152, 4, 32, '2026-12-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(153, 4, 33, '2026-12-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(154, 4, 34, '2026-12-10', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(155, 4, 35, '2026-12-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(156, 4, 36, '2026-12-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(157, 4, 37, '2026-12-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(158, 4, 38, '2026-12-15', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(159, 4, 39, '2026-12-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(160, 4, 40, '2026-12-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:36:09', '2026-11-16 18:37:42'),
(161, 6, 1, '2026-11-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 00:02:30', '2026-11-16 18:46:46'),
(162, 6, 2, '2026-11-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(163, 6, 3, '2026-11-18', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(164, 6, 4, '2026-11-19', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(165, 6, 5, '2026-11-20', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(166, 6, 6, '2026-11-21', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(167, 6, 7, '2026-11-23', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(168, 6, 8, '2026-11-24', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(169, 6, 9, '2026-11-25', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(170, 6, 10, '2026-11-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(171, 6, 11, '2026-11-27', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(172, 6, 12, '2026-11-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(173, 6, 13, '2026-11-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(174, 6, 14, '2026-12-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(175, 6, 15, '2026-12-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(176, 6, 16, '2026-12-03', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(177, 6, 17, '2026-12-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(178, 6, 18, '2026-12-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(179, 6, 19, '2026-12-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(180, 6, 20, '2026-12-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(181, 6, 21, '2026-12-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(182, 6, 22, '2026-12-10', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(183, 6, 23, '2026-12-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(184, 6, 24, '2026-12-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(185, 6, 25, '2026-12-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(186, 6, 26, '2026-12-15', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(187, 6, 27, '2026-12-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(188, 6, 28, '2026-12-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(189, 6, 29, '2026-12-18', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(190, 6, 30, '2026-12-19', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(191, 6, 31, '2026-12-21', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(192, 6, 32, '2026-12-22', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(193, 6, 33, '2026-12-23', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(194, 6, 34, '2026-12-24', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(195, 6, 35, '2026-12-25', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(196, 6, 36, '2026-12-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(197, 6, 37, '2026-12-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(198, 6, 38, '2026-12-29', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(199, 6, 39, '2026-12-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(200, 6, 40, '2026-12-31', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 05:55:55', '2026-11-16 18:46:46'),
(201, 5, 1, '2026-11-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(202, 5, 2, '2026-11-13', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(203, 5, 3, '2026-11-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(204, 5, 4, '2026-11-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(205, 5, 5, '2026-11-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(206, 5, 6, '2026-11-18', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(207, 5, 7, '2026-11-19', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(208, 5, 8, '2026-11-20', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(209, 5, 9, '2026-11-21', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(210, 5, 10, '2026-11-23', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(211, 5, 11, '2026-11-24', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(212, 5, 12, '2026-11-25', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(213, 5, 13, '2026-11-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(214, 5, 14, '2026-11-27', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(215, 5, 15, '2026-11-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(216, 5, 16, '2026-11-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(217, 5, 17, '2026-12-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(218, 5, 18, '2026-12-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(219, 5, 19, '2026-12-03', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(220, 5, 20, '2026-12-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(221, 5, 21, '2026-12-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(222, 5, 22, '2026-12-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(223, 5, 23, '2026-12-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(224, 5, 24, '2026-12-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(225, 5, 25, '2026-12-10', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(226, 5, 26, '2026-12-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(227, 5, 27, '2026-12-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(228, 5, 28, '2026-12-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(229, 5, 29, '2026-12-15', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(230, 5, 30, '2026-12-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(231, 5, 31, '2026-12-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(232, 5, 32, '2026-12-18', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(233, 5, 33, '2026-12-19', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(234, 5, 34, '2026-12-21', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(235, 5, 35, '2026-12-22', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(236, 5, 36, '2026-12-23', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(237, 5, 37, '2026-12-24', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(238, 5, 38, '2026-12-25', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(239, 5, 39, '2026-12-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(240, 5, 40, '2026-12-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 15:26:15', '2026-11-16 20:44:35'),
(241, 7, 1, '2026-11-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(242, 7, 2, '2026-11-03', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(243, 7, 3, '2026-11-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(244, 7, 4, '2026-11-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(245, 7, 5, '2026-11-06', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(246, 7, 6, '2026-11-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(247, 7, 7, '2026-11-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(248, 7, 8, '2026-11-10', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(249, 7, 9, '2026-11-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(250, 7, 10, '2026-11-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-17 07:14:57', '2026-11-17 04:10:52'),
(251, 7, 11, '2026-11-13', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(252, 7, 12, '2026-11-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(253, 7, 13, '2026-11-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(254, 7, 14, '2026-11-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(255, 7, 15, '2026-11-18', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(256, 7, 16, '2026-11-19', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(257, 7, 17, '2026-11-20', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(258, 7, 18, '2026-11-21', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(259, 7, 19, '2026-11-23', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(260, 7, 20, '2026-11-24', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(261, 7, 21, '2026-11-25', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(262, 7, 22, '2026-11-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(263, 7, 23, '2026-11-27', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(264, 7, 24, '2026-11-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(265, 7, 25, '2026-11-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(266, 7, 26, '2026-12-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(267, 7, 27, '2026-12-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(268, 7, 28, '2026-12-03', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(269, 7, 29, '2026-12-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(270, 7, 30, '2026-12-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(271, 7, 31, '2026-12-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(272, 7, 32, '2026-12-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(273, 7, 33, '2026-12-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(274, 7, 34, '2026-12-10', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(275, 7, 35, '2026-12-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(276, 7, 36, '2026-12-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(277, 7, 37, '2026-12-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(278, 7, 38, '2026-12-15', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(279, 7, 39, '2026-12-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(280, 7, 40, '2026-12-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 04:58:50', '2026-11-17 04:10:52'),
(281, 8, 1, '2026-11-27', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(282, 8, 2, '2026-11-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(283, 8, 3, '2026-11-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(284, 8, 4, '2026-12-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(285, 8, 5, '2026-12-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(286, 8, 6, '2026-12-03', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(287, 8, 7, '2026-12-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(288, 8, 8, '2026-12-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(289, 8, 9, '2026-12-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(290, 8, 10, '2026-12-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(291, 8, 11, '2026-12-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(292, 8, 12, '2026-12-10', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(293, 8, 13, '2026-12-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(294, 8, 14, '2026-12-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(295, 8, 15, '2026-12-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(296, 8, 16, '2026-12-15', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(297, 8, 17, '2026-12-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(298, 8, 18, '2026-12-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(299, 8, 19, '2026-12-18', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(300, 8, 20, '2026-12-19', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(301, 8, 21, '2026-12-21', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(302, 8, 22, '2026-12-22', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(303, 8, 23, '2026-12-23', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(304, 8, 24, '2026-12-24', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(305, 8, 25, '2026-12-25', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(306, 8, 26, '2026-12-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(307, 8, 27, '2026-12-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(308, 8, 28, '2026-12-29', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(309, 8, 29, '2026-12-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(310, 8, 30, '2026-12-31', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(311, 8, 31, '2027-01-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(312, 8, 32, '2027-01-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(313, 8, 33, '2027-01-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(314, 8, 34, '2027-01-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(315, 8, 35, '2027-01-06', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(316, 8, 36, '2027-01-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(317, 8, 37, '2027-01-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(318, 8, 38, '2027-01-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(319, 8, 39, '2027-01-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(320, 8, 40, '2027-01-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:33', '2026-11-26 01:13:37'),
(321, 9, 1, '2026-11-27', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(322, 9, 2, '2026-11-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(323, 9, 3, '2026-11-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(324, 9, 4, '2026-12-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(325, 9, 5, '2026-12-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(326, 9, 6, '2026-12-03', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(327, 9, 7, '2026-12-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(328, 9, 8, '2026-12-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(329, 9, 9, '2026-12-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(330, 9, 10, '2026-12-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(331, 9, 11, '2026-12-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(332, 9, 12, '2026-12-10', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(333, 9, 13, '2026-12-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(334, 9, 14, '2026-12-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(335, 9, 15, '2026-12-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(336, 9, 16, '2026-12-15', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(337, 9, 17, '2026-12-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(338, 9, 18, '2026-12-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(339, 9, 19, '2026-12-18', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(340, 9, 20, '2026-12-19', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(341, 9, 21, '2026-12-21', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(342, 9, 22, '2026-12-22', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(343, 9, 23, '2026-12-23', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(344, 9, 24, '2026-12-24', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(345, 9, 25, '2026-12-25', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(346, 9, 26, '2026-12-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(347, 9, 27, '2026-12-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(348, 9, 28, '2026-12-29', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(349, 9, 29, '2026-12-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(350, 9, 30, '2026-12-31', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(351, 9, 31, '2027-01-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(352, 9, 32, '2027-01-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(353, 9, 33, '2027-01-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(354, 9, 34, '2027-01-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(355, 9, 35, '2027-01-06', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(356, 9, 36, '2027-01-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(357, 9, 37, '2027-01-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(358, 9, 38, '2027-01-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(359, 9, 39, '2027-01-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(360, 9, 40, '2027-01-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:32:10', '2026-11-26 01:32:45'),
(361, 10, 1, '2026-11-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(362, 10, 2, '2026-11-27', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(363, 10, 3, '2026-11-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(364, 10, 4, '2026-11-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(365, 10, 5, '2026-12-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(366, 10, 6, '2026-12-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(367, 10, 7, '2026-12-03', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(368, 10, 8, '2026-12-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(369, 10, 9, '2026-12-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(370, 10, 10, '2026-12-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(371, 10, 11, '2026-12-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(372, 10, 12, '2026-12-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(373, 10, 13, '2026-12-10', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(374, 10, 14, '2026-12-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(375, 10, 15, '2026-12-12', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(376, 10, 16, '2026-12-14', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(377, 10, 17, '2026-12-15', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(378, 10, 18, '2026-12-16', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(379, 10, 19, '2026-12-17', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(380, 10, 20, '2026-12-18', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(381, 10, 21, '2026-12-19', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(382, 10, 22, '2026-12-21', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(383, 10, 23, '2026-12-22', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(384, 10, 24, '2026-12-23', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(385, 10, 25, '2026-12-24', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(386, 10, 26, '2026-12-25', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(387, 10, 27, '2026-12-26', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(388, 10, 28, '2026-12-28', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(389, 10, 29, '2026-12-29', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(390, 10, 30, '2026-12-30', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(391, 10, 31, '2026-12-31', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(392, 10, 32, '2027-01-01', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(393, 10, 33, '2027-01-02', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(394, 10, 34, '2027-01-04', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(395, 10, 35, '2027-01-05', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(396, 10, 36, '2027-01-06', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(397, 10, 37, '2027-01-07', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(398, 10, 38, '2027-01-08', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(399, 10, 39, '2027-01-09', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(400, 10, 40, '2027-01-11', 2500.00, 500.00, 3000.00, 2500.00, 500.00, 'paid', '2026-11-26 18:31:34', '2026-11-26 02:58:57'),
(401, 11, 1, '2026-11-25', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-26 18:46:45', '2026-11-26 15:40:53'),
(402, 11, 2, '2026-11-26', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-26 18:46:45', '2026-11-26 15:40:53'),
(403, 11, 3, '2026-11-27', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-26 18:46:45', '2026-11-26 15:40:53'),
(404, 11, 4, '2026-11-28', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-26 18:46:45', '2026-11-26 15:40:53'),
(405, 11, 5, '2026-11-30', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-26 18:46:45', '2026-11-26 15:40:53'),
(406, 11, 6, '2026-12-01', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-26 18:46:45', '2026-11-26 15:40:53'),
(407, 11, 7, '2026-12-02', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-27 11:57:42', '2026-11-26 15:40:53'),
(408, 11, 8, '2026-12-03', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-27 11:57:42', '2026-11-26 15:40:53'),
(409, 11, 9, '2026-12-04', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-27 11:57:42', '2026-11-26 15:40:53'),
(410, 11, 10, '2026-12-05', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-27 11:57:42', '2026-11-26 15:40:53'),
(411, 11, 11, '2026-12-07', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-27 11:57:42', '2026-11-26 15:40:53'),
(412, 11, 12, '2026-12-08', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-28 07:21:39', '2026-11-26 15:40:53'),
(413, 11, 13, '2026-12-09', 3750.00, 750.00, 4500.00, 3750.00, 750.00, 'paid', '2026-11-28 07:21:39', '2026-11-26 15:40:53'),
(414, 11, 14, '2026-12-10', 3750.00, 750.00, 4500.00, 1300.00, 0.00, 'partial', NULL, '2026-11-26 15:40:53'),
(415, 11, 15, '2026-12-11', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(416, 11, 16, '2026-12-12', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(417, 11, 17, '2026-12-14', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(418, 11, 18, '2026-12-15', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(419, 11, 19, '2026-12-16', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(420, 11, 20, '2026-12-17', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(421, 11, 21, '2026-12-18', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(422, 11, 22, '2026-12-19', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(423, 11, 23, '2026-12-21', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(424, 11, 24, '2026-12-22', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(425, 11, 25, '2026-12-23', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(426, 11, 26, '2026-12-24', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(427, 11, 27, '2026-12-25', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(428, 11, 28, '2026-12-26', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(429, 11, 29, '2026-12-28', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(430, 11, 30, '2026-12-29', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(431, 11, 31, '2026-12-30', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(432, 11, 32, '2026-12-31', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(433, 11, 33, '2027-01-01', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(434, 11, 34, '2027-01-02', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(435, 11, 35, '2027-01-04', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(436, 11, 36, '2027-01-05', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(437, 11, 37, '2027-01-06', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(438, 11, 38, '2027-01-07', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(439, 11, 39, '2027-01-08', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53'),
(440, 11, 40, '2027-01-09', 3750.00, 750.00, 4500.00, 0.00, 0.00, 'pending', NULL, '2026-11-26 15:40:53');

--
-- Triggers `repayment_schedule`
--
DELIMITER $$
CREATE TRIGGER `before_repayment_schedule_update` BEFORE UPDATE ON `repayment_schedule` FOR EACH ROW BEGIN
    IF NEW.due_date < CURDATE()
       AND NEW.status NOT IN ('paid', 'waived')
       AND (
           COALESCE(NEW.principal_paid, 0) < COALESCE(NEW.principal_due, 0)
           OR COALESCE(NEW.interest_paid, 0) < COALESCE(NEW.interest_due, 0)
       )
    THEN
        SET NEW.status = 'Penalty';
    END IF;
END
$$
DELIMITER ;

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

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

CREATE TABLE `roles` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `roles` (`id`, `name`, `description`, `is_active`, `created_at`) VALUES
(1, 'Administrator', 'System administration', 1, '2026-10-18 18:03:46'),
(2, 'Loan Officer', 'Customer and loan application management', 1, '2026-10-18 18:03:46'),
(3, 'Cashier', 'Loan disbursements and repayment collection', 1, '2026-10-18 18:03:46'),
(4, 'Accountant', 'Financial reports and expense management', 1, '2026-10-18 18:03:46'),
(5, 'Manager', 'Loan review and business oversight', 1, '2026-10-18 18:03:46');

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

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

CREATE TABLE `role_permissions` (
  `role_id` int(10) UNSIGNED NOT NULL,
  `permission_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES
(1, 1),
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(1, 6),
(1, 7),
(1, 8),
(1, 9),
(1, 10),
(1, 11),
(1, 12),
(1, 13),
(1, 14),
(1, 15),
(1, 16),
(1, 17),
(2, 4),
(2, 5),
(2, 7),
(2, 8),
(2, 9),
(2, 10),
(2, 11),
(2, 12),
(2, 13),
(2, 14),
(2, 15),
(2, 16),
(3, 4),
(3, 7),
(3, 9),
(3, 10),
(3, 11),
(3, 14),
(3, 15),
(3, 16),
(4, 1),
(4, 9),
(4, 12),
(4, 14),
(4, 15),
(4, 16),
(5, 1),
(5, 4),
(5, 7),
(5, 9),
(5, 10),
(5, 14),
(5, 16);

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

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

CREATE TABLE `system_settings` (
  `id` int(10) UNSIGNED NOT NULL,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` varchar(255) NOT NULL,
  `updated_by` bigint(20) UNSIGNED DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `system_settings` (`id`, `setting_key`, `setting_value`, `updated_by`, `updated_at`) VALUES
(1, 'currency', 'TZS', NULL, '2026-10-18 18:03:46'),
(2, 'interest_method', 'flat', NULL, '2026-10-18 18:03:46'),
(3, 'interest_rate', '20', 1, '2026-11-26 02:32:34'),
(4, 'interest_rate_basis', 'original_principal', NULL, '2026-10-18 18:03:46'),
(5, 'interest_rate_period', 'entire_loan_term', NULL, '2026-10-18 18:03:46'),
(6, 'minimum_loan_term_months', '1', 1, '2026-11-26 02:32:34'),
(7, 'repayment_frequency', 'daily', 1, '2026-11-26 02:32:34'),
(8, 'exclude_sunday', '1', NULL, '2026-10-18 18:03:46'),
(9, 'loan_application_fee', '10000', 1, '2026-11-26 02:32:34'),
(10, 'insurance_rate', '1', 1, '2026-11-26 02:32:34'),
(11, 'insurance_rate_basis', 'original_principal', NULL, '2026-10-18 18:03:46'),
(12, 'savings_rate', '10', 1, '2026-11-26 02:32:34'),
(13, 'savings_rate_basis', 'original_principal', NULL, '2026-10-18 18:03:46'),
(14, 'savings_collection_method', 'deduct_from_disbursement', NULL, '2026-10-18 18:03:46'),
(15, 'savings_accounting_type', 'customer_liability', NULL, '2026-10-18 18:03:46'),
(16, 'penalty_type', 'fixed', NULL, '2026-10-18 18:03:46'),
(17, 'penalty_amount', '1000', 1, '2026-11-26 02:32:34'),
(18, 'penalty_frequency', 'per_missed_scheduled_day', NULL, '2026-10-18 18:03:46'),
(19, 'interest_rate_percent', '20', 1, '2026-11-26 02:32:34'),
(20, 'minimum_term_months', '1', 1, '2026-11-26 02:32:34'),
(21, 'repayment_days', 'Monday-Saturday;Sunday excluded', 1, '2026-11-26 02:32:34'),
(22, 'application_fee_tzs', '10000', 1, '2026-11-26 02:32:34'),
(23, 'insurance_rate_percent', '1', 1, '2026-11-26 02:32:34'),
(24, 'savings_rate_percent', '10', 1, '2026-11-26 02:32:34'),
(25, 'savings_deduction_method', 'deducted from disbursement; customer liability', NULL, '2026-10-18 18:49:49'),
(26, 'overdue_penalty_per_missed_day_tzs', '1000', NULL, '2026-10-18 18:49:49'),
(27, 'timezone', 'Africa/Dar_es_Salaam', NULL, '2026-10-18 18:49:49'),
(28, 'institution_name', 'Simple Loan Information System', NULL, '2026-10-30 13:28:33'),
(29, 'institution_address', '', NULL, '2026-10-30 13:28:33'),
(30, 'institution_phone', '', NULL, '2026-10-30 13:28:33'),
(31, 'institution_email', '', NULL, '2026-10-30 13:28:33'),
(32, 'institution_website', '', NULL, '2026-10-30 13:28:33'),
(33, 'date_format', 'd/m/Y', NULL, '2026-10-30 13:28:33'),
(34, 'receipt_footer', 'Thank you for choosing our services.', NULL, '2026-10-30 13:28:33'),
(35, 'company_tin', '', NULL, '2026-10-30 13:28:33'),
(36, 'company_registration_no', '', NULL, '2026-10-30 13:28:33'),
(37, 'session_timeout_minutes', '30', 1, '2026-11-26 02:33:14'),
(38, 'max_login_attempts', '5', 1, '2026-11-26 02:33:14'),
(39, 'system_email_notifications', '1', 1, '2026-11-26 02:33:29'),
(40, 'maintenance_mode', '1', 1, '2026-11-26 02:33:14'),
(41, 'allow_own_loan_approval', '1', 1, '2026-11-26 02:32:34'),
(42, 'require_guarantor', '0', 1, '2026-11-26 02:32:34'),
(43, 'require_customer_photo', '0', 1, '2026-11-26 02:32:34'),
(44, 'require_national_id', '0', 1, '2026-11-26 02:32:34');

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

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

CREATE TABLE `users` (
  `id` int(10) UNSIGNED NOT NULL,
  `full_name` varchar(150) NOT NULL,
  `username` varchar(80) NOT NULL,
  `email` varchar(150) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `password_hash` varchar(255) NOT NULL,
  `role_id` int(10) UNSIGNED NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `last_login` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `users` (`id`, `full_name`, `username`, `email`, `phone`, `password_hash`, `role_id`, `is_active`, `last_login`, `created_at`, `updated_at`) VALUES
(1, 'System Administrator', 'cmwitinda@yahoo.com', 'cmwitinda@yahoo.com', '0682531800', '$2y$10$3WfKSgMuj8Wd/oVqdIqv4eH1uJEHhXE1tmBA89Mt7fCXmcfCkh9sC', 1, 1, '2026-10-21 11:42:37', '2026-10-18 19:52:11', '2026-10-21 09:42:37'),
(2, 'Belisia Edward Tinda', 'belisia@yahoo.com', 'belisia@yahoo.com', '0798074987', '$2y$10$zJpblOcsl6B7weW9MnWJie.naglZDiA1gkJLmhhresz6KOmmC48Zu', 2, 1, NULL, '2026-10-26 09:20:21', '2026-11-25 06:11:39'),
(3, 'Binuel Edward Tinda', 'Binuel Edward Tinda', 'binueltinda@gmail.com', '0798074987', '$2y$10$Vy4ydXFmEkJ5bPQej6AFa.za5X3rf7MBzvkKiLgGF.f/V3HrMbaXK', 3, 1, NULL, '2026-11-26 00:31:35', '2026-11-26 00:31:35');

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

--
-- Table structure for table `user_permissions`
--

CREATE TABLE `user_permissions` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `permission_id` int(10) UNSIGNED NOT NULL,
  `is_allowed` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `application_fee_payments`
--
ALTER TABLE `application_fee_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_fee_payment_date` (`payment_date`),
  ADD KEY `application_id` (`application_id`),
  ADD KEY `received_by` (`received_by`);

--
-- Indexes for table `audit_logs`
--
ALTER TABLE `audit_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_audit_table_record` (`table_name`,`record_id`),
  ADD KEY `idx_audit_created` (`created_at`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `collection_targets`
--
ALTER TABLE `collection_targets`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_staff_target_date` (`staff_id`,`target_date`),
  ADD KEY `idx_target_date` (`target_date`),
  ADD KEY `idx_staff_id` (`staff_id`);

--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `customer_no` (`customer_no`),
  ADD KEY `idx_customer_name` (`full_name`),
  ADD KEY `idx_customer_phone` (`phone`),
  ADD KEY `created_by` (`created_by`);

--
-- Indexes for table `customer_portal_accounts`
--
ALTER TABLE `customer_portal_accounts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_customer_portal_customer` (`customer_id`);

--
-- Indexes for table `customer_savings`
--
ALTER TABLE `customer_savings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_savings_customer` (`customer_id`,`transaction_date`),
  ADD KEY `loan_id` (`loan_id`),
  ADD KEY `processed_by` (`processed_by`);

--
-- Indexes for table `defaulter_followups`
--
ALTER TABLE `defaulter_followups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_followup_loan` (`loan_id`),
  ADD KEY `idx_followup_customer` (`customer_id`),
  ADD KEY `idx_followup_date` (`followup_date`),
  ADD KEY `idx_next_followup` (`next_followup_date`),
  ADD KEY `idx_followup_outcome` (`outcome`);

--
-- Indexes for table `expenses`
--
ALTER TABLE `expenses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `expense_no` (`expense_no`),
  ADD UNIQUE KEY `uq_expenses_voucher_no` (`voucher_no`),
  ADD KEY `idx_expense_date` (`expense_date`),
  ADD KEY `idx_expense_status` (`status`),
  ADD KEY `requested_by` (`requested_by`),
  ADD KEY `approved_by` (`approved_by`),
  ADD KEY `paid_by` (`paid_by`);

--
-- Indexes for table `insurance_transactions`
--
ALTER TABLE `insurance_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `loan_id` (`loan_id`),
  ADD KEY `processed_by` (`processed_by`);

--
-- Indexes for table `loans`
--
ALTER TABLE `loans`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `loan_no` (`loan_no`),
  ADD UNIQUE KEY `application_id` (`application_id`),
  ADD KEY `idx_loan_customer` (`customer_id`),
  ADD KEY `idx_loan_status` (`status`),
  ADD KEY `idx_loan_disbursement` (`disbursement_date`),
  ADD KEY `loan_product_id` (`loan_product_id`),
  ADD KEY `approved_by` (`approved_by`),
  ADD KEY `disbursed_by` (`disbursed_by`);

--
-- Indexes for table `loan_applications`
--
ALTER TABLE `loan_applications`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `application_no` (`application_no`),
  ADD KEY `idx_application_status` (`status`),
  ADD KEY `idx_application_customer` (`customer_id`),
  ADD KEY `loan_product_id` (`loan_product_id`),
  ADD KEY `reviewed_by` (`reviewed_by`),
  ADD KEY `created_by` (`created_by`);

--
-- Indexes for table `loan_collateral`
--
ALTER TABLE `loan_collateral`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_collateral_application` (`application_id`),
  ADD KEY `idx_collateral_status` (`status`),
  ADD KEY `idx_collateral_created_by` (`created_by`);

--
-- Indexes for table `loan_collaterals`
--
ALTER TABLE `loan_collaterals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_collateral_application` (`application_id`),
  ADD KEY `idx_collateral_customer` (`customer_id`),
  ADD KEY `idx_collateral_status` (`verification_status`);

--
-- Indexes for table `loan_disbursements`
--
ALTER TABLE `loan_disbursements`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `loan_id` (`loan_id`),
  ADD KEY `disbursed_by` (`disbursed_by`);

--
-- Indexes for table `loan_guarantors`
--
ALTER TABLE `loan_guarantors`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_guarantor_application` (`application_id`),
  ADD KEY `idx_guarantor_customer` (`customer_id`),
  ADD KEY `idx_guarantor_existing_customer` (`existing_customer_id`),
  ADD KEY `idx_guarantor_status` (`verification_status`);

--
-- Indexes for table `loan_penalties`
--
ALTER TABLE `loan_penalties`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_penalty_missed_date` (`loan_id`,`missed_date`),
  ADD KEY `idx_penalty_status` (`status`),
  ADD KEY `schedule_id` (`schedule_id`),
  ADD KEY `assessed_by` (`assessed_by`);

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

--
-- Indexes for table `penalty_payments`
--
ALTER TABLE `penalty_payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_penalty_payment_receipt` (`receipt_no`),
  ADD KEY `idx_penalty_payment_penalty` (`penalty_id`),
  ADD KEY `idx_penalty_payment_date` (`payment_date`),
  ADD KEY `idx_penalty_payment_status` (`status`),
  ADD KEY `idx_penalty_payment_reference` (`reference_no`);

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

--
-- Indexes for table `repayments`
--
ALTER TABLE `repayments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `receipt_no` (`receipt_no`),
  ADD KEY `idx_repayment_date` (`payment_date`),
  ADD KEY `idx_repayment_loan` (`loan_id`),
  ADD KEY `customer_id` (`customer_id`),
  ADD KEY `received_by` (`received_by`);

--
-- Indexes for table `repayment_allocations`
--
ALTER TABLE `repayment_allocations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_allocation_component` (`component`),
  ADD KEY `repayment_id` (`repayment_id`),
  ADD KEY `schedule_id` (`schedule_id`),
  ADD KEY `idx_allocation_penalty_id` (`penalty_id`);

--
-- Indexes for table `repayment_schedule`
--
ALTER TABLE `repayment_schedule`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_loan_installment` (`loan_id`,`installment_no`),
  ADD UNIQUE KEY `uq_loan_due_date` (`loan_id`,`due_date`),
  ADD KEY `idx_schedule_due` (`due_date`,`status`);

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

--
-- Indexes for table `role_permissions`
--
ALTER TABLE `role_permissions`
  ADD PRIMARY KEY (`role_id`,`permission_id`),
  ADD KEY `permission_id` (`permission_id`);

--
-- Indexes for table `system_settings`
--
ALTER TABLE `system_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `setting_key` (`setting_key`),
  ADD UNIQUE KEY `uq_system_settings_key` (`setting_key`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `email` (`email`),
  ADD KEY `role_id` (`role_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `application_fee_payments`
--
ALTER TABLE `application_fee_payments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `audit_logs`
--
ALTER TABLE `audit_logs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `collection_targets`
--
ALTER TABLE `collection_targets`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `customer_portal_accounts`
--
ALTER TABLE `customer_portal_accounts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `customer_savings`
--
ALTER TABLE `customer_savings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `defaulter_followups`
--
ALTER TABLE `defaulter_followups`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `expenses`
--
ALTER TABLE `expenses`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `insurance_transactions`
--
ALTER TABLE `insurance_transactions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `loans`
--
ALTER TABLE `loans`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `loan_applications`
--
ALTER TABLE `loan_applications`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `loan_collateral`
--
ALTER TABLE `loan_collateral`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `loan_collaterals`
--
ALTER TABLE `loan_collaterals`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `loan_disbursements`
--
ALTER TABLE `loan_disbursements`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `loan_guarantors`
--
ALTER TABLE `loan_guarantors`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `loan_penalties`
--
ALTER TABLE `loan_penalties`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=93;

--
-- AUTO_INCREMENT for table `loan_products`
--
ALTER TABLE `loan_products`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `penalty_payments`
--
ALTER TABLE `penalty_payments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `permissions`
--
ALTER TABLE `permissions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `repayments`
--
ALTER TABLE `repayments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;

--
-- AUTO_INCREMENT for table `repayment_allocations`
--
ALTER TABLE `repayment_allocations`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=916;

--
-- AUTO_INCREMENT for table `repayment_schedule`
--
ALTER TABLE `repayment_schedule`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=441;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `system_settings`
--
ALTER TABLE `system_settings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=392;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `user_permissions`
--
ALTER TABLE `user_permissions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `application_fee_payments`
--
ALTER TABLE `application_fee_payments`
  ADD CONSTRAINT `application_fee_payments_ibfk_1` FOREIGN KEY (`application_id`) REFERENCES `loan_applications` (`id`),
  ADD CONSTRAINT `application_fee_payments_ibfk_2` FOREIGN KEY (`received_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `audit_logs`
--
ALTER TABLE `audit_logs`
  ADD CONSTRAINT `audit_logs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customers`
--
ALTER TABLE `customers`
  ADD CONSTRAINT `customers_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customer_portal_accounts`
--
ALTER TABLE `customer_portal_accounts`
  ADD CONSTRAINT `fk_portal_customer` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_savings`
--
ALTER TABLE `customer_savings`
  ADD CONSTRAINT `customer_savings_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  ADD CONSTRAINT `customer_savings_ibfk_2` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `customer_savings_ibfk_3` FOREIGN KEY (`processed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `expenses`
--
ALTER TABLE `expenses`
  ADD CONSTRAINT `expenses_ibfk_1` FOREIGN KEY (`requested_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `expenses_ibfk_2` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `expenses_ibfk_3` FOREIGN KEY (`paid_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `insurance_transactions`
--
ALTER TABLE `insurance_transactions`
  ADD CONSTRAINT `insurance_transactions_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `insurance_transactions_ibfk_2` FOREIGN KEY (`processed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `loans`
--
ALTER TABLE `loans`
  ADD CONSTRAINT `loans_ibfk_1` FOREIGN KEY (`application_id`) REFERENCES `loan_applications` (`id`),
  ADD CONSTRAINT `loans_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  ADD CONSTRAINT `loans_ibfk_3` FOREIGN KEY (`loan_product_id`) REFERENCES `loan_products` (`id`),
  ADD CONSTRAINT `loans_ibfk_4` FOREIGN KEY (`approved_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `loans_ibfk_5` FOREIGN KEY (`disbursed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `loan_applications`
--
ALTER TABLE `loan_applications`
  ADD CONSTRAINT `loan_applications_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  ADD CONSTRAINT `loan_applications_ibfk_2` FOREIGN KEY (`loan_product_id`) REFERENCES `loan_products` (`id`),
  ADD CONSTRAINT `loan_applications_ibfk_3` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `loan_applications_ibfk_4` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `loan_collaterals`
--
ALTER TABLE `loan_collaterals`
  ADD CONSTRAINT `fk_collateral_application` FOREIGN KEY (`application_id`) REFERENCES `loan_applications` (`id`),
  ADD CONSTRAINT `fk_collateral_customer` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`);

--
-- Constraints for table `loan_disbursements`
--
ALTER TABLE `loan_disbursements`
  ADD CONSTRAINT `loan_disbursements_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `loan_disbursements_ibfk_2` FOREIGN KEY (`disbursed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `loan_guarantors`
--
ALTER TABLE `loan_guarantors`
  ADD CONSTRAINT `fk_guarantor_application` FOREIGN KEY (`application_id`) REFERENCES `loan_applications` (`id`),
  ADD CONSTRAINT `fk_guarantor_borrower` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  ADD CONSTRAINT `fk_guarantor_existing_customer` FOREIGN KEY (`existing_customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `loan_penalties`
--
ALTER TABLE `loan_penalties`
  ADD CONSTRAINT `loan_penalties_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `loan_penalties_ibfk_2` FOREIGN KEY (`schedule_id`) REFERENCES `repayment_schedule` (`id`),
  ADD CONSTRAINT `loan_penalties_ibfk_3` FOREIGN KEY (`assessed_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `repayments`
--
ALTER TABLE `repayments`
  ADD CONSTRAINT `repayments_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`id`),
  ADD CONSTRAINT `repayments_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`),
  ADD CONSTRAINT `repayments_ibfk_3` FOREIGN KEY (`received_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `repayment_allocations`
--
ALTER TABLE `repayment_allocations`
  ADD CONSTRAINT `repayment_allocations_ibfk_1` FOREIGN KEY (`repayment_id`) REFERENCES `repayments` (`id`),
  ADD CONSTRAINT `repayment_allocations_ibfk_2` FOREIGN KEY (`schedule_id`) REFERENCES `repayment_schedule` (`id`) ON DELETE SET NULL;

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

--
-- Constraints for table `role_permissions`
--
ALTER TABLE `role_permissions`
  ADD CONSTRAINT `role_permissions_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_permissions_ibfk_2` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`);

--
-- Constraints for table `user_permissions`
--
ALTER TABLE `user_permissions`
  ADD CONSTRAINT `fk_user_permissions_permission` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_user_permissions_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

DELIMITER $$
--
-- Events
--
CREATE DEFINER=`pachaspa`@`localhost` EVENT `update_overdue_repayments` ON SCHEDULE EVERY 1 DAY STARTS '2026-10-30 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO UPDATE repayment_schedule
    SET status = 'Penalty'
    WHERE due_date < CURDATE()
      AND status NOT IN ('paid', 'waived')
      AND (
          COALESCE(principal_paid, 0) < COALESCE(principal_due, 0)
          OR COALESCE(interest_paid, 0) < COALESCE(interest_due, 0)
      )$$

DELIMITER ;
COMMIT;

/*!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 */;
