-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Aug 13, 2025 at 07:50 PM
-- Server version: 9.1.0
-- PHP Version: 8.3.14

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

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

--
-- Table structure for table `wp_tutor_orders`
--

DROP TABLE IF EXISTS `wp_tutor_orders`;
CREATE TABLE IF NOT EXISTS `wp_tutor_orders` (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `parent_id` bigint UNSIGNED DEFAULT '0',
  `transaction_id` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Transaction id from payment gateway',
  `user_id` bigint UNSIGNED NOT NULL,
  `order_type` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
  `order_status` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
  `payment_status` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
  `subtotal_price` decimal(13,2) NOT NULL,
  `total_price` decimal(13,2) NOT NULL,
  `net_payment` decimal(13,2) NOT NULL,
  `coupon_code` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
  `coupon_amount` decimal(13,2) DEFAULT NULL,
  `discount_type` enum('percentage','flat') COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
  `discount_amount` decimal(13,2) DEFAULT NULL,
  `discount_reason` text COLLATE utf8mb4_unicode_520_ci,
  `tax_type` varchar(50) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
  `tax_rate` decimal(13,2) DEFAULT NULL COMMENT 'Tax percentage',
  `tax_amount` decimal(13,2) DEFAULT NULL,
  `fees` decimal(13,2) DEFAULT NULL,
  `earnings` decimal(13,2) DEFAULT NULL,
  `refund_amount` decimal(13,2) DEFAULT NULL,
  `payment_method` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
  `payment_payloads` longtext COLLATE utf8mb4_unicode_520_ci,
  `note` text COLLATE utf8mb4_unicode_520_ci,
  `created_at_gmt` datetime NOT NULL,
  `created_by` bigint UNSIGNED NOT NULL,
  `updated_at_gmt` datetime DEFAULT NULL,
  `updated_by` bigint UNSIGNED NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_type` (`order_type`),
  KEY `payment_status` (`payment_status`),
  KEY `order_status` (`order_status`),
  KEY `transaction_id` (`transaction_id`(250))
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

--
-- Dumping data for table `wp_tutor_orders`
--

INSERT INTO `wp_tutor_orders` (`id`, `parent_id`, `transaction_id`, `user_id`, `order_type`, `order_status`, `payment_status`, `subtotal_price`, `total_price`, `net_payment`, `coupon_code`, `coupon_amount`, `discount_type`, `discount_amount`, `discount_reason`, `tax_type`, `tax_rate`, `tax_amount`, `fees`, `earnings`, `refund_amount`, `payment_method`, `payment_payloads`, `note`, `created_at_gmt`, `created_by`, `updated_at_gmt`, `updated_by`) VALUES
(1, 0, NULL, 1, 'single_order', 'incomplete', 'unpaid', 100.00, 50.00, 50.00, '', 0.00, 'flat', 50.00, 'Sale discount', NULL, NULL, NULL, NULL, NULL, NULL, 'manuall', NULL, NULL, '2025-08-05 21:00:47', 1, '2025-08-05 21:00:47', 1),
(2, 0, NULL, 7, 'single_order', 'incomplete', 'unpaid', 150.00, 150.00, 150.00, '', 0.00, NULL, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'manuall', NULL, NULL, '2025-08-11 09:52:32', 7, '2025-08-11 09:52:32', 7),
(3, 0, NULL, 11, 'single_order', 'complete', 'free', 0.00, 0.00, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'free', NULL, 'Free enrollment', '2025-08-11 14:21:35', 11, NULL, 11),
(4, 0, NULL, 11, 'single_order', 'complete', 'free', 0.00, 0.00, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'free', NULL, 'Free enrollment', '2025-08-11 16:25:33', 11, NULL, 11),
(5, 0, NULL, 11, 'single_order', 'complete', 'free', 0.00, 0.00, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'free', NULL, 'Free enrollment', '2025-08-11 16:26:54', 11, NULL, 11),
(6, 0, NULL, 11, 'single_order', 'complete', 'free', 0.00, 0.00, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'free', NULL, 'Free enrollment', '2025-08-12 18:03:22', 11, NULL, 11),
(7, 0, NULL, 11, 'single_order', 'complete', 'free', 0.00, 0.00, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'free', NULL, 'Free enrollment', '2025-08-12 23:43:18', 11, NULL, 11),
(8, 0, NULL, 11, 'single_order', 'complete', 'free', 0.00, 0.00, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'free', NULL, 'Free enrollment', '2025-08-13 14:04:04', 11, NULL, 11),
(9, 0, NULL, 11, 'single_order', 'complete', 'free', 0.00, 0.00, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'free', NULL, 'Free enrollment', '2025-08-13 19:49:47', 11, NULL, 11);
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 */;
