-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 18, 2026 at 05:49 PM
-- Server version: 8.0.46
-- 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: `amltdonl_tesgrowth`
--

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

--
-- Table structure for table `account_adjustments`
--

CREATE TABLE `account_adjustments` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `balance_delta` bigint NOT NULL DEFAULT '0',
  `deposits_delta` bigint NOT NULL DEFAULT '0',
  `profit_delta` bigint NOT NULL DEFAULT '0',
  `bonus_delta` bigint NOT NULL DEFAULT '0',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `request_token` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_adjustments`
--

INSERT INTO `account_adjustments` (`id`, `user_id`, `balance_delta`, `deposits_delta`, `profit_delta`, `bonus_delta`, `note`, `created_by`, `request_token`, `created_at`) VALUES
(1, 5, 29436000, 13734500, 15701500, 1725000, 'Deposit', 1, '040f13031333489ff677e76380fb028298e71a658ca43b6249ec833fd6560d1a', '2026-10-26 11:33:05'),
(2, 6, 500000, 100000, 400000, 0, 'Cl', 1, '270dbcf810ce8c6a914ce179f3c48e8fc65ee6a2dbf9fc2cf794de87bc4518d8', '2026-10-27 00:56:01'),
(3, 6, -900000, 0, 500000, 0, 'Cl', 1, '379e4982897a9f6e6332e7117f6f2a5f39e119befa1a8419fab4657f744d3e58', '2026-10-27 00:58:14');

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

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

CREATE TABLE `audit_logs` (
  `id` bigint UNSIGNED NOT NULL,
  `actor_id` bigint UNSIGNED DEFAULT NULL,
  `action` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_type` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_id` bigint UNSIGNED DEFAULT NULL,
  `details` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `audit_logs` (`id`, `actor_id`, `action`, `target_type`, `target_id`, `details`, `created_at`) VALUES
(1, 1, 'account.signed_in', 'user', 1, '{\"client_ip\":\"102.91.133.79\"}', '2026-10-24 22:12:22'),
(2, 1, 'account.signed_out', 'user', 1, '[]', '2026-10-24 22:16:24'),
(3, 2, 'account.registered', 'user', 2, '[]', '2026-10-24 22:28:41'),
(4, 3, 'account.registered', 'user', 3, '[]', '2026-10-26 07:19:31'),
(5, 4, 'account.registered', 'user', 4, '[]', '2026-10-26 09:25:22'),
(6, 1, 'account.signed_in', 'user', 1, '{\"client_ip\":\"41.186.133.221\"}', '2026-10-26 10:34:22'),
(7, 1, 'account.signed_in', 'user', 1, '{\"client_ip\":\"102.89.83.214\"}', '2026-10-26 11:04:43'),
(8, 1, 'account.signed_out', 'user', 1, '[]', '2026-10-26 11:12:29'),
(9, 5, 'account.registered', 'user', 5, '[]', '2026-10-26 11:14:36'),
(10, 5, 'account.profile_updated', 'user', 5, '[]', '2026-10-26 11:16:53'),
(11, 5, 'kyc.submitted', 'kyc', 1, '[]', '2026-10-26 11:19:54'),
(12, 5, 'account.signed_out', 'user', 5, '[]', '2026-10-26 11:21:10'),
(13, 1, 'account.signed_in', 'user', 1, '{\"client_ip\":\"102.89.83.214\"}', '2026-10-26 11:21:40'),
(14, 1, 'kyc.reviewed', 'kyc', 1, '{\"from\":\"pending\",\"to\":\"approved\",\"note\":\"\",\"payment_reference\":\"\"}', '2026-10-26 11:22:05'),
(15, 1, 'wallet.saved', 'wallet', 1, '{\"label\":\"XDep\",\"coin\":\"BTC\",\"network\":\"Bitcoin\",\"is_active\":1}', '2026-10-26 11:24:56'),
(16, 1, 'wallet.saved', 'wallet', 2, '{\"label\":\"XDep\",\"coin\":\"USDT\",\"network\":\"Tether(USDT)\",\"is_active\":1}', '2026-10-26 11:26:35'),
(17, 1, 'account.totals_updated', 'user', 5, '{\"before\":{\"balance\":0,\"deposits\":0,\"profit\":0,\"bonus\":0},\"after\":{\"balance\":29436000,\"deposits\":13734500,\"profit\":15701500,\"bonus\":1725000},\"note\":\"Deposit\"}', '2026-10-26 11:33:05'),
(18, 1, 'earning.credited', 'earning-credit', 1, '{\"user_id\":5,\"kind\":\"bonus\",\"amount_cents\":1725000}', '2026-10-26 11:33:29'),
(19, 5, 'account.signed_in', 'user', 5, '{\"client_ip\":\"102.89.83.214\"}', '2026-10-26 11:36:32'),
(20, 1, 'account.signed_in', 'user', 1, '{\"client_ip\":\"102.22.140.1\"}', '2026-10-27 00:36:46'),
(21, 6, 'account.registered', 'user', 6, '[]', '2026-10-27 00:49:39'),
(22, 1, 'account.signed_in', 'user', 1, '{\"client_ip\":\"102.22.140.1\"}', '2026-10-27 00:52:06'),
(23, 1, 'account.totals_updated', 'user', 6, '{\"before\":{\"balance\":0,\"deposits\":0,\"profit\":0,\"bonus\":0},\"after\":{\"balance\":500000,\"deposits\":100000,\"profit\":400000,\"bonus\":0},\"note\":\"Cl\"}', '2026-10-27 00:56:01'),
(24, 6, 'account.signed_in', 'user', 6, '{\"client_ip\":\"102.22.140.1\"}', '2026-10-27 00:56:26'),
(25, 6, 'earning.exchanged', 'earning-exchange', 1, '{\"kind\":\"profit\",\"amount_cents\":400000}', '2026-10-27 00:57:12'),
(26, 1, 'account.totals_updated', 'user', 6, '{\"before\":{\"balance\":900000,\"deposits\":100000,\"profit\":0,\"bonus\":0},\"after\":{\"balance\":0,\"deposits\":100000,\"profit\":500000,\"bonus\":0},\"note\":\"Cl\"}', '2026-10-27 00:58:14'),
(27, 6, 'earning.exchanged', 'earning-exchange', 2, '{\"kind\":\"profit\",\"amount_cents\":500000}', '2026-10-27 00:58:43'),
(28, 5, 'account.signed_in', 'user', 5, '{\"client_ip\":\"102.88.109.76\"}', '2026-10-27 15:34:40'),
(29, 5, 'account.signed_in', 'user', 5, '{\"client_ip\":\"140.248.44.140\"}', '2026-10-31 23:10:08');

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

--
-- Table structure for table `auth_attempts`
--

CREATE TABLE `auth_attempts` (
  `id` bigint UNSIGNED NOT NULL,
  `bucket_key` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `auth_attempts`
--

INSERT INTO `auth_attempts` (`id`, `bucket_key`, `created_at`) VALUES
(6, '0e71329c403fa1ec2b06af1f92eb43801bba33be536118e3e1d4725f72ef4b6d', '2026-10-26 10:34:22'),
(8, '17b91713fe76b0391321fe078d6a7d9ebb428d265099b5a0eca8f320a68bdf1d', '2026-10-26 11:04:43'),
(11, '17b91713fe76b0391321fe078d6a7d9ebb428d265099b5a0eca8f320a68bdf1d', '2026-10-26 11:21:40'),
(13, '17b91713fe76b0391321fe078d6a7d9ebb428d265099b5a0eca8f320a68bdf1d', '2026-10-26 11:36:32'),
(10, '185fb0e106b0e42eacd8ee8fc262ca3b5214d629f676c2855fac4325679b4b99', '2026-10-26 11:14:36'),
(17, '34df14c74f8ff97223144becb780535dd31c38b1ca153213974400170d8f8428', '2026-10-27 00:49:39'),
(2, '354817b56fd97f038036b22dca4d149aa313a29b40fcd008b6f6c3616be8f6b7', '2026-10-24 22:12:21'),
(7, '354817b56fd97f038036b22dca4d149aa313a29b40fcd008b6f6c3616be8f6b7', '2026-10-26 10:34:22'),
(9, '354817b56fd97f038036b22dca4d149aa313a29b40fcd008b6f6c3616be8f6b7', '2026-10-26 11:04:43'),
(12, '354817b56fd97f038036b22dca4d149aa313a29b40fcd008b6f6c3616be8f6b7', '2026-10-26 11:21:40'),
(16, '354817b56fd97f038036b22dca4d149aa313a29b40fcd008b6f6c3616be8f6b7', '2026-10-27 00:36:46'),
(19, '354817b56fd97f038036b22dca4d149aa313a29b40fcd008b6f6c3616be8f6b7', '2026-10-27 00:52:06'),
(5, '474b1dcc34cfe7e2ebd8f5f4d1248d37eb71e8f04fc81d90b98acf6740ae2ea9', '2026-10-26 09:25:22'),
(24, '4893d56094e8591488e039247226eb71c7f9d06520dae26d4f89a58960545e15', '2026-10-31 23:10:08'),
(15, '59eef2659ce5996e073f5101321b8a3afd943737306396d23f41ecec043aa494', '2026-10-27 00:36:46'),
(18, '59eef2659ce5996e073f5101321b8a3afd943737306396d23f41ecec043aa494', '2026-10-27 00:52:06'),
(20, '59eef2659ce5996e073f5101321b8a3afd943737306396d23f41ecec043aa494', '2026-10-27 00:56:26'),
(3, '7f6ffbeba1e186075c2f4d4e8df529fd6dc022eef919e2afa99a08da37373ab2', '2026-10-24 22:28:41'),
(22, '7fb872ba5388222a7730249e0cd160eb0cb0fa9cf43a79f3e5f69263ae5c2f8b', '2026-10-27 15:34:40'),
(21, 'a6f58cca3da7f6d1026a8ed7758b674a813f61edc0a14499f7e9df78fcd93bdc', '2026-10-27 00:56:26'),
(4, 'b4196b0d69b21ecebedb7f4fb43d60f02ff5bf0081d0be60bca7a9ab77843c67', '2026-10-26 07:19:31'),
(1, 'e2b0b1eb89b1f11d30e6e863e6aab30618b5602b75092127f99aabba2c471997', '2026-10-24 22:12:21'),
(14, 'fbf6c1f73d298ce0280ec9dd5d3470fd0dfe0c6490f781cdd8ef6897ecc56597', '2026-10-26 11:36:32'),
(23, 'fbf6c1f73d298ce0280ec9dd5d3470fd0dfe0c6490f781cdd8ef6897ecc56597', '2026-10-27 15:34:40'),
(25, 'fbf6c1f73d298ce0280ec9dd5d3470fd0dfe0c6490f781cdd8ef6897ecc56597', '2026-10-31 23:10:08');

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

--
-- Table structure for table `deposits`
--

CREATE TABLE `deposits` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `wallet_id` bigint UNSIGNED NOT NULL,
  `coin` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `network` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `wallet_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount_cents` bigint NOT NULL,
  `reference` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
  `proof_file_id` bigint UNSIGNED DEFAULT NULL,
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `review_note` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `reviewed_by` bigint UNSIGNED DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `request_token` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ;

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

--
-- Table structure for table `earning_credits`
--

CREATE TABLE `earning_credits` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `kind` enum('profit','bonus') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount_cents` bigint NOT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `request_token` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ;

--
-- Dumping data for table `earning_credits`
--

INSERT INTO `earning_credits` (`id`, `user_id`, `kind`, `amount_cents`, `note`, `created_by`, `request_token`, `created_at`) VALUES
(1, 5, 'bonus', 1725000, 'Welcome bonus', 1, '4896237dde0d63e877b6d38d0814a0715b829eefa30cec822e38ad60b46d8a5f', '2026-10-26 11:33:29');

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

--
-- Table structure for table `earning_exchanges`
--

CREATE TABLE `earning_exchanges` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `kind` enum('profit','bonus') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount_cents` bigint NOT NULL,
  `request_token` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ;

--
-- Dumping data for table `earning_exchanges`
--

INSERT INTO `earning_exchanges` (`id`, `user_id`, `kind`, `amount_cents`, `request_token`, `created_at`) VALUES
(1, 6, 'profit', 400000, '5cbdda2ff68ab080e313b88879cce0679e652a525272d7cfe3e884e91c444e9a', '2026-10-27 00:57:12'),
(2, 6, 'profit', 500000, '267824521e2138c55e3d5f857589441fd6d8b769444dac0b1809baddc3780805', '2026-10-27 00:58:43');

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

--
-- Table structure for table `kyc_submissions`
--

CREATE TABLE `kyc_submissions` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `dob` date NOT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `id_file_id` bigint UNSIGNED NOT NULL,
  `address_file_id` bigint UNSIGNED NOT NULL,
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `review_note` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `reviewed_by` bigint UNSIGNED DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kyc_submissions`
--

INSERT INTO `kyc_submissions` (`id`, `user_id`, `dob`, `address`, `phone`, `document_type`, `id_file_id`, `address_file_id`, `status`, `review_note`, `reviewed_by`, `reviewed_at`, `created_at`) VALUES
(1, 5, '1962-05-22', '5272 Fox Trace West Palm Beach, Florida 33417', '34387540468', 'drivers-license', 1, 2, 'approved', '', 1, '2026-10-26 11:22:05', '2026-10-26 11:19:54');

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

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

CREATE TABLE `ledger_entries` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `amount_cents` bigint NOT NULL,
  `entry_type` enum('deposit','withdrawal') COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_id` bigint UNSIGNED NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ;

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

--
-- Table structure for table `plans`
--

CREATE TABLE `plans` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `plans`
--

INSERT INTO `plans` (`id`, `name`, `description`, `is_active`, `created_at`) VALUES
(1, 'Basic', 'Basic account tier. Tier changes require administrator review and do not promise investment returns.', 1, '2026-10-24 18:07:16'),
(2, 'Standard', 'Standard account tier. Request this tier for administrator review; no automatic earnings are generated.', 1, '2026-10-24 18:07:16'),
(3, 'Platinum', 'Platinum account tier. Availability and account eligibility are reviewed by an administrator.', 1, '2026-10-24 18:07:16'),
(4, 'Diamond', 'Diamond account tier. This is an account classification, with no guaranteed returns or tier purchase fee.', 1, '2026-10-24 18:07:16');

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

--
-- Table structure for table `plan_requests`
--

CREATE TABLE `plan_requests` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `plan_id` bigint UNSIGNED NOT NULL,
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `review_note` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `reviewed_by` bigint UNSIGNED DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `request_token` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `service_payments`
--

CREATE TABLE `service_payments` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `kind` enum('pin','upgrade') COLLATE utf8mb4_unicode_ci NOT NULL,
  `plan_id` bigint UNSIGNED DEFAULT NULL,
  `wallet_id` bigint UNSIGNED NOT NULL,
  `coin` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `network` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `wallet_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount_cents` bigint NOT NULL,
  `reference` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `proof_file_id` bigint UNSIGNED NOT NULL,
  `status` enum('pending','approved','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `review_note` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `pin_ciphertext` text COLLATE utf8mb4_unicode_ci,
  `reviewed_by` bigint UNSIGNED DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `request_token` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ;

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

--
-- Table structure for table `support_messages`
--

CREATE TABLE `support_messages` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `sender_id` bigint UNSIGNED NOT NULL,
  `body` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `request_token` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `user_read_at` datetime DEFAULT NULL,
  `admin_read_at` datetime DEFAULT NULL
) ;

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

--
-- Table structure for table `uploads`
--

CREATE TABLE `uploads` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `purpose` enum('avatar','deposit-proof','kyc-id','kyc-address') COLLATE utf8mb4_unicode_ci NOT NULL,
  `stored_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `original_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mime_type` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `size_bytes` int UNSIGNED NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `uploads`
--

INSERT INTO `uploads` (`id`, `user_id`, `purpose`, `stored_name`, `original_name`, `mime_type`, `size_bytes`, `created_at`) VALUES
(1, 5, 'kyc-id', '1b015676665c478e378cc8fdd8b23081a18fa7df14a8c347.jpg', '965d5fc5-cacc-4f22-b825-7c4043fcd83a.jpeg', 'image/jpeg', 59127, '2026-10-26 11:19:54'),
(2, 5, 'kyc-address', 'aa799194e78219b1787eeca15c2d681c4fcd6f9300d8702e.jpg', 'a66600c3-b84f-4068-a358-5d00c179cf11.jpeg', 'image/jpeg', 178143, '2026-10-26 11:19:54');

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

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

CREATE TABLE `users` (
  `id` bigint UNSIGNED NOT NULL,
  `firstname` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lastname` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(254) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password_hash` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `pin_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `country` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `city` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `zip` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `currency` char(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'USD',
  `role` enum('user','admin') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'user',
  `status` enum('active','suspended') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `session_version` int UNSIGNED NOT NULL DEFAULT '1',
  `plan_id` bigint UNSIGNED DEFAULT NULL,
  `avatar_file_id` bigint UNSIGNED DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `firstname`, `lastname`, `email`, `password_hash`, `pin_hash`, `phone`, `address`, `country`, `city`, `zip`, `currency`, `role`, `status`, `session_version`, `plan_id`, `avatar_file_id`, `created_at`, `updated_at`) VALUES
(1, 'Administrator', 'Account', 'admin@growthplan.test', '$2y$10$x3XvTJxJz7VpfsmGgYKdBOnr7AuzRur8dITadeqjvpR1HddgHwEli', NULL, '', '', '', '', '', 'USD', 'admin', 'active', 1, NULL, NULL, '2026-10-24 18:07:16', '2026-10-24 22:12:22'),
(2, 'Kay', 'Aisosa', 'owieaisosa82@gmail.com', '$2y$10$DltR3rOzdhLNKeH4Nc/tNedTSAls8S9pfzFa8oBdRcU4YMRwICDDS', NULL, '1864852188', '', '', '', '', 'USD', 'user', 'active', 1, 1, NULL, '2026-10-24 22:28:41', '2026-10-24 22:28:41'),
(3, 'SFFSDF', 'sadasd', 'b2g4rrwc0c@ruutukf.com', '$2y$10$NQOpzn71qEVgzqYFlxIB0uIpuRPWjwcIUh7G1FGdna892DFQwMVWe', NULL, '+918765412333', '', '', '', '', 'USD', 'user', 'active', 1, 1, NULL, '2026-10-26 07:19:31', '2026-10-26 07:19:31'),
(4, 'Cameron', 'Vance', 'cameron.vance92@mx-mailsrv.com', '$2y$10$9LtIOMmPuacLRx8dcEFVSuoOBP7FfM6/PeNnmpFPhXeWADDVG7cCO', NULL, '6041617201', '', '', '', '', 'USD', 'user', 'active', 1, 1, NULL, '2026-10-26 09:25:22', '2026-10-26 09:25:22'),
(5, 'Frances', 'Pagnotta', 'f.pagmconcepts@yahoo.com', '$2y$10$bv1/hquFRMzkzDi/bH/Nm.ZFwhk2s2QgDmep1RQ9iSMaVrGLNiC.i', NULL, '34387540468', '', 'United States', '5272 Fox Trace West Palm Beach, Florida 33417', '33417', 'USD', 'user', 'active', 1, 1, NULL, '2026-10-26 11:14:36', '2026-10-26 11:16:53'),
(6, 'Kay', 'Kay', 'pierobarone6532@gmail.com', '$2y$10$1GRZWwLZWcx3tB73KhDViObasgiuWT1clgFpU7IkPXN9C/uGj9cai', NULL, '+161855188', '', '', '', '', 'USD', 'user', 'active', 1, 1, NULL, '2026-10-27 00:49:39', '2026-10-27 00:49:39');

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

--
-- Table structure for table `wallets`
--

CREATE TABLE `wallets` (
  `id` bigint UNSIGNED NOT NULL,
  `label` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `coin` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `network` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `wallets`
--

INSERT INTO `wallets` (`id`, `label`, `coin`, `network`, `address`, `is_active`, `created_at`) VALUES
(1, 'XDep', 'BTC', 'Bitcoin', 'bc1qk5mev73d3r6z4sx2gfjjelpl7mgfhtv278ltlg', 1, '2026-10-26 11:24:56'),
(2, 'XDep', 'USDT', 'Tether(USDT)', '0x0A4964b7C26c939Fbe9d572337a072c392d3F173', 1, '2026-10-26 11:26:35');

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

--
-- Table structure for table `withdrawals`
--

CREATE TABLE `withdrawals` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `method` enum('bank','crypto') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount_cents` bigint NOT NULL,
  `coin` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `network` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `wallet_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `bank_name` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `account_name` varchar(160) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `account_number` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `sort_code` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `status` enum('pending','processing','completed','rejected') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `review_note` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `payment_reference` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `reviewed_by` bigint UNSIGNED DEFAULT NULL,
  `reviewed_at` datetime DEFAULT NULL,
  `request_token` char(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `account_adjustments`
--
ALTER TABLE `account_adjustments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `adjustment_request_unique` (`user_id`,`request_token`),
  ADD KEY `adjustment_user_idx` (`user_id`,`id`),
  ADD KEY `created_by` (`created_by`);

--
-- Indexes for table `audit_logs`
--
ALTER TABLE `audit_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `audit_created_idx` (`created_at`),
  ADD KEY `audit_actor_fk` (`actor_id`);

--
-- Indexes for table `auth_attempts`
--
ALTER TABLE `auth_attempts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `auth_bucket_created_idx` (`bucket_key`,`created_at`),
  ADD KEY `auth_created_idx` (`created_at`);

--
-- Indexes for table `deposits`
--
ALTER TABLE `deposits`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `deposits_request_unique` (`user_id`,`request_token`),
  ADD UNIQUE KEY `deposits_transfer_unique` (`coin`,`network`,`reference`),
  ADD KEY `deposits_user_idx` (`user_id`,`created_at`),
  ADD KEY `deposits_status_idx` (`status`,`created_at`),
  ADD KEY `deposits_wallet_fk` (`wallet_id`),
  ADD KEY `deposits_proof_fk` (`proof_file_id`),
  ADD KEY `deposits_reviewer_fk` (`reviewed_by`);

--
-- Indexes for table `earning_credits`
--
ALTER TABLE `earning_credits`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `earning_credit_request_unique` (`user_id`,`request_token`),
  ADD KEY `earning_credit_user_kind_idx` (`user_id`,`kind`),
  ADD KEY `earning_credit_user_date_idx` (`user_id`,`created_at`),
  ADD KEY `earning_credit_admin_fk` (`created_by`);

--
-- Indexes for table `earning_exchanges`
--
ALTER TABLE `earning_exchanges`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `earning_exchange_request_unique` (`user_id`,`request_token`),
  ADD KEY `earning_exchange_user_kind_idx` (`user_id`,`kind`),
  ADD KEY `earning_exchange_user_date_idx` (`user_id`,`created_at`);

--
-- Indexes for table `kyc_submissions`
--
ALTER TABLE `kyc_submissions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `kyc_user_idx` (`user_id`,`created_at`),
  ADD KEY `kyc_status_idx` (`status`,`created_at`),
  ADD KEY `kyc_id_file_fk` (`id_file_id`),
  ADD KEY `kyc_address_file_fk` (`address_file_id`),
  ADD KEY `kyc_reviewer_fk` (`reviewed_by`);

--
-- Indexes for table `ledger_entries`
--
ALTER TABLE `ledger_entries`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ledger_source_unique` (`entry_type`,`source_id`),
  ADD KEY `ledger_user_idx` (`user_id`,`created_at`);

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

--
-- Indexes for table `plan_requests`
--
ALTER TABLE `plan_requests`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `plan_requests_token_unique` (`user_id`,`request_token`),
  ADD KEY `plan_requests_user_idx` (`user_id`,`created_at`),
  ADD KEY `plan_requests_status_idx` (`status`,`created_at`),
  ADD KEY `plan_requests_plan_fk` (`plan_id`),
  ADD KEY `plan_requests_reviewer_fk` (`reviewed_by`);

--
-- Indexes for table `service_payments`
--
ALTER TABLE `service_payments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `service_payment_token` (`user_id`,`request_token`),
  ADD KEY `service_payment_queue` (`kind`,`status`,`created_at`),
  ADD KEY `service_payment_owner` (`user_id`,`kind`,`created_at`),
  ADD KEY `service_payment_plan_fk` (`plan_id`),
  ADD KEY `service_payment_wallet_fk` (`wallet_id`),
  ADD KEY `service_payment_proof_fk` (`proof_file_id`),
  ADD KEY `service_payment_admin_fk` (`reviewed_by`);

--
-- Indexes for table `support_messages`
--
ALTER TABLE `support_messages`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `support_request_unique` (`user_id`,`sender_id`,`request_token`),
  ADD KEY `support_thread_idx` (`user_id`,`id`),
  ADD KEY `support_member_unread_idx` (`user_id`,`user_read_at`,`id`),
  ADD KEY `support_admin_unread_idx` (`admin_read_at`,`user_id`,`id`),
  ADD KEY `support_sender_fk` (`sender_id`);

--
-- Indexes for table `uploads`
--
ALTER TABLE `uploads`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uploads_stored_name_unique` (`stored_name`),
  ADD KEY `uploads_user_idx` (`user_id`);

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

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

--
-- Indexes for table `withdrawals`
--
ALTER TABLE `withdrawals`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `withdrawals_request_unique` (`user_id`,`request_token`),
  ADD KEY `withdrawals_user_idx` (`user_id`,`created_at`),
  ADD KEY `withdrawals_status_idx` (`status`,`created_at`),
  ADD KEY `withdrawals_reviewer_fk` (`reviewed_by`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `account_adjustments`
--
ALTER TABLE `account_adjustments`
  ADD CONSTRAINT `account_adjustments_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `account_adjustments_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);

--
-- Constraints for table `audit_logs`
--
ALTER TABLE `audit_logs`
  ADD CONSTRAINT `audit_actor_fk` FOREIGN KEY (`actor_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `deposits`
--
ALTER TABLE `deposits`
  ADD CONSTRAINT `deposits_proof_fk` FOREIGN KEY (`proof_file_id`) REFERENCES `uploads` (`id`),
  ADD CONSTRAINT `deposits_reviewer_fk` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `deposits_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `deposits_wallet_fk` FOREIGN KEY (`wallet_id`) REFERENCES `wallets` (`id`);

--
-- Constraints for table `earning_credits`
--
ALTER TABLE `earning_credits`
  ADD CONSTRAINT `earning_credit_admin_fk` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `earning_credit_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `earning_exchanges`
--
ALTER TABLE `earning_exchanges`
  ADD CONSTRAINT `earning_exchange_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `kyc_submissions`
--
ALTER TABLE `kyc_submissions`
  ADD CONSTRAINT `kyc_address_file_fk` FOREIGN KEY (`address_file_id`) REFERENCES `uploads` (`id`),
  ADD CONSTRAINT `kyc_id_file_fk` FOREIGN KEY (`id_file_id`) REFERENCES `uploads` (`id`),
  ADD CONSTRAINT `kyc_reviewer_fk` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `kyc_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `ledger_entries`
--
ALTER TABLE `ledger_entries`
  ADD CONSTRAINT `ledger_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `plan_requests`
--
ALTER TABLE `plan_requests`
  ADD CONSTRAINT `plan_requests_plan_fk` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`),
  ADD CONSTRAINT `plan_requests_reviewer_fk` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `plan_requests_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `service_payments`
--
ALTER TABLE `service_payments`
  ADD CONSTRAINT `service_payment_admin_fk` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `service_payment_plan_fk` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`),
  ADD CONSTRAINT `service_payment_proof_fk` FOREIGN KEY (`proof_file_id`) REFERENCES `uploads` (`id`),
  ADD CONSTRAINT `service_payment_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `service_payment_wallet_fk` FOREIGN KEY (`wallet_id`) REFERENCES `wallets` (`id`);

--
-- Constraints for table `support_messages`
--
ALTER TABLE `support_messages`
  ADD CONSTRAINT `support_owner_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `support_sender_fk` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `uploads`
--
ALTER TABLE `uploads`
  ADD CONSTRAINT `uploads_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_plan_fk` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`);

--
-- Constraints for table `withdrawals`
--
ALTER TABLE `withdrawals`
  ADD CONSTRAINT `withdrawals_reviewer_fk` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `withdrawals_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
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 */;
