-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 20, 2026 at 10:22 AM
-- Server version: 8.0.37
-- PHP Version: 8.4.24

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: `aicommy1_creditcontrol_db`
--

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

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

CREATE TABLE `audit_logs` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `event` varchar(255) DEFAULT NULL,
  `auditable_type` varchar(255) DEFAULT NULL,
  `auditable_id` bigint UNSIGNED DEFAULT NULL,
  `old_values` json DEFAULT NULL,
  `new_values` json DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `audit_logs` (`id`, `user_id`, `event`, `auditable_type`, `auditable_id`, `old_values`, `new_values`, `ip_address`, `user_agent`, `created_at`) VALUES
(1, 1, 'created', 'App\\Models\\User', 5, '[]', '{\"id\": 5, \"name\": \"Assoc. Prof. Ts. Dr. Chng Chern Wei\", \"role\": \"superadmin\", \"email\": \"cwchng.fcst@gmail.com\", \"is_active\": true, \"created_at\": \"2026-09-19T12:14:00.000000Z\", \"updated_at\": \"2026-09-19T12:14:00.000000Z\", \"must_change_password\": true}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:14:00'),
(2, 1, 'updated', 'App\\Models\\User', 5, '{\"id\": 5, \"name\": \"Assoc. Prof. Ts. Dr. Chng Chern Wei\", \"role\": \"superadmin\", \"email\": \"cwchng.fcst@gmail.com\", \"is_active\": true, \"created_at\": \"2026-09-19T12:14:00.000000Z\", \"updated_at\": \"2026-09-19T12:14:00.000000Z\", \"email_verified_at\": null, \"must_change_password\": true}', '{\"id\": 5, \"name\": \"Assoc. Prof. Ts. Dr. Chng Chern Wei\", \"role\": \"superadmin\", \"email\": \"cwchng.fcst@gmail.com\", \"is_active\": true, \"created_at\": \"2026-09-19T12:14:00.000000Z\", \"updated_at\": \"2026-09-19T12:14:00.000000Z\", \"email_verified_at\": null, \"must_change_password\": true}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:14:11'),
(3, 1, 'student_account.created', 'App\\Models\\StudentAccount', 1, '[]', '{\"id\": 1, \"status\": \"unassigned\", \"due_date\": \"2026-09-13T16:00:00.000000Z\", \"programme\": \"E1451 BACHELOR OF INFORMATION TECHNOLOGY (NETWORKING AND SECURITY) (HONOURS)\", \"created_at\": \"2026-09-19T12:17:28.000000Z\", \"created_by\": 1, \"deductions\": \"0.00\", \"student_id\": \"B2699\", \"updated_at\": \"2026-09-19T12:17:28.000000Z\", \"updated_by\": 1, \"advice_date\": \"2026-08-28T16:00:00.000000Z\", \"assigned_by\": null, \"assigned_to\": null, \"gross_amount\": \"4360.00\", \"student_name\": \"JUNO ONG JIN HEE\", \"invoice_number\": \"B2699\", \"attachment_name\": \"Here\'s Your Latest Fees Advice (FEES ADVICE FOR SEMESTER 1) - Assoc. Prof. Ts. Dr. Chng Chern Wei - Outlook.pdf\", \"attachment_path\": \"credit-control/9OdAlptxWuilP6Pxix6E9XmZSgBEyCFjdmKAPcYn.pdf\", \"intake_semester\": \"14/09/2026\", \"advice_reference\": null, \"outstanding_amount\": \"4360.00\"}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:17:28'),
(4, 1, 'student_account.updated', 'App\\Models\\StudentAccount', 1, '{\"id\": 1, \"status\": \"unassigned\", \"due_date\": \"2026-09-13T16:00:00.000000Z\", \"programme\": \"E1451 BACHELOR OF INFORMATION TECHNOLOGY (NETWORKING AND SECURITY) (HONOURS)\", \"created_at\": \"2026-09-19T12:17:28.000000Z\", \"created_by\": \"1\", \"deductions\": \"0.00\", \"deleted_at\": null, \"follow_ups\": [], \"student_id\": \"B2699\", \"updated_at\": \"2026-09-19T12:17:28.000000Z\", \"updated_by\": \"1\", \"advice_date\": \"2026-08-28T16:00:00.000000Z\", \"assigned_by\": null, \"assigned_to\": null, \"coordinator\": null, \"gross_amount\": \"4360.00\", \"student_name\": \"JUNO ONG JIN HEE\", \"invoice_number\": \"B2699\", \"attachment_name\": \"Here\'s Your Latest Fees Advice (FEES ADVICE FOR SEMESTER 1) - Assoc. Prof. Ts. Dr. Chng Chern Wei - Outlook.pdf\", \"attachment_path\": \"credit-control/9OdAlptxWuilP6Pxix6E9XmZSgBEyCFjdmKAPcYn.pdf\", \"intake_semester\": \"14/09/2026\", \"advice_reference\": null, \"outstanding_amount\": \"4360.00\", \"latest_follow_up_at\": null}', '{\"id\": 1, \"status\": \"unassigned\", \"due_date\": \"2026-09-13T16:00:00.000000Z\", \"programme\": \"E1451 BACHELOR OF INFORMATION TECHNOLOGY (NETWORKING AND SECURITY) (HONOURS)\", \"created_at\": \"2026-09-19T12:17:28.000000Z\", \"created_by\": \"1\", \"deductions\": \"0.00\", \"deleted_at\": null, \"student_id\": \"B2699\", \"updated_at\": \"2026-09-19T12:17:45.000000Z\", \"updated_by\": \"1\", \"advice_date\": \"2026-08-28T16:00:00.000000Z\", \"assigned_by\": null, \"assigned_to\": null, \"gross_amount\": \"4360.00\", \"student_name\": \"JUNO ONG JIN HEE\", \"invoice_number\": \"B2699\", \"attachment_name\": \"PA_B2699_E1451_2026SEP_20260917083041_0232.pdf\", \"attachment_path\": \"credit-control/lidEN6wZxLJD6R1GpVmy7W2yXd7VyueKcTzRjfwB.pdf\", \"intake_semester\": \"14/09/2026\", \"advice_reference\": null, \"outstanding_amount\": \"4360.00\", \"latest_follow_up_at\": null}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:17:45'),
(5, 1, 'created', 'App\\Models\\User', 6, '[]', '{\"id\": 6, \"name\": \"Dr. Hamirul\", \"role\": \"programme_coordinator\", \"email\": \"Hamirul@gmail.com\", \"is_active\": true, \"created_at\": \"2026-09-19T12:19:21.000000Z\", \"updated_at\": \"2026-09-19T12:19:21.000000Z\", \"must_change_password\": true}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:19:21'),
(6, 1, 'created', 'App\\Models\\User', 7, '[]', '{\"id\": 7, \"name\": \"Dr. Mohd Ridhwan\", \"role\": \"programme_coordinator\", \"email\": \"ridhwan@gmail.com\", \"is_active\": true, \"created_at\": \"2026-09-19T12:19:45.000000Z\", \"updated_at\": \"2026-09-19T12:19:45.000000Z\", \"must_change_password\": true}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:19:45'),
(7, 1, 'created', 'App\\Models\\User', 8, '[]', '{\"id\": 8, \"name\": \"Mohd Sukry\", \"role\": \"programme_coordinator\", \"email\": \"sukry@gmail.com\", \"is_active\": true, \"created_at\": \"2026-09-19T12:20:04.000000Z\", \"updated_at\": \"2026-09-19T12:20:04.000000Z\", \"must_change_password\": true}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:20:04'),
(8, 1, 'created', 'App\\Models\\User', 9, '[]', '{\"id\": 9, \"name\": \"Cham Kar Loon\", \"role\": \"programme_coordinator\", \"email\": \"karloon@gmail.com\", \"is_active\": true, \"created_at\": \"2026-09-19T12:20:20.000000Z\", \"updated_at\": \"2026-09-19T12:20:20.000000Z\", \"must_change_password\": true}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:20:20'),
(9, 1, 'created', 'App\\Models\\User', 10, '[]', '{\"id\": 10, \"name\": \"Nur Sufura\", \"role\": \"programme_coordinator\", \"email\": \"sufura@gmail.com\", \"is_active\": true, \"created_at\": \"2026-09-19T12:20:37.000000Z\", \"updated_at\": \"2026-09-19T12:20:37.000000Z\", \"must_change_password\": true}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:20:37'),
(10, 1, 'student_account.updated', 'App\\Models\\StudentAccount', 1, '{\"id\": 1, \"status\": \"unassigned\", \"due_date\": \"2026-09-13T16:00:00.000000Z\", \"programme\": \"E1451 BACHELOR OF INFORMATION TECHNOLOGY (NETWORKING AND SECURITY) (HONOURS)\", \"created_at\": \"2026-09-19T12:17:28.000000Z\", \"created_by\": \"1\", \"deductions\": \"0.00\", \"deleted_at\": null, \"follow_ups\": [], \"student_id\": \"B2699\", \"updated_at\": \"2026-09-19T12:17:45.000000Z\", \"updated_by\": \"1\", \"advice_date\": \"2026-08-28T16:00:00.000000Z\", \"assigned_by\": null, \"assigned_to\": null, \"coordinator\": null, \"gross_amount\": \"4360.00\", \"student_name\": \"JUNO ONG JIN HEE\", \"invoice_number\": \"B2699\", \"attachment_name\": \"PA_B2699_E1451_2026SEP_20260917083041_0232.pdf\", \"attachment_path\": \"credit-control/lidEN6wZxLJD6R1GpVmy7W2yXd7VyueKcTzRjfwB.pdf\", \"intake_semester\": \"14/09/2026\", \"advice_reference\": null, \"outstanding_amount\": \"4360.00\", \"latest_follow_up_at\": null}', '{\"id\": 1, \"status\": \"in_progress\", \"due_date\": \"2026-09-13T16:00:00.000000Z\", \"programme\": \"E1451 BACHELOR OF INFORMATION TECHNOLOGY (NETWORKING AND SECURITY) (HONOURS)\", \"created_at\": \"2026-09-19T12:17:28.000000Z\", \"created_by\": \"1\", \"deductions\": \"0.00\", \"deleted_at\": null, \"student_id\": \"B2699\", \"updated_at\": \"2026-09-19T12:21:11.000000Z\", \"updated_by\": \"1\", \"advice_date\": \"2026-08-28T16:00:00.000000Z\", \"assigned_by\": \"1\", \"assigned_to\": \"6\", \"gross_amount\": \"4360.00\", \"student_name\": \"JUNO ONG JIN HEE\", \"invoice_number\": \"B2699\", \"attachment_name\": \"PA_B2699_E1451_2026SEP_20260917083041_0232.pdf\", \"attachment_path\": \"credit-control/lidEN6wZxLJD6R1GpVmy7W2yXd7VyueKcTzRjfwB.pdf\", \"intake_semester\": \"14/09/2026\", \"advice_reference\": null, \"outstanding_amount\": \"4360.00\", \"latest_follow_up_at\": null}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:21:11'),
(11, 1, 'created', 'App\\Models\\User', 11, '[]', '{\"id\": 11, \"name\": \"Dr. Chng Chern Wei\", \"role\": \"programme_coordinator\", \"email\": \"cwchng2u@yahoo.com.my\", \"is_active\": true, \"created_at\": \"2026-09-19T12:22:19.000000Z\", \"updated_at\": \"2026-09-19T12:22:19.000000Z\", \"must_change_password\": true}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:22:19'),
(12, 1, 'student_account.updated', 'App\\Models\\StudentAccount', 1, '{\"id\": 1, \"status\": \"in_progress\", \"due_date\": \"2026-09-13T16:00:00.000000Z\", \"programme\": \"E1451 BACHELOR OF INFORMATION TECHNOLOGY (NETWORKING AND SECURITY) (HONOURS)\", \"created_at\": \"2026-09-19T12:17:28.000000Z\", \"created_by\": \"1\", \"deductions\": \"0.00\", \"deleted_at\": null, \"follow_ups\": [], \"student_id\": \"B2699\", \"updated_at\": \"2026-09-19T12:21:11.000000Z\", \"updated_by\": \"1\", \"advice_date\": \"2026-08-28T16:00:00.000000Z\", \"assigned_by\": \"1\", \"assigned_to\": \"6\", \"coordinator\": {\"id\": 6, \"name\": \"Dr. Hamirul\", \"role\": \"programme_coordinator\", \"email\": \"Hamirul@gmail.com\", \"is_active\": true, \"created_at\": \"2026-09-19T12:19:21.000000Z\", \"updated_at\": \"2026-09-19T12:19:21.000000Z\", \"email_verified_at\": null, \"must_change_password\": true}, \"gross_amount\": \"4360.00\", \"student_name\": \"JUNO ONG JIN HEE\", \"invoice_number\": \"B2699\", \"attachment_name\": \"PA_B2699_E1451_2026SEP_20260917083041_0232.pdf\", \"attachment_path\": \"credit-control/lidEN6wZxLJD6R1GpVmy7W2yXd7VyueKcTzRjfwB.pdf\", \"intake_semester\": \"14/09/2026\", \"advice_reference\": null, \"outstanding_amount\": \"4360.00\", \"latest_follow_up_at\": null}', '{\"id\": 1, \"status\": \"in_progress\", \"due_date\": \"2026-09-13T16:00:00.000000Z\", \"programme\": \"E1451 BACHELOR OF INFORMATION TECHNOLOGY (NETWORKING AND SECURITY) (HONOURS)\", \"created_at\": \"2026-09-19T12:17:28.000000Z\", \"created_by\": \"1\", \"deductions\": \"0.00\", \"deleted_at\": null, \"student_id\": \"B2699\", \"updated_at\": \"2026-09-19T12:22:39.000000Z\", \"updated_by\": \"1\", \"advice_date\": \"2026-08-28T16:00:00.000000Z\", \"assigned_by\": \"1\", \"assigned_to\": \"11\", \"gross_amount\": \"4360.00\", \"student_name\": \"JUNO ONG JIN HEE\", \"invoice_number\": \"B2699\", \"attachment_name\": \"PA_B2699_E1451_2026SEP_20260917083041_0232.pdf\", \"attachment_path\": \"credit-control/lidEN6wZxLJD6R1GpVmy7W2yXd7VyueKcTzRjfwB.pdf\", \"intake_semester\": \"14/09/2026\", \"advice_reference\": null, \"outstanding_amount\": \"4360.00\", \"latest_follow_up_at\": null}', '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', '2026-09-19 12:22:39');

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

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

CREATE TABLE `cache` (
  `key` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `value` mediumtext COLLATE utf8mb3_unicode_ci,
  `expiration` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

INSERT INTO `cache` (`key`, `value`, `expiration`) VALUES
('coptpa_cache_33834e09e6c088616b6451bf27e32aa4d74239f9', 'i:2;', 1789805961),
('coptpa_cache_33834e09e6c088616b6451bf27e32aa4d74239f9:timer', 'i:1789805961;', 1789805961);

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

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

CREATE TABLE `cache_locks` (
  `key` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `owner` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `expiration` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

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

CREATE TABLE `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `uuid` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `connection` text COLLATE utf8mb3_unicode_ci,
  `queue` text COLLATE utf8mb3_unicode_ci,
  `payload` longtext COLLATE utf8mb3_unicode_ci,
  `exception` longtext COLLATE utf8mb3_unicode_ci,
  `failed_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `follow_ups`
--

CREATE TABLE `follow_ups` (
  `id` bigint UNSIGNED NOT NULL,
  `student_account_id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `contacted_at` timestamp NOT NULL,
  `channel` enum('phone','whatsapp','email','in_person','other') NOT NULL,
  `feedback` text NOT NULL,
  `status_after` enum('in_progress','completed') NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

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

CREATE TABLE `jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `queue` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `payload` longtext COLLATE utf8mb3_unicode_ci,
  `attempts` tinyint UNSIGNED DEFAULT NULL,
  `reserved_at` int UNSIGNED DEFAULT NULL,
  `available_at` int UNSIGNED DEFAULT NULL,
  `created_at` int UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

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

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

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

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

CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb3_unicode_ci,
  `payload` longtext COLLATE utf8mb3_unicode_ci NOT NULL,
  `last_activity` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('rIK6MDnvFINnbkn5SKBar9PF6WrGPCEp94wzpabH', NULL, '175.141.179.118', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36', 'ZXlKcGRpSTZJa0pvZVVaTmVWcHBMMnhNUmpaTlltMXhTR0UxU1ZFOVBTSXNJblpoYkhWbElqb2lhVFYzZG1GMWIzQkZRbEYzTVdscGRuZzRkV3MwTURGNGQzWmxObmRhWld4QmQwSlhTMDVxVkUxYU5pOHljSGhxTjJSM05VWnpWVEJSVVZWS05GaGtRM056WTFReVZUSnpUbTlrVUVzdlRqaFViWFpWWlUweVEyMW1hV3RHV2tGeFFYVk9NVlJoTVZKTk5EWXpZVzh5UkRaQmJIRXpiamh1T1U5WWQxaEJOMVpXSzFGd1psaFNTRmN6TkdaWGMzUnpRMFJpVkRoeFVuSndOWEl2V0dsNFVITklPRk12TlVKbE1UTTBiR3R5UldSWVJHSkhVemRZY0ZNM1YxQjRjRkpSZGtaT1RuUlJiRkkxZFRZelZVZHNVMmhoY2xkdFUyUnpZVUZPYUZaUlFXVk9RVkZXWm5waWJsTmljblJDYlhGalluUTBaazlWTXl0UGQzUkJLMjVZYVd0Tk5rbDZkVzFoUTFjMldrRkthRU40VUZGb2VYcHdVMDF1YkZoclRpOXRVRkkyVldwVGIybDVjWFo0ZGtGSVJuTkhTWGtyYmtsR1RrWnBhbU51ZGpFaUxDSnRZV01pT2lKaVlUUTRZV0ZpWkRNM00yTm1aamxpT1RsaFpHWXhOVGcwT1dJM00yUXpPRGRpTWpKbFlXRmlNREkxTm1ReFpURTRZams0TWpJeVlqZzFaRGs1T1RObUlpd2lkR0ZuSWpvaUluMD0=', 1789805916);

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

--
-- Table structure for table `student_accounts`
--

CREATE TABLE `student_accounts` (
  `id` bigint UNSIGNED NOT NULL,
  `student_name` varchar(255) NOT NULL,
  `student_id` varchar(50) NOT NULL,
  `programme` varchar(255) NOT NULL,
  `intake_semester` varchar(100) NOT NULL,
  `invoice_number` varchar(100) DEFAULT NULL,
  `advice_reference` varchar(150) DEFAULT NULL,
  `advice_date` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `gross_amount` decimal(14,2) DEFAULT '0.00',
  `deductions` decimal(14,2) DEFAULT '0.00',
  `outstanding_amount` decimal(14,2) DEFAULT '0.00',
  `attachment_path` varchar(255) DEFAULT NULL,
  `attachment_name` varchar(255) DEFAULT NULL,
  `assigned_to` bigint UNSIGNED DEFAULT NULL,
  `assigned_by` bigint UNSIGNED DEFAULT NULL,
  `status` enum('unassigned','in_progress','completed') DEFAULT 'unassigned',
  `latest_follow_up_at` timestamp NULL DEFAULT NULL,
  `created_by` bigint UNSIGNED DEFAULT NULL,
  `updated_by` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `student_accounts`
--

INSERT INTO `student_accounts` (`id`, `student_name`, `student_id`, `programme`, `intake_semester`, `invoice_number`, `advice_reference`, `advice_date`, `due_date`, `gross_amount`, `deductions`, `outstanding_amount`, `attachment_path`, `attachment_name`, `assigned_to`, `assigned_by`, `status`, `latest_follow_up_at`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'JUNO ONG JIN HEE', 'B2699', 'E1451 BACHELOR OF INFORMATION TECHNOLOGY (NETWORKING AND SECURITY) (HONOURS)', '14/09/2026', 'B2699', NULL, '2026-08-29', '2026-09-14', 4360.00, 0.00, 4360.00, 'credit-control/lidEN6wZxLJD6R1GpVmy7W2yXd7VyueKcTzRjfwB.pdf', 'PA_B2699_E1451_2026SEP_20260917083041_0232.pdf', 11, 1, 'in_progress', NULL, 1, 1, '2026-09-19 12:17:28', '2026-09-19 12:22:39', NULL);

CREATE TABLE `account_attachments` (
  `id` bigint UNSIGNED NOT NULL,
  `student_account_id` bigint UNSIGNED NOT NULL,
  `original_name` varchar(255) NOT NULL,
  `stored_name` varchar(255) NOT NULL,
  `path` varchar(255) NOT NULL,
  `mime_type` varchar(150) DEFAULT NULL,
  `extension` varchar(20) DEFAULT NULL,
  `size_bytes` bigint UNSIGNED NOT NULL DEFAULT '0',
  `uploaded_by` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `account_attachments` VALUES (1,1,'PA_B2699_E1451_2026SEP_20260917083041_0232.pdf','lidEN6wZxLJD6R1GpVmy7W2yXd7VyueKcTzRjfwB.pdf','credit-control/lidEN6wZxLJD6R1GpVmy7W2yXd7VyueKcTzRjfwB.pdf','application/pdf','pdf',0,1,'2026-09-20 00:00:00','2026-09-20 00:00:00');

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

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

CREATE TABLE `system_settings` (
  `id` bigint UNSIGNED NOT NULL,
  `key` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `value` text COLLATE utf8mb3_unicode_ci,
  `is_secret` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

INSERT INTO `system_settings` (`id`, `key`, `value`, `is_secret`, `created_at`, `updated_at`) VALUES
(1, 'ai_enabled', 'true', 0, '2026-09-19 08:09:02', '2026-09-20 02:21:20'),
(2, 'ai_provider', 'ollama', 0, '2026-09-19 08:09:02', '2026-09-19 08:09:02'),
(3, 'ai_base_url', 'http://127.0.0.1:11434', 0, '2026-09-19 08:09:02', '2026-09-19 08:09:02'),
(4, 'ai_model', 'llama3.2:3b', 0, '2026-09-19 08:09:02', '2026-09-19 08:09:02');

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

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

CREATE TABLE `users` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('superadmin','admin','programme_coordinator') NOT NULL DEFAULT 'programme_coordinator',
  `must_change_password` tinyint(1) NOT NULL DEFAULT '1',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `role`, `must_change_password`, `is_active`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'PCCMS Superadmin', 'superadmin@creditcontrol.local', NULL, '$2y$12$x90qm04KK4MwhOanbjwCZ..brTrSh46THgKX9EUJvi2pEoynjQjMG', 'superadmin', 0, 1, NULL, '2026-09-19 08:09:02', '2026-09-19 12:12:42'),
(5, 'Assoc. Prof. Ts. Dr. Chng Chern Wei', 'cwchng.fcst@gmail.com', NULL, '$2y$12$adD8acWybYLMWeVmZkK3q.60r/wR9RniHkTDY1f6OoUaRScKVFQRW', 'superadmin', 1, 1, NULL, '2026-09-19 12:14:00', '2026-09-19 12:14:00'),
(6, 'Dr. Hamirul', 'Hamirul@gmail.com', NULL, '$2y$12$knzZk6RSzfRNJTEKTHUw2eYc9LkvGAsY4PHxgrL972Qms8041sC6y', 'programme_coordinator', 1, 1, NULL, '2026-09-19 12:19:21', '2026-09-19 12:19:21'),
(7, 'Dr. Mohd Ridhwan', 'ridhwan@gmail.com', NULL, '$2y$12$x46YylqIaNeTPAzCVt4g/e/gwe0lhpNyKhVqS/PAafO4PgZi2y5Ia', 'programme_coordinator', 1, 1, NULL, '2026-09-19 12:19:45', '2026-09-19 12:19:45'),
(8, 'Mohd Sukry', 'sukry@gmail.com', NULL, '$2y$12$.kdwhnkLfzDcQprKOZQNBeFFHqBzCNlICO8ZTOwkMarKqlQh5A0c6', 'programme_coordinator', 1, 1, NULL, '2026-09-19 12:20:04', '2026-09-19 12:20:04'),
(9, 'Cham Kar Loon', 'karloon@gmail.com', NULL, '$2y$12$RTzXyJTf5RpTJhXXknhhwOcdQFoWG0hGgPTKenaL0MniMwmJMkaR2', 'programme_coordinator', 1, 1, NULL, '2026-09-19 12:20:20', '2026-09-19 12:20:20'),
(10, 'Nur Sufura', 'sufura@gmail.com', NULL, '$2y$12$X0Bofk0rwRYqepOR9nXMee7.lXO4VjcYVefimCgMjr6XI91sEP5RO', 'programme_coordinator', 1, 1, NULL, '2026-09-19 12:20:37', '2026-09-19 12:20:37'),
(11, 'Dr. Chng Chern Wei', 'cwchng2u@yahoo.com.my', NULL, '$2y$12$A2flE5.YplSbf8NqAQhVhub5ahzadPopzMs//C89hJ25/sTa7YHo.', 'programme_coordinator', 1, 1, NULL, '2026-09-19 12:22:19', '2026-09-19 12:22:19');

--
-- Indexes for dumped tables
--

ALTER TABLE `account_attachments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `account_attachments_account_created_index` (`student_account_id`,`created_at`),
  ADD KEY `account_attachments_uploaded_by_foreign` (`uploaded_by`);

--
-- Indexes for table `audit_logs`
--
ALTER TABLE `audit_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `auditable_type` (`auditable_type`,`auditable_id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `cache`
--
ALTER TABLE `cache`
  ADD PRIMARY KEY (`key`);

--
-- Indexes for table `cache_locks`
--
ALTER TABLE `cache_locks`
  ADD PRIMARY KEY (`key`);

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

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

--
-- Indexes for table `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `queue` (`queue`);

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

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

--
-- Indexes for table `student_accounts`
--
ALTER TABLE `student_accounts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `invoice_number` (`invoice_number`),
  ADD KEY `due_date` (`due_date`),
  ADD KEY `status` (`status`),
  ADD KEY `assigned_to` (`assigned_to`),
  ADD KEY `assigned_by` (`assigned_by`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `updated_by` (`updated_by`);

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `audit_logs`
--
ALTER TABLE `audit_logs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

ALTER TABLE `account_attachments`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

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

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

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

--
-- AUTO_INCREMENT for table `system_settings`
--
ALTER TABLE `system_settings`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

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

--
-- Constraints for dumped tables
--

ALTER TABLE `account_attachments`
  ADD CONSTRAINT `account_attachments_account_foreign` FOREIGN KEY (`student_account_id`) REFERENCES `student_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `account_attachments_uploaded_by_foreign` FOREIGN KEY (`uploaded_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 `follow_ups`
--
ALTER TABLE `follow_ups`
  ADD CONSTRAINT `follow_ups_ibfk_1` FOREIGN KEY (`student_account_id`) REFERENCES `student_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `follow_ups_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `student_accounts`
--
ALTER TABLE `student_accounts`
  ADD CONSTRAINT `student_accounts_ibfk_1` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_accounts_ibfk_2` FOREIGN KEY (`assigned_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_accounts_ibfk_3` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `student_accounts_ibfk_4` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;
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 */;
