-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 13, 2026
-- Server version: 11.4.10-MariaDB

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: `rcpulsam_investasiqurcp`
--

-- --------------------------------------------------------

--
-- Table structure for table `api_responses`
--

CREATE TABLE `api_responses` (
  `id` int(11) NOT NULL,
  `endpoint` varchar(255) NOT NULL,
  `request_data` text DEFAULT NULL,
  `response_data` text DEFAULT NULL,
  `response_code` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `deposit_log`
--

CREATE TABLE `deposit_log` (
  `id` int(11) NOT NULL,
  `id_user` varchar(255) NOT NULL,
  `jumlah` decimal(15,2) NOT NULL,
  `saldo_sebelum` decimal(15,2) NOT NULL,
  `saldo_sesudah` decimal(15,2) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `imbas_log`
--

CREATE TABLE `imbas_log` (
  `id` int(11) NOT NULL,
  `id_user` varchar(255) NOT NULL,
  `jumlah_imbas` decimal(15,2) NOT NULL,
  `saldo_sebelum` decimal(15,2) NOT NULL,
  `saldo_sesudah` decimal(15,2) NOT NULL,
  `persentase` decimal(5,2) DEFAULT NULL,
  `nominal_tetap` decimal(15,2) DEFAULT NULL,
  `periode` date NOT NULL,
  `keterangan` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `investasi_users`
--

CREATE TABLE `investasi_users` (
  `id` int(11) NOT NULL,
  `id_user` varchar(255) NOT NULL,
  `email_user` varchar(255) NOT NULL,
  `nama_user` varchar(255) NOT NULL,
  `saldo_aplikasi` decimal(15,2) DEFAULT 0.00,
  `saldo_investasi` decimal(15,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `shortcode_processed` tinyint(1) DEFAULT 0,
  `last_sync` timestamp NOT NULL DEFAULT current_timestamp(),
  `last_imbas` date DEFAULT NULL,
  `last_deposit_date` datetime DEFAULT NULL,
  `total_penarikan_bulan_ini` decimal(15,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `riwayat_investasi`
--

CREATE TABLE `riwayat_investasi` (
  `id` int(11) NOT NULL,
  `id_user` varchar(255) NOT NULL,
  `email_user` varchar(255) NOT NULL,
  `nama_user` varchar(255) NOT NULL,
  `jenis` enum('masuk','keluar','imbas') NOT NULL,
  `jumlah` decimal(15,2) NOT NULL,
  `saldo_sebelum` decimal(15,2) NOT NULL,
  `saldo_sesudah` decimal(15,2) NOT NULL,
  `keterangan` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `system_config`
--

CREATE TABLE `system_config` (
  `id` int(11) NOT NULL,
  `config_key` varchar(255) NOT NULL,
  `config_value` text 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 `system_config`
--

INSERT INTO `system_config` (`id`, `config_key`, `config_value`, `created_at`, `updated_at`) VALUES
(1, 'imbas_aktif', '1', NOW(), NOW()),
(2, 'imbas_tipe', 'tetap', NOW(), NOW()),
(3, 'imbas_nilai_persen', '0.5', NOW(), NOW()),
(4, 'imbas_nilai_tetap', '100', NOW(), NOW()),
(5, 'imbas_periode', 'harian', NOW(), NOW()),
(6, 'imbas_hari', '31', NOW(), NOW()),
(7, 'imbas_minimal_investasi', '0', NOW(), NOW()),
(8, 'imbas_maksimal_investasi', '100000000', NOW(), NOW()),
(9, 'imbas_terakhir_jalan', '2000-01-01', NOW(), NOW()),
(42, 'withdraw_policy_aktif', '1', NOW(), NOW()),
(43, 'withdraw_periode', 'hari', NOW(), NOW()),
(44, 'min_withdraw_days', '30', NOW(), NOW()),
(45, 'min_withdraw_months', '1', NOW(), NOW()),
(46, 'min_withdraw_years', '1', NOW(), NOW());

--
-- Indexes for dumped tables
--

--
-- Indexes for table `api_responses`
--
ALTER TABLE `api_responses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `deposit_log`
--
ALTER TABLE `deposit_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user` (`id_user`),
  ADD KEY `idx_created` (`created_at`);

--
-- Indexes for table `imbas_log`
--
ALTER TABLE `imbas_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user` (`id_user`),
  ADD KEY `idx_periode` (`periode`);

--
-- Indexes for table `investasi_users`
--
ALTER TABLE `investasi_users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_user` (`id_user`);

--
-- Indexes for table `riwayat_investasi`
--
ALTER TABLE `riwayat_investasi`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user` (`id_user`),
  ADD KEY `idx_created` (`created_at`);

--
-- Indexes for table `system_config`
--
ALTER TABLE `system_config`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `config_key` (`config_key`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `api_responses`
--
ALTER TABLE `api_responses`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `deposit_log`
--
ALTER TABLE `deposit_log`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `imbas_log`
--
ALTER TABLE `imbas_log`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `investasi_users`
--
ALTER TABLE `investasi_users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `riwayat_investasi`
--
ALTER TABLE `riwayat_investasi`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `system_config`
--
ALTER TABLE `system_config`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

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 */;