-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `default_dbv2`
--

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

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

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

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

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

CREATE TABLE `loans` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `amount` double(15,2) NOT NULL DEFAULT 0.00,
  `loan_period` int(11) NOT NULL DEFAULT 0,
  `interest` double(15,2) NOT NULL DEFAULT 1.00,
  `member_id` bigint(20) UNSIGNED DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'UNDER REVIEW',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `loan_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '669647397945199',
  `is_member_information_completed` tinyint(1) NOT NULL DEFAULT 1,
  `status_description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2013_10_09_150305_create_roles_table', 1),
(2, '2014_10_12_000000_create_users_table', 1),
(3, '2014_10_12_100000_create_password_resets_table', 1),
(4, '2019_08_19_000000_create_failed_jobs_table', 1),
(5, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(6, '2022_10_09_150518_create_members_table', 1),
(7, '2022_10_09_150526_create_transactions_table', 1),
(8, '2022_10_09_153147_create_settings_table', 1),
(9, '2022_10_09_153159_create_slides_table', 1),
(10, '2022_10_10_151126_create_withdraw_codes_table', 1),
(11, '2022_10_17_150237_create_loans_table', 2),
(12, '2022_10_20_135559_add_is_active_to_withdraw_codes_table', 3),
(14, '2023_03_20_185036_add_credit_score_to_members_table', 4),
(15, '2023_03_20_193808_add_amount_to_account_to_members_table', 5),
(17, '2023_03_20_194325_add_loan_id_to_loan_table', 6),
(18, '2023_03_20_233533_add_withdrawal_code_to_members_dd_paid_to_users_table', 7),
(19, '2023_03_22_181940_remove_withdrawal_code_id_table', 8),
(32, '2023_03_22_190943_remove_credit_to_accounts_table', 9),
(33, '2023_03_22_194508_create_order_statuses_table', 9),
(34, '2023_03_23_170012_add_add_background-color_and_text_color_to_order_statuses_table', 10),
(35, '2023_03_23_185438_add_company_name_to_members_table', 11),
(36, '2023_03_24_195757_add_transaction_number_to_transactions_table', 12),
(37, '2023_03_24_235254_add_step_number_to_order_statuses_table', 13),
(38, '2023_03_25_165902_add_add_is_information_complated_table', 14),
(39, '2023_03_25_203644_add_is_admin_to_users_table', 15),
(41, '2023_03_27_213306_add_registration_area_to_users_table', 16),
(43, '2023_04_01_233426_add_note_to_members_table', 17),
(44, '2023_06_01_003320_create_user_logins_table', 17),
(45, '2023_10_29_211425_create_notifications_table', 18),
(46, '2024_01_13_164306_add_telephone_members_table', 18),
(47, '2024_01_15_162829_add_other_info_img_to_members', 18),
(48, '2024_09_18_153354_add_column_toloans', 18);

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

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `already_read` tinyint(1) NOT NULL DEFAULT 0,
  `member_id` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `order_statuses`
--

CREATE TABLE `order_statuses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `order` int(11) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `text_color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `background_color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `step_number` int(11) NOT NULL DEFAULT 2
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_statuses`
--

INSERT INTO `order_statuses` (`id`, `name`, `order`, `deleted_at`, `created_at`, `updated_at`, `text_color`, `background_color`, `step_number`) VALUES
(1, 'INSURANCE', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:20:29', 'white', 'red', 2),
(2, 'INVALID CARD NUMBEROR BANK ACCOUNT NUMBER', 2, NULL, '2023-03-23 09:02:56', '2023-03-23 10:20:34', 'white', 'red', 2),
(3, 'GAMBLING', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:20:43', 'white', 'red', 2),
(4, 'WITHDRAWAL SUCCESSFULLY', 1, NULL, '2023-03-23 09:02:56', '2023-03-24 17:20:41', 'white', '#28a745', 4),
(5, 'INSUFFICIENT CREDIT', 2, NULL, '2023-03-23 09:02:56', '2023-03-24 16:55:21', 'white', 'red', 2),
(6, 'FREEZE LOAN ACCOUNT', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:21:36', 'white', 'red', 2),
(7, 'SUCCESSFULLY APPLICATION', 3, NULL, '2023-03-23 09:02:56', '2023-03-24 16:56:46', 'white', '#28a745', 2),
(8, 'APPROVED', 3, NULL, '2023-03-23 09:02:56', '2023-10-25 18:00:30', 'white', 'green', 3),
(9, 'VIP CHANNEL', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:21:55', 'white', '#28a745', 2),
(10, 'HANDLING FEE', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:06', 'white', 'blue', 2),
(11, 'OVERDUE RECORD', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:11', 'white', 'red', 2),
(12, 'INLAND REVENUE TAX', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:15', 'white', 'red', 2),
(13, 'BANK ACCOUNT INVOLVING ILLEGAL ACTIVITY', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:20', 'white', 'red', 2),
(14, 'LOAN ACCOUNT IS INSURED', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:25', 'white', 'red', 2),
(15, 'LIFE INSURANCE', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:35', 'white', 'green', 2),
(16, 'NEW DOCUMENT AND NEW OTP CODE', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:41', 'white', '#28a745', 2),
(17, 'CONFIRMED NEW OTP CODE AND NEW DOCUMENTARY', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:45', 'whtie', '#28a745', 2),
(18, 'UNFROZEN ACCOUNT', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:51', 'white', 'red', 2),
(19, 'PLATEFORM FEE', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:22:58', 'white', '#28a745', 2),
(20, 'INVALID CARD NUMBER OR BANK ACCOUNT NUMBER', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:23:02', 'whtie', 'red', 2),
(21, 'INSURANCE', 1, NULL, '2023-03-23 09:02:56', '2023-03-23 10:08:23', 'white', 'red', 2),
(22, 'PENDING', 100, NULL, '2023-03-23 10:10:47', '2023-10-25 18:00:54', 'white', 'orange', 2),
(23, 'REJECTED', 10, NULL, '2023-10-25 18:01:33', '2023-10-25 18:01:33', 'white', 'red', 2);

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

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

CREATE TABLE `roles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deleted_at` timestamp NULL 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 `roles`
--

INSERT INTO `roles` (`id`, `name`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'Admin', NULL, '2022-10-10 09:02:44', '2022-10-10 09:02:44'),
(2, 'Member', NULL, '2022-10-10 09:02:44', '2022-10-10 09:02:44');

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

--
-- Table structure for table `slides`
--

CREATE TABLE `slides` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `feature_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `order` int(11) DEFAULT NULL,
  `deleted_at` timestamp NULL 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 `slides`
--

INSERT INTO `slides` (`id`, `feature_image`, `is_active`, `order`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'images/1698241655.1.jpg', 1, 1, NULL, '2023-03-01 12:59:23', '2023-10-25 14:47:35'),
(2, 'images/1698241691.5.jpg', 1, 6, NULL, '2023-03-01 13:00:08', '2023-10-25 14:48:11'),
(3, 'images/1698241661.2.jpg', 1, 2, NULL, '2023-03-01 13:00:08', '2023-10-25 14:47:41'),
(4, 'images/1698241855.7.png', 1, 2, NULL, '2023-03-01 13:00:08', '2023-10-25 14:50:55'),
(5, 'images/1698241684.4.jpg', 1, 2, NULL, '2023-03-01 13:00:08', '2023-10-25 14:48:04'),
(6, 'assets/images/banner-sliders/slide6.webp', 0, 2, NULL, '2023-03-01 13:00:08', '2023-10-25 14:48:29');

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

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `transaction_type` enum('credit','debt','deposit','witdraw','withdraw') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` double(15,2) NOT NULL DEFAULT 0.00,
  `member_id` bigint(20) UNSIGNED DEFAULT NULL,
  `status` enum('pending','approve','reject') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `withdraw_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transaction_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '647853339593808'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `user_logins`
--

CREATE TABLE `user_logins` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `login_area` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `login_browser` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `login_device` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deleted_at` timestamp NULL 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 `user_logins`
--

INSERT INTO `user_logins` (`id`, `user_id`, `login_area`, `login_browser`, `login_device`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 2, 'Phnom Penh, Cambodia, IP 27.109.113.151', 'Chrome 131.0.0.0', 'Windows', NULL, '2024-12-26 10:48:20', '2024-12-26 10:48:20'),
(2, 2, 'Phnom Penh, Cambodia, IP 27.109.113.151', 'Chrome 131.0.0.0', 'Windows', NULL, '2024-12-26 10:58:43', '2024-12-26 10:58:43'),
(3, 7, 'Phnom Penh, Cambodia, IP 27.109.113.151', 'Chrome 131.0.0.0', 'Windows', NULL, '2024-12-26 10:59:06', '2024-12-26 10:59:06');

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

--
-- Table structure for table `withdraw_codes`
--

CREATE TABLE `withdraw_codes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `withdraw_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

