-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 18, 2026 at 04:10 AM
-- Server version: 10.11.16-MariaDB-ubu2404
-- PHP Version: 8.4.19

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

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

--
-- Table structure for table `angsuran_detail`
--

CREATE TABLE `angsuran_detail` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `angsuran_id` bigint(20) UNSIGNED NOT NULL,
  `semester` tinyint(4) DEFAULT NULL,
  `angsuran_ke` smallint(6) DEFAULT 1,
  `kode_biaya` varchar(255) NOT NULL,
  `kategori_biaya` varchar(50) DEFAULT NULL,
  `komponen` varchar(255) NOT NULL,
  `nominal_awal` int(11) NOT NULL DEFAULT 0,
  `potongan` int(11) NOT NULL DEFAULT 0,
  `total` int(11) NOT NULL,
  `dibayar` int(11) NOT NULL DEFAULT 0,
  `sisa` int(11) NOT NULL,
  `status` varchar(20) DEFAULT 'aktif',
  `tanggal_angsuran` date DEFAULT NULL,
  `tanggal_bayar` date DEFAULT NULL,
  `metode_pembayaran_id` bigint(20) UNSIGNED DEFAULT NULL,
  `metode_pembayaran_label` varchar(255) DEFAULT NULL,
  `rencana_valid` enum('pending','valid') NOT NULL DEFAULT 'pending',
  `rencana_valid_at` timestamp NULL DEFAULT NULL,
  `rencana_valid_by` bigint(20) UNSIGNED DEFAULT NULL,
  `pembayaran_valid` enum('pending','valid') NOT NULL DEFAULT 'pending',
  `pembayaran_valid_at` timestamp NULL DEFAULT NULL,
  `pembayaran_valid_by` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `angsuran_detail`
--

INSERT INTO `angsuran_detail` (`id`, `angsuran_id`, `semester`, `angsuran_ke`, `kode_biaya`, `kategori_biaya`, `komponen`, `nominal_awal`, `potongan`, `total`, `dibayar`, `sisa`, `status`, `tanggal_angsuran`, `tanggal_bayar`, `metode_pembayaran_id`, `metode_pembayaran_label`, `rencana_valid`, `rencana_valid_at`, `rencana_valid_by`, `pembayaran_valid`, `pembayaran_valid_at`, `pembayaran_valid_by`, `created_at`, `updated_at`) VALUES
(12218, 176, 2, 3, 'SPP-S2-B3', 'SPP', 'SPP S2 Bln 3', 600000, 0, 600000, 0, 600000, 'aktif', '2026-05-10', NULL, NULL, NULL, 'valid', NULL, NULL, 'pending', NULL, NULL, '2026-02-25 19:56:27', '2026-02-25 19:56:27'),
(12219, 176, 2, 4, 'SPP-S2-B4', 'SPP', 'SPP S2 Bln 4', 600000, 0, 600000, 0, 600000, 'aktif', '2026-06-10', NULL, NULL, NULL, 'valid', NULL, NULL, 'pending', NULL, NULL, '2026-02-25 19:56:27', '2026-02-25 19:56:27'),
(12220, 176, 2, 5, 'SPP-S2-B5', 'SPP', 'SPP S2 Bln 5', 600000, 0, 600000, 0, 600000, 'aktif', '2026-07-10', NULL, NULL, NULL, 'valid', NULL, NULL, 'pending', NULL, NULL, '2026-02-25 19:56:27', '2026-02-25 19:56:27'),
(12221, 176, 2, 6, 'SPP-S2-B6', 'SPP', 'SPP S2 Bln 6', 600000, 0, 600000, 0, 600000, 'aktif', '2026-08-10', NULL, NULL, NULL, 'valid', NULL, NULL, 'pending', NULL, NULL, '2026-02-25 19:56:27', '2026-02-25 19:56:27');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `angsuran_detail`
--
ALTER TABLE `angsuran_detail`
  ADD PRIMARY KEY (`id`),
  ADD KEY `angsuran_detail_angsuran_id_foreign` (`angsuran_id`),
  ADD KEY `angsuran_detail_rencana_valid_by_foreign` (`rencana_valid_by`),
  ADD KEY `angsuran_detail_pembayaran_valid_by_foreign` (`pembayaran_valid_by`),
  ADD KEY `fk_angsuran_details_metode` (`metode_pembayaran_id`),
  ADD KEY `idx_angsuran_detail_semester` (`semester`),
  ADD KEY `idx_angsuran_detail_status` (`status`),
  ADD KEY `idx_angsuran_detail_kategori` (`kategori_biaya`);

--
-- AUTO_INCREMENT for dumped tables
--

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `angsuran_detail`
--
ALTER TABLE `angsuran_detail`
  ADD CONSTRAINT `angsuran_detail_angsuran_id_foreign` FOREIGN KEY (`angsuran_id`) REFERENCES `angsuran` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `angsuran_detail_pembayaran_valid_by_foreign` FOREIGN KEY (`pembayaran_valid_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `angsuran_detail_rencana_valid_by_foreign` FOREIGN KEY (`rencana_valid_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_angsuran_details_metode` FOREIGN KEY (`metode_pembayaran_id`) REFERENCES `metode_pembayaran` (`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 */;
