-- RaseedNow final MySQL database with test data
-- Import directly into the existing database selected in phpMyAdmin.
-- It operates only on the database currently selected in phpMyAdmin.
-- Generated: 2026-08-01

-- RaseedNow MySQL import FIXED for phpMyAdmin
-- sessions/cache data intentionally skipped; they are runtime-only local data.

CREATE TABLE `admin_customer_notes` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` BIGINT UNSIGNED NOT NULL,
  `admin_id` BIGINT UNSIGNED NOT NULL,
  `type` VARCHAR(255) NOT NULL DEFAULT 'general',
  `visibility` VARCHAR(255) NOT NULL DEFAULT 'internal',
  `body` LONGTEXT NOT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `audit_logs` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` VARCHAR(255) NOT NULL,
  `actor_user_id` BIGINT UNSIGNED NULL,
  `action` VARCHAR(255) NOT NULL,
  `subject_type` VARCHAR(255) NULL,
  `subject_id` BIGINT UNSIGNED NULL,
  `ip_address` VARCHAR(255) NULL,
  `user_agent` VARCHAR(255) NULL,
  `metadata` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `banners` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `title_ar` VARCHAR(255) NOT NULL,
  `title_en` VARCHAR(255) NOT NULL,
  `subtitle_ar` VARCHAR(255) NULL,
  `subtitle_en` VARCHAR(255) NULL,
  `cta_label_ar` VARCHAR(255) NULL,
  `cta_label_en` VARCHAR(255) NULL,
  `url` VARCHAR(255) NOT NULL DEFAULT '#',
  `tone` VARCHAR(255) NOT NULL DEFAULT 'emerald',
  `sort_order` INT NOT NULL DEFAULT '0',
  `is_active` TINYINT(1) NOT NULL DEFAULT '1',
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  `image_path` VARCHAR(255) NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `banners` (`id`, `title_ar`, `title_en`, `subtitle_ar`, `subtitle_en`, `cta_label_ar`, `cta_label_en`, `url`, `tone`, `sort_order`, `is_active`, `created_at`, `updated_at`, `image_path`) VALUES
(1, 'اشحن ألعابك في خطوات قليلة', 'Top up your games in a few steps', 'اختيار سريع، تسعير واضح، وتنفيذ قابل للتتبع من لوحة الإدارة.', 'Fast selection, clear pricing, and trackable fulfillment.', 'ابدأ الشحن', 'Start top-up', '#', 'emerald', 1, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/hero/hero-gaming-original.png'),
(2, 'بطاقات رقمية بمخزون محمي', 'Protected digital code inventory', 'الأكواد مشفرة ولا يتم بيع الكود مرتين.', 'Codes are encrypted and reserved safely.', 'استكشف البطاقات', 'Browse cards', '#', 'indigo', 2, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/hero/hero-digital-original.png');

CREATE TABLE `cache` (
  `key` VARCHAR(255) NOT NULL,
  `value` LONGTEXT NOT NULL,
  `expiration` INT NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Runtime table cache_locks: data skipped.

CREATE TABLE `categories` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `parent_id` BIGINT UNSIGNED NULL,
  `name_ar` VARCHAR(255) NOT NULL,
  `name_en` VARCHAR(255) NOT NULL,
  `slug` VARCHAR(255) NOT NULL,
  `icon` VARCHAR(255) NOT NULL DEFAULT 'grid',
  `color` VARCHAR(255) NOT NULL DEFAULT '#12312b',
  `description_ar` LONGTEXT NULL,
  `description_en` LONGTEXT NULL,
  `sort_order` INT NOT NULL DEFAULT '0',
  `is_featured` TINYINT(1) NOT NULL DEFAULT '0',
  `is_active` TINYINT(1) NOT NULL DEFAULT '1',
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `categories` (`id`, `parent_id`, `name_ar`, `name_en`, `slug`, `icon`, `color`, `description_ar`, `description_en`, `sort_order`, `is_featured`, `is_active`, `created_at`, `updated_at`) VALUES
(1, NULL, 'شحن الألعاب', 'Game Top-up', 'games', 'zap', '#1769d1', NULL, NULL, 1, 1, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26'),
(2, NULL, 'بطاقات الألعاب', 'Game Cards', 'gift-cards', 'gift', '#1769d1', NULL, NULL, 2, 1, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26'),
(3, NULL, 'اشتراكات التطبيقات', 'Subscriptions', 'subscriptions', 'badge', '#1769d1', NULL, NULL, 3, 1, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26'),
(4, NULL, 'الدفع الإلكتروني', 'E-payment', 'deals', 'spark', '#1769d1', NULL, NULL, 4, 0, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26'),
(5, NULL, 'سوشيال ميديا', 'Social Media', 'social-media', 'users', '#1769d1', NULL, NULL, 5, 0, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26'),
(6, NULL, 'مفاتيح التفعيل', 'Activation Keys', 'activation-keys', 'key', '#1769d1', NULL, NULL, 6, 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(7, NULL, 'التسوق', 'Shopping', 'shopping', 'bag', '#1769d1', NULL, NULL, 7, 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(8, NULL, 'بطاقات الإتصالات', 'Telecom Cards', 'telecom', 'phone', '#1769d1', NULL, NULL, 8, 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27');

CREATE TABLE `countries` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `name_ar` VARCHAR(255) NOT NULL,
  `name_en` VARCHAR(255) NOT NULL,
  `iso_code` VARCHAR(255) NOT NULL,
  `dial_code` VARCHAR(255) NOT NULL,
  `flag_code` VARCHAR(255) NOT NULL,
  `default_locale` VARCHAR(255) NOT NULL DEFAULT 'ar',
  `default_currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `tax_basis_points` INT NOT NULL DEFAULT '0',
  `min_order_minor` INT NOT NULL DEFAULT '0',
  `is_active` TINYINT(1) NOT NULL DEFAULT '1',
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `countries` (`id`, `name_ar`, `name_en`, `iso_code`, `dial_code`, `flag_code`, `default_locale`, `default_currency_code`, `tax_basis_points`, `min_order_minor`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'مصر', 'Egypt', 'EG', '+20', 'EG', 'ar', 'EGP', 0, 0, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26'),
(2, 'السعودية', 'Saudi Arabia', 'SA', '+966', 'SA', 'ar', 'SAR', 0, 0, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26');

CREATE TABLE `coupon_redemptions` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `coupon_id` BIGINT UNSIGNED NOT NULL,
  `order_id` BIGINT UNSIGNED NOT NULL,
  `user_id` BIGINT UNSIGNED NULL,
  `customer_email` VARCHAR(255) NULL,
  `discount_minor` INT NOT NULL,
  `snapshot` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `coupons` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` VARCHAR(255) NOT NULL,
  `name_ar` VARCHAR(255) NOT NULL,
  `name_en` VARCHAR(255) NULL,
  `type` VARCHAR(255) NOT NULL DEFAULT 'fixed',
  `value_minor` INT NOT NULL DEFAULT '0',
  `percent_off` INT NOT NULL DEFAULT '0',
  `max_discount_minor` INT NULL,
  `min_subtotal_minor` INT NOT NULL DEFAULT '0',
  `usage_limit` INT NULL,
  `used_count` INT NOT NULL DEFAULT '0',
  `once_per_customer` TINYINT(1) NOT NULL DEFAULT '1',
  `is_active` TINYINT(1) NOT NULL DEFAULT '1',
  `starts_at` DATETIME NULL,
  `ends_at` DATETIME NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `coupons` (`id`, `code`, `name_ar`, `name_en`, `type`, `value_minor`, `percent_off`, `max_discount_minor`, `min_subtotal_minor`, `usage_limit`, `used_count`, `once_per_customer`, `is_active`, `starts_at`, `ends_at`, `created_at`, `updated_at`) VALUES
(1, 'WELCOME10', 'خصم ترحيبي 10%', 'Welcome 10% off', 'percent', 0, 10, 10000, 1000, 100, 0, 1, 1, NULL, NULL, '2026-07-16 18:16:26', '2026-07-16 18:16:26'),
(2, 'SAVE50', 'خصم 50 جنيه', 'Save 50 EGP', 'fixed', 5000, 0, NULL, 20000, 50, 0, 0, 1, NULL, NULL, '2026-07-16 18:16:26', '2026-07-16 18:16:26');

CREATE TABLE `currencies` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` VARCHAR(255) NOT NULL,
  `name_ar` VARCHAR(255) NOT NULL,
  `name_en` VARCHAR(255) NOT NULL,
  `symbol` VARCHAR(255) NOT NULL,
  `minor_unit` INT NOT NULL DEFAULT '2',
  `symbol_position` VARCHAR(255) NOT NULL DEFAULT 'after',
  `exchange_rate` VARCHAR(255) NOT NULL DEFAULT '1',
  `rate_updated_at` DATETIME NULL,
  `min_payment_minor` INT NOT NULL DEFAULT '0',
  `max_payment_minor` INT NOT NULL DEFAULT '100000000',
  `is_base` TINYINT(1) NOT NULL DEFAULT '0',
  `is_active` TINYINT(1) NOT NULL DEFAULT '1',
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `currencies` (`id`, `code`, `name_ar`, `name_en`, `symbol`, `minor_unit`, `symbol_position`, `exchange_rate`, `rate_updated_at`, `min_payment_minor`, `max_payment_minor`, `is_base`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'EGP', 'جنيه مصري', 'Egyptian Pound', 'ج.م', 2, 'after', 1, '2026-07-16 18:16:25', 0, 100000000, 1, 1, '2026-07-16 18:16:25', '2026-07-16 18:16:25'),
(2, 'SAR', 'ريال سعودي', 'Saudi Riyal', 'ر.س', 2, 'after', 12.8, '2026-07-16 18:16:25', 0, 100000000, 0, 1, '2026-07-16 18:16:25', '2026-07-16 18:16:25'),
(3, 'AED', 'درهم إماراتي', 'UAE Dirham', 'د.إ', 2, 'after', 13.1, '2026-07-16 18:16:26', 0, 100000000, 0, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26'),
(4, 'USD', 'دولار أمريكي', 'US Dollar', '$', 2, 'after', 48.2, '2026-07-16 18:16:26', 0, 100000000, 0, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26'),
(5, 'EUR', 'يورو', 'Euro', '€', 2, 'after', 52.1, '2026-07-16 18:16:26', 0, 100000000, 0, 1, '2026-07-16 18:16:26', '2026-07-16 18:16:26');

CREATE TABLE `customer_notifications` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` BIGINT UNSIGNED NULL,
  `order_id` BIGINT UNSIGNED NULL,
  `type` VARCHAR(255) NOT NULL,
  `title` VARCHAR(255) NOT NULL,
  `body` LONGTEXT NOT NULL,
  `data` LONGTEXT NULL,
  `read_at` DATETIME NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `customer_notifications` (`id`, `user_id`, `order_id`, `type`, `title`, `body`, `data`, `read_at`, `created_at`, `updated_at`) VALUES
(1, 2, 2, 'order_created', 'تم إنشاء طلبك', 'استلمنا طلبك رقم RN-260720-1002 وسنقوم بمتابعته حتى التسليم.', '{"order_number":"RN-260720-1002","order_url":"http:\\/\\/127.0.0.1:8014\\/orders\\/2"}', NULL, '2026-07-20 19:01:20', '2026-07-20 19:01:20');

CREATE TABLE `failed_jobs` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` VARCHAR(255) NOT NULL,
  `connection` VARCHAR(255) NOT NULL,
  `queue` VARCHAR(255) NOT NULL,
  `payload` LONGTEXT NOT NULL,
  `exception` LONGTEXT NOT NULL,
  `failed_at` DATETIME NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `favorites` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` BIGINT UNSIGNED NOT NULL,
  `game_id` BIGINT UNSIGNED NOT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `games` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `category_id` BIGINT UNSIGNED NOT NULL,
  `name_ar` VARCHAR(255) NOT NULL,
  `name_en` VARCHAR(255) NOT NULL,
  `slug` VARCHAR(255) NOT NULL,
  `publisher` VARCHAR(255) NULL,
  `platform` VARCHAR(255) NOT NULL DEFAULT 'mobile',
  `cover_color` VARCHAR(255) NOT NULL DEFAULT '#14213d',
  `description_ar` LONGTEXT NULL,
  `description_en` LONGTEXT NULL,
  `required_fields` LONGTEXT NULL,
  `faq` LONGTEXT NULL,
  `is_featured` TINYINT(1) NOT NULL DEFAULT '0',
  `is_active` TINYINT(1) NOT NULL DEFAULT '1',
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  `image_path` VARCHAR(255) NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `games` (`id`, `category_id`, `name_ar`, `name_en`, `slug`, `publisher`, `platform`, `cover_color`, `description_ar`, `description_en`, `required_fields`, `faq`, `is_featured`, `is_active`, `created_at`, `updated_at`, `image_path`) VALUES
(1, 1, 'ببجي', 'PUBG Mobile', 'pubg-mobile', 'Tencent', 'mobile', '#1769d1', 'ببجي بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 1, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-109.webp'),
(2, 1, 'فري فاير', 'Free Fire', 'free-fire', 'Garena', 'mobile', '#1769d1', 'فري فاير بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 1, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-108.webp'),
(3, 2, 'بلايستيشن ستور', 'PlayStation Store', 'playstation-store', 'Sony', 'mobile', '#1769d1', 'بلايستيشن ستور بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 1, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-119.webp'),
(4, 2, 'إكس بوكس', 'Xbox Store', 'xbox-store', 'Microsoft', 'mobile', '#1769d1', 'إكس بوكس بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 1, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-121.webp'),
(5, 2, 'بطاقات ستيم', 'Steam Wallet', 'steam-wallet', 'Valve', 'mobile', '#1769d1', 'بطاقات ستيم بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-117.webp'),
(6, 1, 'فالورانت', 'Valorant', 'valorant', 'Riot Games', 'mobile', '#1769d1', 'فالورانت بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-114.webp'),
(7, 4, 'عملات تيكتوك', 'TikTok Coins', 'tiktok-epayment', 'TikTok', 'mobile', '#1769d1', 'عملات تيكتوك بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-126.webp'),
(8, 1, 'موبايل ليجندز', 'Mobile Legends', 'mobile-legends', 'Moonton', 'mobile', '#1769d1', 'موبايل ليجندز بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-113.webp'),
(9, 1, 'Call Of Duty', 'Call Of Duty', 'call-of-duty', 'Activision', 'mobile', '#1769d1', 'Call Of Duty بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-111.webp'),
(10, 1, 'e-Football', 'e-Football', 'efootball', 'Konami', 'mobile', '#1769d1', 'e-Football بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-110.webp'),
(11, 1, 'كلاش اوف كلانس', 'Clash of Clans', 'clash-of-clans', 'Supercell', 'mobile', '#1769d1', 'كلاش اوف كلانس بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-112.webp'),
(12, 1, 'جواكر', 'Jawaker', 'jawaker', 'Jawaker', 'mobile', '#1769d1', 'جواكر بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-118.webp'),
(13, 2, 'بطاقات يلا ليدو', 'Yalla Ludo', 'yalla-ludo', 'Yalla Group', 'mobile', '#1769d1', 'بطاقات يلا ليدو بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-116.webp'),
(14, 2, 'بطاقات روبلوكس', 'Roblox Cards', 'roblox', 'Roblox', 'mobile', '#1769d1', 'بطاقات روبلوكس بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-118.webp'),
(15, 2, 'بطاقات ريزر جولد', 'Razer Gold', 'razer-gold', 'Razer', 'mobile', '#1769d1', 'بطاقات ريزر جولد بخيارات متعددة وأسعار واضحة. اختر الباقة المناسبة ثم أكمل الطلب من صفحة الدفع.', NULL, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', '[{"q":"\\u0645\\u062a\\u0649 \\u064a\\u0635\\u0644 \\u0627\\u0644\\u0637\\u0644\\u0628\\u061f","a":"\\u0627\\u0644\\u062a\\u0646\\u0641\\u064a\\u0630 \\u0627\\u0644\\u064a\\u062f\\u0648\\u064a \\u0627\\u0644\\u062a\\u062c\\u0631\\u064a\\u0628\\u064a \\u064a\\u0638\\u0647\\u0631 \\u0643\\u0637\\u0644\\u0628 \\u0642\\u064a\\u062f \\u0627\\u0644\\u0645\\u0639\\u0627\\u0644\\u062c\\u0629."}]', 0, 1, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'images/kroti/product-120.webp');

CREATE TABLE `job_batches` (
  `id` VARCHAR(255) NOT NULL,
  `name` VARCHAR(255) NOT NULL,
  `total_jobs` INT NOT NULL,
  `pending_jobs` INT NOT NULL,
  `failed_jobs` INT NOT NULL,
  `failed_job_ids` LONGTEXT NOT NULL,
  `options` LONGTEXT NULL,
  `cancelled_at` INT NULL,
  `created_at` INT NOT NULL,
  `finished_at` INT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `jobs` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `queue` VARCHAR(255) NOT NULL,
  `payload` LONGTEXT NOT NULL,
  `attempts` INT NOT NULL,
  `reserved_at` INT NULL,
  `available_at` INT NOT NULL,
  `created_at` INT NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `manual_payment_gateways` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `name_ar` VARCHAR(255) NOT NULL,
  `name_en` VARCHAR(255) NULL,
  `account_label_ar` VARCHAR(255) NULL,
  `account_label_en` VARCHAR(255) NULL,
  `account_number` VARCHAR(255) NOT NULL,
  `instructions_ar` LONGTEXT NULL,
  `instructions_en` LONGTEXT NULL,
  `icon_path` VARCHAR(255) NULL,
  `is_active` TINYINT(1) NOT NULL DEFAULT '1',
  `sort_order` INT NOT NULL DEFAULT '1',
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  `slug` VARCHAR(255) NULL,
  `description_ar` LONGTEXT NULL,
  `description_en` LONGTEXT NULL,
  `receiver_data` LONGTEXT NULL,
  `required_fields` LONGTEXT NULL,
  `supported_currencies` LONGTEXT NULL,
  `min_amount_minor` INT NULL,
  `max_amount_minor` INT NULL,
  `fee_type` VARCHAR(255) NOT NULL DEFAULT 'none',
  `fee_value` INT NOT NULL DEFAULT '0',
  `requires_proof` TINYINT(1) NOT NULL DEFAULT '1',
  `proof_is_required` TINYINT(1) NOT NULL DEFAULT '1',
  `proof_max_mb` INT NOT NULL DEFAULT '6',
  `proof_instructions_ar` LONGTEXT NULL,
  `proof_instructions_en` LONGTEXT NULL,
  `review_sla_minutes` INT NOT NULL DEFAULT '60',
  `expires_after_minutes` INT NOT NULL DEFAULT '1440',
  `country_codes` LONGTEXT NULL,
  `risk_rules` LONGTEXT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `manual_payment_gateways` (`id`, `name_ar`, `name_en`, `account_label_ar`, `account_label_en`, `account_number`, `instructions_ar`, `instructions_en`, `icon_path`, `is_active`, `sort_order`, `created_at`, `updated_at`, `slug`, `description_ar`, `description_en`, `receiver_data`, `required_fields`, `supported_currencies`, `min_amount_minor`, `max_amount_minor`, `fee_type`, `fee_value`, `requires_proof`, `proof_is_required`, `proof_max_mb`, `proof_instructions_ar`, `proof_instructions_en`, `review_sla_minutes`, `expires_after_minutes`, `country_codes`, `risk_rules`) VALUES
(1, 'فودافون كاش', 'Vodafone Cash', 'رقم المحفظة', 'Wallet number', '01000000000', 'حوّل المبلغ على الرقم، ثم ارفع صورة التحويل واكتب رقم هاتفك.', 'Transfer the amount, upload the receipt screenshot, and enter your phone number.', 'images/payments/vodafone-cash.png', 1, 1, '2026-07-16 18:16:26', '2026-07-20 19:05:05', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'none', 0, 1, 1, 6, NULL, NULL, 60, 1440, NULL, NULL);

CREATE TABLE `manual_payment_submissions` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` VARCHAR(255) NOT NULL,
  `user_id` BIGINT UNSIGNED NOT NULL,
  `manual_payment_gateway_id` BIGINT UNSIGNED NOT NULL,
  `order_id` BIGINT UNSIGNED NULL,
  `amount_minor` INT NOT NULL,
  `currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `payer_name` VARCHAR(255) NOT NULL,
  `payer_phone` VARCHAR(255) NOT NULL,
  `proof_path` VARCHAR(255) NULL,
  `notes` LONGTEXT NULL,
  `status` VARCHAR(255) NOT NULL DEFAULT 'pending',
  `reviewed_at` DATETIME NULL,
  `reviewed_by` INT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  `submission_type` VARCHAR(255) NOT NULL DEFAULT 'wallet_topup',
  `reference_number` VARCHAR(255) NULL,
  `payer_identifier_type` VARCHAR(255) NULL,
  `payer_identifier` VARCHAR(255) NULL,
  `dynamic_fields` LONGTEXT NULL,
  `proof_hash` VARCHAR(255) NULL,
  `risk_score` INT NOT NULL DEFAULT '0',
  `risk_flags` LONGTEXT NULL,
  `review_note` LONGTEXT NULL,
  `rejection_reason` LONGTEXT NULL,
  `additional_info_requested_at` DATETIME NULL,
  `expires_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `migrations` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `migration` VARCHAR(255) NOT NULL,
  `batch` INT NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2026_07_15_130931_create_countries_table', 1),
(5, '2026_07_15_130932_create_currencies_table', 1),
(6, '2026_07_15_130933_create_categories_table', 1),
(7, '2026_07_15_130935_create_games_table', 1),
(8, '2026_07_15_130936_create_product_variants_table', 1),
(9, '2026_07_15_130939_create_orders_table', 1),
(10, '2026_07_15_130941_create_order_items_table', 1),
(11, '2026_07_15_130942_create_wallets_table', 1),
(12, '2026_07_15_130944_create_wallet_entries_table', 1),
(13, '2026_07_15_130945_create_stock_codes_table', 1),
(14, '2026_07_15_130946_create_support_tickets_table', 1),
(15, '2026_07_15_130948_create_banners_table', 1),
(16, '2026_07_15_150001_add_fulfillment_fields_to_orders_table', 1),
(17, '2026_07_15_150002_create_order_timelines_table', 1),
(18, '2026_07_15_160001_add_inventory_controls_to_stock_codes_table', 1),
(19, '2026_07_15_170001_create_payment_attempts_table', 1),
(20, '2026_07_15_170002_create_provider_fulfillment_attempts_table', 1),
(21, '2026_07_15_180001_create_customer_notifications_table', 1),
(22, '2026_07_15_180002_create_notification_deliveries_table', 1),
(23, '2026_07_16_090001_create_coupons_table', 1),
(24, '2026_07_16_090002_create_coupon_redemptions_table', 1),
(25, '2026_07_16_090003_add_coupon_fields_to_orders_table', 1),
(26, '2026_07_16_100001_create_wallet_transfers_table', 1),
(27, '2026_07_16_100002_create_vouchers_table', 1),
(28, '2026_07_16_100003_create_voucher_redemptions_table', 1),
(29, '2026_07_16_110001_add_referral_fields_to_users_table', 1),
(30, '2026_07_16_110002_create_referral_rewards_table', 1),
(31, '2026_07_16_110003_create_audit_logs_table', 1),
(32, '2026_07_16_120001_create_support_ticket_messages_table', 1),
(33, '2026_07_16_130001_add_image_path_to_games_table', 1),
(34, '2026_07_16_140001_create_site_settings_table', 1),
(35, '2026_07_16_140002_add_image_path_to_banners_table', 1),
(36, '2026_07_16_150001_add_social_links_to_site_settings_table', 1),
(37, '2026_07_16_160001_create_favorites_table', 1),
(38, '2026_07_16_160002_create_manual_payment_gateways_table', 1),
(39, '2026_07_16_160003_create_manual_payment_submissions_table', 1),
(40, '2026_07_18_000001_create_analytics_events_table', 2),
(41, '2026_07_18_000002_create_admin_customer_notes_table', 3),
(42, '2026_07_19_000001_enhance_manual_payment_system', 4),
(43, '2026_07_19_000002_create_provider_hub_tables', 4),
(44, '2026_07_19_000003_add_provider_id_to_fulfillment_attempts', 4);

CREATE TABLE `notification_deliveries` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `customer_notification_id` BIGINT UNSIGNED NULL,
  `order_id` BIGINT UNSIGNED NULL,
  `channel` VARCHAR(255) NOT NULL,
  `recipient` VARCHAR(255) NULL,
  `status` VARCHAR(255) NOT NULL DEFAULT 'queued',
  `provider` VARCHAR(255) NOT NULL DEFAULT 'mock_notification',
  `reference` VARCHAR(255) NOT NULL,
  `subject` VARCHAR(255) NULL,
  `body` LONGTEXT NOT NULL,
  `payload` LONGTEXT NULL,
  `sent_at` DATETIME NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `notification_deliveries` (`id`, `customer_notification_id`, `order_id`, `channel`, `recipient`, `status`, `provider`, `reference`, `subject`, `body`, `payload`, `sent_at`, `created_at`, `updated_at`) VALUES
(1, 1, 2, 'email', 'admin@raseednow.test', 'sent', 'log_email', 'NTF-260720-5HQJTHRS', 'تم إنشاء طلبك', 'استلمنا طلبك رقم RN-260720-1002 وسنقوم بمتابعته حتى التسليم.', '{"recipient":"admin@raseednow.test","subject":"\\u062a\\u0645 \\u0625\\u0646\\u0634\\u0627\\u0621 \\u0637\\u0644\\u0628\\u0643","body":"\\u0627\\u0633\\u062a\\u0644\\u0645\\u0646\\u0627 \\u0637\\u0644\\u0628\\u0643 \\u0631\\u0642\\u0645 RN-260720-1002 \\u0648\\u0633\\u0646\\u0642\\u0648\\u0645 \\u0628\\u0645\\u062a\\u0627\\u0628\\u0639\\u062a\\u0647 \\u062d\\u062a\\u0649 \\u0627\\u0644\\u062a\\u0633\\u0644\\u064a\\u0645.","context":{"type":"order_created","order_id":2,"order_number":"RN-260720-1002"}}', '2026-07-20 19:01:20', '2026-07-20 19:01:20', '2026-07-20 19:01:20');

CREATE TABLE `order_items` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `order_id` BIGINT UNSIGNED NOT NULL,
  `product_variant_id` BIGINT UNSIGNED NULL,
  `name_snapshot` VARCHAR(255) NOT NULL,
  `sku_snapshot` VARCHAR(255) NOT NULL,
  `quantity` INT NOT NULL DEFAULT '1',
  `unit_price_minor` INT NOT NULL,
  `total_minor` INT NOT NULL,
  `delivery_method_snapshot` VARCHAR(255) NOT NULL,
  `fulfillment_payload` LONGTEXT NULL,
  `fulfillment_status` VARCHAR(255) NOT NULL DEFAULT 'pending',
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `order_items` (`id`, `order_id`, `product_variant_id`, `name_snapshot`, `sku_snapshot`, `quantity`, `unit_price_minor`, `total_minor`, `delivery_method_snapshot`, `fulfillment_payload`, `fulfillment_status`, `created_at`, `updated_at`) VALUES
(1, 1, 1, '60 شدة', 'PUBG-60UC', 1, 4900, 4900, 'manual', NULL, 'pending', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(2, 2, 1, '60 شدة', 'PUBG-60UC', 1, 4557, 4557, 'manual', NULL, 'pending', '2026-07-20 19:01:20', '2026-07-20 19:01:20');

CREATE TABLE `order_timelines` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `order_id` BIGINT UNSIGNED NOT NULL,
  `actor_id` BIGINT UNSIGNED NULL,
  `event` VARCHAR(255) NOT NULL,
  `title` VARCHAR(255) NOT NULL,
  `note` LONGTEXT NULL,
  `metadata` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `order_timelines` (`id`, `order_id`, `actor_id`, `event`, `title`, `note`, `metadata`, `created_at`, `updated_at`) VALUES
(1, 1, NULL, 'created', 'تم إنشاء الطلب التجريبي', 'Seed data for local QA.', NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27');

CREATE TABLE `orders` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` VARCHAR(255) NOT NULL,
  `order_number` VARCHAR(255) NOT NULL,
  `user_id` BIGINT UNSIGNED NULL,
  `customer_name` VARCHAR(255) NOT NULL,
  `customer_email` VARCHAR(255) NULL,
  `currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `exchange_rate_snapshot` VARCHAR(255) NOT NULL DEFAULT '1',
  `subtotal_minor` INT NOT NULL DEFAULT '0',
  `discount_minor` INT NOT NULL DEFAULT '0',
  `tax_minor` INT NOT NULL DEFAULT '0',
  `total_minor` INT NOT NULL DEFAULT '0',
  `payment_method` VARCHAR(255) NOT NULL DEFAULT 'manual',
  `payment_status` VARCHAR(255) NOT NULL DEFAULT 'pending',
  `fulfillment_status` VARCHAR(255) NOT NULL DEFAULT 'pending',
  `customer_fields` LONGTEXT NULL,
  `risk_snapshot` LONGTEXT NULL,
  `paid_at` DATETIME NULL,
  `completed_at` DATETIME NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  `assigned_to` INT NULL,
  `claimed_at` DATETIME NULL,
  `failed_at` DATETIME NULL,
  `info_requested_at` DATETIME NULL,
  `failure_reason` VARCHAR(255) NULL,
  `fulfillment_note` LONGTEXT NULL,
  `coupon_id` BIGINT UNSIGNED NULL,
  `coupon_code` VARCHAR(255) NULL,
  `discount_snapshot` LONGTEXT NULL,
  `cashback_minor` INT NOT NULL DEFAULT '0',
  `loyalty_points_earned` INT NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `orders` (`id`, `uuid`, `order_number`, `user_id`, `customer_name`, `customer_email`, `currency_code`, `exchange_rate_snapshot`, `subtotal_minor`, `discount_minor`, `tax_minor`, `total_minor`, `payment_method`, `payment_status`, `fulfillment_status`, `customer_fields`, `risk_snapshot`, `paid_at`, `completed_at`, `created_at`, `updated_at`, `assigned_to`, `claimed_at`, `failed_at`, `info_requested_at`, `failure_reason`, `fulfillment_note`, `coupon_id`, `coupon_code`, `discount_snapshot`, `cashback_minor`, `loyalty_points_earned`) VALUES
(1, 'ba784141-9139-469b-879c-c5a8613bc0ad', 'RN-260716-1001', 1, 'Raseed Player', 'player@raseednow.test', 'EGP', 1, 4900, 0, 0, 4900, 'manual', 'pending', 'pending', '{"player_id":"123456789"}', NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0),
(2, '6a090205-1d5d-44aa-906b-6a60ca5e8c43', 'RN-260720-1002', 2, 'Raseed Admin', 'admin@raseednow.test', 'EGP', 1, 4557, 0, 0, 4557, 'manual', 'pending', 'pending', '{"player_id":"123456789","server":"egypt","notes":null}', NULL, NULL, NULL, '2026-07-20 19:01:20', '2026-07-20 19:01:20', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0);

CREATE TABLE `payment_attempts` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `order_id` BIGINT UNSIGNED NOT NULL,
  `gateway` VARCHAR(255) NOT NULL DEFAULT 'mock_gateway',
  `reference` VARCHAR(255) NOT NULL,
  `status` VARCHAR(255) NOT NULL DEFAULT 'initiated',
  `amount_minor` INT NOT NULL,
  `currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `request_payload` LONGTEXT NULL,
  `response_payload` LONGTEXT NULL,
  `confirmed_at` DATETIME NULL,
  `failed_at` DATETIME NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `product_variants` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `game_id` BIGINT UNSIGNED NOT NULL,
  `sku` VARCHAR(255) NOT NULL,
  `name_ar` VARCHAR(255) NOT NULL,
  `name_en` VARCHAR(255) NOT NULL,
  `delivery_method` VARCHAR(255) NOT NULL DEFAULT 'manual',
  `quantity` INT NOT NULL DEFAULT '1',
  `unit_ar` VARCHAR(255) NOT NULL DEFAULT 'وحدة',
  `unit_en` VARCHAR(255) NOT NULL DEFAULT 'Unit',
  `cost_minor` INT NOT NULL DEFAULT '0',
  `price_minor` INT NOT NULL,
  `sale_price_minor` INT NULL,
  `currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `cashback_basis_points` INT NOT NULL DEFAULT '0',
  `loyalty_points` INT NOT NULL DEFAULT '0',
  `stock_available` INT NOT NULL DEFAULT '0',
  `min_stock_alert` INT NOT NULL DEFAULT '5',
  `status` VARCHAR(255) NOT NULL DEFAULT 'active',
  `is_featured` TINYINT(1) NOT NULL DEFAULT '0',
  `is_best_seller` TINYINT(1) NOT NULL DEFAULT '0',
  `dynamic_fields` LONGTEXT NULL,
  `instructions_ar` LONGTEXT NULL,
  `instructions_en` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `product_variants` (`id`, `game_id`, `sku`, `name_ar`, `name_en`, `delivery_method`, `quantity`, `unit_ar`, `unit_en`, `cost_minor`, `price_minor`, `sale_price_minor`, `currency_code`, `cashback_basis_points`, `loyalty_points`, `stock_available`, `min_stock_alert`, `status`, `is_featured`, `is_best_seller`, `dynamic_fields`, `instructions_ar`, `instructions_en`, `created_at`, `updated_at`) VALUES
(1, 1, 'PUBG-60UC', '60 شدة', '60 UC', 'manual', 60, 'وحدة', 'Unit', 4018, 4900, 4557, 'EGP', 150, 0, 998, 5, 'active', 1, 1, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-20 19:01:20'),
(2, 1, 'PUBG-325UC', '325 شدة', '325 UC', 'api', 325, 'وحدة', 'Unit', 18778, 22900, NULL, 'EGP', 150, 2, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(3, 2, 'FF-110D', '110 جوهرة', '110 Diamonds', 'manual', 110, 'وحدة', 'Unit', 4838, 5900, 5487, 'EGP', 150, 0, 999, 5, 'active', 1, 1, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(4, 2, 'FF-572D', '572 جوهرة', '572 Diamonds', 'api', 572, 'وحدة', 'Unit', 21238, 25900, NULL, 'EGP', 150, 2, 999, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(5, 3, 'PSN-10USD', 'بطاقة 10 دولار', '10 USD Gift Card', 'stored_code', 10, 'دولار', 'USD', 45018, 54900, 51057, 'EGP', 150, 5, 5, 5, 'active', 1, 1, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(6, 4, 'XBOX-15USD', 'بطاقة 15 دولار', '15 USD Gift Card', 'stored_code', 15, 'دولار', 'USD', 64698, 78900, NULL, 'EGP', 150, 7, 5, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(7, 5, 'STEAM-20USD', 'ستيم 20 دولار', 'Steam 20 USD', 'stored_code', 20, 'دولار', 'USD', 86018, 104900, NULL, 'EGP', 150, 10, 5, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(8, 6, 'VAL-475VP', '475 نقطة فالورانت', '475 Valorant Points', 'manual', 475, 'وحدة', 'Unit', 19598, 23900, 22227, 'EGP', 150, 2, 999, 5, 'active', 0, 1, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(9, 7, 'TT-350', '350 عملة', '350 Coins', 'manual', 350, 'وحدة', 'Unit', 35670, 43500, NULL, 'EGP', 150, 4, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(10, 7, 'TT-500', '500 عملة', '500 Coins', 'manual', 500, 'وحدة', 'Unit', 50758, 61900, NULL, 'EGP', 150, 6, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(11, 7, 'TT-700', '700 عملة', '700 Coins', 'manual', 700, 'وحدة', 'Unit', 70766, 86300, NULL, 'EGP', 150, 8, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(12, 7, 'TT-1000', '1000 عملة', '1000 Coins', 'manual', 1000, 'وحدة', 'Unit', 101598, 123900, NULL, 'EGP', 150, 12, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(13, 7, 'TT-1500', '1500 عملة', '1500 Coins', 'manual', 1500, 'وحدة', 'Unit', 152356, 185800, NULL, 'EGP', 150, 18, 999, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(14, 7, 'TT-2000', '2000 عملة', '2000 Coins', 'manual', 2000, 'وحدة', 'Unit', 203196, 247800, NULL, 'EGP', 150, 24, 999, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(15, 7, 'TT-2500', '2500 عملة', '2500 Coins', 'manual', 2500, 'وحدة', 'Unit', 253954, 309700, NULL, 'EGP', 150, 30, 999, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(16, 7, 'TT-4000', '4000 عملة', '4000 Coins', 'manual', 4000, 'وحدة', 'Unit', 406392, 495600, NULL, 'EGP', 150, 49, 999, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(17, 7, 'TT-7000', '7000 عملة', '7000 Coins', 'manual', 7000, 'وحدة', 'Unit', 711186, 867300, NULL, 'EGP', 150, 86, 999, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(18, 7, 'TT-10000', '10,000 عملة', '10,000 Coins', 'manual', 10000, 'وحدة', 'Unit', 1015980, 1239000, NULL, 'EGP', 150, 123, 999, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(19, 7, 'TT-20000', '20,000 عملة', '20,000 Coins', 'manual', 20000, 'وحدة', 'Unit', 2009000, 2450000, NULL, 'EGP', 150, 245, 999, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(20, 7, 'TT-50000', '50,000 عملة', '50,000 Coins', 'manual', 50000, 'وحدة', 'Unit', 4920000, 6000000, NULL, 'EGP', 150, 600, 999, 5, 'active', 0, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(21, 8, 'ML-86D', '86 جوهرة', '86 Diamonds', 'manual', 86, 'وحدة', 'Unit', 19598, 23900, NULL, 'EGP', 150, 2, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(22, 9, 'COD-420CP', '420 CP', '420 CP', 'manual', 420, 'وحدة', 'Unit', 24518, 29900, NULL, 'EGP', 150, 2, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(23, 10, 'EFOOTBALL-130', '130 كوينز', '130 Coins', 'manual', 130, 'وحدة', 'Unit', 45018, 54900, NULL, 'EGP', 150, 5, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(24, 11, 'COC-500G', '500 جوهرة', '500 Gems', 'manual', 500, 'وحدة', 'Unit', 86018, 104900, NULL, 'EGP', 150, 10, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(25, 12, 'JAWAKER-1000', '1000 توكن', '1000 Tokens', 'manual', 1000, 'وحدة', 'Unit', 16318, 19900, NULL, 'EGP', 150, 1, 999, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(26, 13, 'YALLA-10USD', 'بطاقة 10 دولار', '10 USD Card', 'stored_code', 10, 'دولار', 'USD', 45018, 54900, NULL, 'EGP', 150, 5, 5, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(27, 14, 'ROBLOX-10USD', 'بطاقة 10 دولار', '10 USD Card', 'stored_code', 10, 'دولار', 'USD', 45018, 54900, NULL, 'EGP', 150, 5, 5, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27'),
(28, 15, 'RAZER-10USD', 'بطاقة 10 دولار', '10 USD Card', 'stored_code', 10, 'دولار', 'USD', 45018, 54900, NULL, 'EGP', 150, 5, 5, 5, 'active', 1, 0, '[{"key":"player_id","label_ar":"Player ID","type":"text","required":true},{"key":"server","label_ar":"\\u0627\\u0644\\u0633\\u064a\\u0631\\u0641\\u0631","type":"select","required":false}]', 'راجع رقم اللاعب قبل تأكيد الطلب. الأسعار محفوظة كلقطة داخل الطلب.', 'Verify the player ID before checkout. Prices are snapshotted per order.', '2026-07-16 18:16:27', '2026-07-16 18:16:27');

CREATE TABLE `provider_fulfillment_attempts` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `order_item_id` BIGINT UNSIGNED NOT NULL,
  `provider` VARCHAR(255) NOT NULL DEFAULT 'mock_provider',
  `reference` VARCHAR(255) NOT NULL,
  `status` VARCHAR(255) NOT NULL DEFAULT 'queued',
  `request_payload` LONGTEXT NULL,
  `response_payload` LONGTEXT NULL,
  `completed_at` DATETIME NULL,
  `failed_at` DATETIME NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  `provider_id` BIGINT UNSIGNED NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `provider_logs` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `provider_id` BIGINT UNSIGNED NULL,
  `order_id` BIGINT UNSIGNED NULL,
  `order_item_id` BIGINT UNSIGNED NULL,
  `endpoint` VARCHAR(255) NOT NULL,
  `method` VARCHAR(255) NOT NULL DEFAULT 'POST',
  `request_payload` LONGTEXT NULL,
  `response_payload` LONGTEXT NULL,
  `status_code` INT NULL,
  `status` VARCHAR(255) NOT NULL DEFAULT 'pending',
  `latency_ms` INT NULL,
  `error_message` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `provider_product_mappings` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `provider_id` BIGINT UNSIGNED NOT NULL,
  `product_variant_id` BIGINT UNSIGNED NOT NULL,
  `provider_sku` VARCHAR(255) NULL,
  `fulfillment_type` VARCHAR(255) NOT NULL DEFAULT 'pubg_uc_code',
  `mode` VARCHAR(255) NOT NULL DEFAULT 'single',
  `codes_per_order` INT NOT NULL DEFAULT '1',
  `required_fields` LONGTEXT NULL,
  `settings` LONGTEXT NULL,
  `is_active` TINYINT(1) NOT NULL DEFAULT '1',
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `provider_product_mappings` (`id`, `provider_id`, `product_variant_id`, `provider_sku`, `fulfillment_type`, `mode`, `codes_per_order`, `required_fields`, `settings`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 1, 2, 'PUBG-325UC', 'pubg_uc_code', 'single', 1, '[{"key":"player_id","label":"Player ID","required":true}]', '{"reserve_stock_code":true}', 1, '2026-07-19 09:14:06', '2026-07-19 09:14:06');

CREATE TABLE `referral_rewards` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `referrer_user_id` BIGINT UNSIGNED NOT NULL,
  `referred_user_id` BIGINT UNSIGNED NOT NULL,
  `order_id` BIGINT UNSIGNED NOT NULL,
  `currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `referrer_reward_minor` INT NOT NULL,
  `referred_reward_minor` INT NOT NULL DEFAULT '0',
  `status` VARCHAR(255) NOT NULL DEFAULT 'paid',
  `snapshot` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `sessions` (
  `id` VARCHAR(255) NOT NULL,
  `user_id` BIGINT UNSIGNED NULL,
  `ip_address` VARCHAR(255) NULL,
  `user_agent` LONGTEXT NULL,
  `payload` LONGTEXT NOT NULL,
  `last_activity` INT NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Runtime table sessions: data skipped.

CREATE TABLE `site_settings` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `site_name_ar` VARCHAR(255) NOT NULL DEFAULT 'RaseedNow',
  `site_name_en` VARCHAR(255) NOT NULL DEFAULT 'RaseedNow',
  `logo_path` VARCHAR(255) NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  `facebook_url` VARCHAR(255) NULL,
  `instagram_url` VARCHAR(255) NULL,
  `tiktok_url` VARCHAR(255) NULL,
  `youtube_url` VARCHAR(255) NULL,
  `whatsapp_url` VARCHAR(255) NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `site_settings` (`id`, `site_name_ar`, `site_name_en`, `logo_path`, `created_at`, `updated_at`, `facebook_url`, `instagram_url`, `tiktok_url`, `youtube_url`, `whatsapp_url`) VALUES
(1, 'RaseedNow', 'RaseedNow', 'images/brand/raseednow-logo.png', '2026-07-16 18:16:30', '2026-07-20 19:04:25', 'https://facebook.com/', 'https://instagram.com/', 'https://tiktok.com/', 'https://youtube.com/', 'https://wa.me/');

CREATE TABLE `stock_codes` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `product_variant_id` BIGINT UNSIGNED NOT NULL,
  `batch_reference` VARCHAR(255) NULL,
  `encrypted_code` LONGTEXT NOT NULL,
  `serial_number` VARCHAR(255) NULL,
  `cost_minor` INT NOT NULL DEFAULT '0',
  `currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `expires_at` DATE NULL,
  `status` VARCHAR(255) NOT NULL DEFAULT 'available',
  `reserved_order_id` BIGINT UNSIGNED NULL,
  `sold_order_item_id` BIGINT UNSIGNED NULL,
  `reserved_at` DATETIME NULL,
  `sold_at` DATETIME NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  `code_fingerprint` VARCHAR(255) NULL,
  `imported_by` INT NULL,
  `import_note` LONGTEXT NULL,
  `voided_at` DATETIME NULL,
  `provider_id` BIGINT UNSIGNED NULL,
  `metadata` LONGTEXT NULL,
  `checked_at` DATETIME NULL,
  `check_status` VARCHAR(255) NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `stock_codes` (`id`, `product_variant_id`, `batch_reference`, `encrypted_code`, `serial_number`, `cost_minor`, `currency_code`, `expires_at`, `status`, `reserved_order_id`, `sold_order_item_id`, `reserved_at`, `sold_at`, `created_at`, `updated_at`, `code_fingerprint`, `imported_by`, `import_note`, `voided_at`, `provider_id`, `metadata`, `checked_at`, `check_status`) VALUES
(1, 5, 'LOCAL-QA', 'eyJpdiI6IjFudVR1aElJNmt5TEh0bW5SN2hFWlE9PSIsInZhbHVlIjoidUw1QUU5VDBoOHVSRnkxbGlTd0RGZk1EZ2FOYzBPSHZxUjR5UHJnY0svST0iLCJtYWMiOiJkMzVkOTliNDk0ZWQ4NDE0OGNlZGRiMzAwZmE5MjM4YjY0ZTQ5NTRiZDQxZjAzZDAyODU5ZTllOGE1ZDA3ZTNjIiwidGFnIjoiIn0=', 'PSN-10USD-SN-1', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '8407e32a47a70c2e1ab1c4a07e771599e55433b7386e1af9ecf40bbb342c3ff8', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(2, 5, 'LOCAL-QA', 'eyJpdiI6Ikx4NG5qMm0yUTZ4MGN5dXV2WDJzSkE9PSIsInZhbHVlIjoidXRFaFBZb0NJbUM5a3dJMjdDRGphdFV2YU5FTnQ3Y1d6UjVtUWFNWUQ3cz0iLCJtYWMiOiIyYjZmYzJlM2ZkZTE1ZGRjMzU3ZDc2ODBlYmI2MGU4MTljZTM1MjNlYTQ2NmNmMzMwMGY0NTczNTlhMmVjYTViIiwidGFnIjoiIn0=', 'PSN-10USD-SN-2', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '5388a075847558d022c2a226f1d28e349a5e856735be1c9a8ff70ec625a406a6', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(3, 5, 'LOCAL-QA', 'eyJpdiI6IllEeURqd2I3NkxoSDFqSzlrRDZkbFE9PSIsInZhbHVlIjoiN3V5clE0cDM2ME5aaWljQ3lWVkhrVUMvS0VkNHhrV3k0SUx5RGIyZXpGWT0iLCJtYWMiOiJlNzRmOGU4OGEwMDNmZDhjZDU0OTUyMDY1ZGI5MTgzMzA1OTEzMWMyZGY0YWRmYjY0ZDg2MDllYjAyNmMwN2M2IiwidGFnIjoiIn0=', 'PSN-10USD-SN-3', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '0de1422e22fc478019cee02a6d8afaa6bd7c55fed2b7c1b95e8a39115e475703', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(4, 5, 'LOCAL-QA', 'eyJpdiI6IkRCcHRMc3czamFoSDQ5YlI0dld5WkE9PSIsInZhbHVlIjoiYW5jSUhIRkRYQzZweCtmTkI2cXFFd0VaaXJZdjRlREo3NUl1eXlsOE5Dbz0iLCJtYWMiOiJmMTYzOTMyMzliNDBmZWVlYjQ1ODJmOTk2MTNiZWM5ZmMxOTEzNDYzMWRmNjQ5M2FkN2I3NWRmNGQ1NzU4YmVkIiwidGFnIjoiIn0=', 'PSN-10USD-SN-4', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '876d7e192dfd006f8fbc5cced02c9117f1e5c1f5e5ca1001a9e2e8d9d0e3c825', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5, 5, 'LOCAL-QA', 'eyJpdiI6IlJoSXY3Wi96eWt3YXBkTmNnL29udmc9PSIsInZhbHVlIjoiUEFIQWpOZjlIc2hCTVR2eENnNzMxNzlyNXUxQ1VNT3dVRGRnZXV6NnB2dz0iLCJtYWMiOiJlNTE1YTAxZDVlOTFiMDBjYzZhYzAyN2U0NTg3OWU3ODAwY2FjMDJkZWY0NjIxM2Y0MzI4OTgwYzFmZjY5OTA3IiwidGFnIjoiIn0=', 'PSN-10USD-SN-5', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'e915867258578021c56ba2899b3fdd4007a36d1d81205d60ed281685146c301f', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6, 6, 'LOCAL-QA', 'eyJpdiI6IjFyOW9VQjFrQ3l4VmsvSUdmUXNtOUE9PSIsInZhbHVlIjoibWwxMG9LcVovTUtnNHJCelRsVU03OVlJTDV3S0gvUEs3dkduSDBoOG8xQT0iLCJtYWMiOiIzYTM4ODM4MDM0NWQyZDI1YmU0MGM5OTgyZjIyYmExOTFjODRiZTI1M2QwNWNmYjljZjQ2MzViNzJlZTg2NTlmIiwidGFnIjoiIn0=', 'XBOX-15USD-SN-1', 59964, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '6ba8fbf027041b1a839bd80c5c10922cd90934ab1271b259a6f1937c8223fccc', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(7, 6, 'LOCAL-QA', 'eyJpdiI6ImRTaTZDUk9ITlJHTjBMYVZEaVQ0S1E9PSIsInZhbHVlIjoiMjZYTUg1R2QvZSt3TEY1Q3RnUTVSWml0RDBPdzdYS01WditlT1dqN1o5dz0iLCJtYWMiOiIwZTA1ZDQ0NmM0MDY4ZDYwYTE2ODkxZjVhZmViZWYzOGI2OWJjMGEwYjhlOGEyNDA0Yzc4NzM0M2U2M2QxYjlhIiwidGFnIjoiIn0=', 'XBOX-15USD-SN-2', 59964, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '659d48f31f68b8c63d6ca27f99e9cf85aa8ff701a663f6f8c2e6a08d55916791', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(8, 6, 'LOCAL-QA', 'eyJpdiI6IkJjc0N1Z1d2clUySWtMcEtXY2RHeEE9PSIsInZhbHVlIjoiQ0dsMC8wRnJKWFRXUzlDRitqZ21rVUpLcmJpVzVJbDFrMnpSSmFNcU9odz0iLCJtYWMiOiJhZWJmMDNiOThhZjkxZjM0ZWZhMWFjYzk3NDBmNGFiMDA2MmQ2NWQxMTdmYmU1NTc2NmRhYTVhM2QwOTg1NTRiIiwidGFnIjoiIn0=', 'XBOX-15USD-SN-3', 59964, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '29af472bdcc57eb2a93e9e507fc07354461c07956b1b109b085b2417724ffd49', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9, 6, 'LOCAL-QA', 'eyJpdiI6InNEMnI2UTlOMTl2cTZaMU1SdlBLcGc9PSIsInZhbHVlIjoiaG1obXRCbktZalIwNGJaSjA4dVZmN1hSRXVWTDhCQklFSXZGb3VWVXRJRT0iLCJtYWMiOiI2NzU1N2EwNjM3NjdhYWQ1ODEzMjkwNmVkY2Q3ZDIxZTkyOGJkZjA5ZGY5YzUyODdlMDUyNWUwMWQ5ZDY5YzNhIiwidGFnIjoiIn0=', 'XBOX-15USD-SN-4', 59964, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '53b070fa8925f19827f1347762ca9b3e23030313dd1fbf46b7b43aecac7ddc55', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(10, 6, 'LOCAL-QA', 'eyJpdiI6IkNGbXRXUjl1VE9KWnJDaGU5eFJsUHc9PSIsInZhbHVlIjoiN2tCVG9YTDRBVDNYMU96Z3FwbTczMzlQeW8vdXUrNGVNWHpSR1lhZm9YST0iLCJtYWMiOiIyMGY3NDg2MmU4OTI4N2I4MzBhMDVjMzliZDA1MzExMTI2ZDYxMTlmYTQ0YWI5ZTM2YWEzZWI3OWIyZDVjODJmIiwidGFnIjoiIn0=', 'XBOX-15USD-SN-5', 59964, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'dc59cd0bb4775df0ffb3078a05f2bcc861f4d7173eb98ba89db5b620c37108b2', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(11, 7, 'LOCAL-QA', 'eyJpdiI6ImNxa0RyWU1xWUV4ZFJKQ2hETmw4M1E9PSIsInZhbHVlIjoiUXZYcW15K01HZTlRVytyU1ZMU2JuZnE4LzdxUUpPSzgrY1VudUtURUhhTT0iLCJtYWMiOiIyNjBkMjBkMzNhN2JlOGMzZTNhNWYzZGQ0MmU2NjE1YTFhNzZlNmZlM2UxNzJhODkxZDMzYTA4YjlkYjdmNWJkIiwidGFnIjoiIn0=', 'STEAM-20USD-SN-1', 79724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '5ab50a59d8b924ec3603c872340cc8d349db45c5b387856568d6d21f5d95e8e4', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(12, 7, 'LOCAL-QA', 'eyJpdiI6ImNPcE9EM0t5TGVvMTAvVjJ5ZDV6R3c9PSIsInZhbHVlIjoidVhVbEVSLzAyOENRZjRjZkt2MHBGQ0NxdXBoNEZ5MzE3OFFWUFI0YkxzZz0iLCJtYWMiOiJlZDE3NGI3ODg0ODVhMDlmOGI4ZWFiOGYyOWFhNWQyZThlNmIxMDc5ZDM3NmFlNjRkYjU1OGRkNGZhYWU0ZTkzIiwidGFnIjoiIn0=', 'STEAM-20USD-SN-2', 79724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'bbe9354394551b552c58e4605b9c1b29162066f9a025f0c91f09951e43ad00d5', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(13, 7, 'LOCAL-QA', 'eyJpdiI6Imc3dWVSdjRiaVNRbG80L2V5cms1ZEE9PSIsInZhbHVlIjoib1lzeXR4ekY3Sk8wbEhpbEwzeWEybUFWRFZjajBHQWtvVjFUWitRendUYz0iLCJtYWMiOiI2YjQwNTFkY2U4YWZmMWRmMmU3NDc2MjFmNGM0Yjk1YzA3NDJiNjQyOTQ5MGUzZjVhNTE2YTA4YzVmY2RjODRmIiwidGFnIjoiIn0=', 'STEAM-20USD-SN-3', 79724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'c4805d11b4d466730924f9b65a4b47cd3a9784d87ba0755ba0144cc744e2e62d', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(14, 7, 'LOCAL-QA', 'eyJpdiI6IkRoTU5pM05DT3pPQ3BvK0V3V1VFUkE9PSIsInZhbHVlIjoiTlJudEV5dmppZU92ZG4zZlZyTzV2UlppU2czbXdWNGVudHJaUDBBc3hEND0iLCJtYWMiOiJmY2Y0MzhlZDY5Yzg5OGM4OWE2MjEwMzEzMDVlZjAwNmMzODQ2MzgzZDE4NzY4MjhmNzEyZWI3M2Q3MGQ1YTU1IiwidGFnIjoiIn0=', 'STEAM-20USD-SN-4', 79724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'c28d53df1b150b2794f276eec7216a95c8a5b0e7b228cea8b33a6577467ba50e', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(15, 7, 'LOCAL-QA', 'eyJpdiI6IitqSlBnRkdaWlJSQmZaQ2NVYzVOTUE9PSIsInZhbHVlIjoiV1dDQ0I2NjBSanh1OVZNaXkvWUx1eUFjQVloZENXZXBYL05hTHF6cFhLcz0iLCJtYWMiOiIyNzc0YjZkMzg1YzY4M2Y3NWZmY2IxZjgyMWZmM2RmNTBlZWI3ZjdmZDA2N2I2ZTY2M2VkMWJmNjFjODhkOTRmIiwidGFnIjoiIn0=', 'STEAM-20USD-SN-5', 79724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '0730736c9c2bf8f5b4349ebcaa14912390a75dc2b3357bee152ec118a17511ef', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(16, 26, 'LOCAL-QA', 'eyJpdiI6IjlRWWpaY3B3amVYQ2FWT2MvU1F2d2c9PSIsInZhbHVlIjoiSmY1VnJBenRRdzc2Z3RyeXFIRTdXSGZXYW82cjZhVjlwVk5BS1dsQk5GND0iLCJtYWMiOiJlNjExNDRlNjgxMDM5NmIxZDk3YmQxMWExMmI5Mjg2YjRkYTMwMDAzYTAzMzc0Nzc2NzRmNjcyZTQ3NzQ4YjU3IiwidGFnIjoiIn0=', 'YALLA-10USD-SN-1', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'ae781ad8946f1c7c91243f27da5c6d09be58de42ea42c36cb7daf8df5138945e', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(17, 26, 'LOCAL-QA', 'eyJpdiI6IjljaGJKaFlPYmlSaTdvY3poaEJuVEE9PSIsInZhbHVlIjoiQ2ZxdTNPSFR3TnhXbTVDdFJwQ0k1ZWFkL0E2SjdlcTk5czdzWmhEaEQzbz0iLCJtYWMiOiI4NDU1NTI0NzVkYzI5NzkyMTAzNzAyODM3ODJhMGM0YjFjMjQwZjcyNDdmNzEzOWFhZWQzYTk3ZjM3ZGFjMTAzIiwidGFnIjoiIn0=', 'YALLA-10USD-SN-2', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'f4beaf686d511bb6a9aec00ef08e6089f9b7305dccb45449be1f8fa1643d97bd', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(18, 26, 'LOCAL-QA', 'eyJpdiI6IjJtWFdydTlXTS9hT1d0a092V3UzY0E9PSIsInZhbHVlIjoiVm10eUNjT2tTZXFYa0dyR2R3WFA3TzM3bTcrV1ltYWVRVjJSTzgrbTFVVT0iLCJtYWMiOiJjNDYwMTEwOTdmMDkzMDUzM2IwNjRiMzU4Mzg5YTc2ZGQ3YTE1MTYyMzAyMjBiOGM0MWE0NDVmNDA2NWZmNGZkIiwidGFnIjoiIn0=', 'YALLA-10USD-SN-3', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '4449657b8a1b49ecb88e88c1abe9115e2b442bc246ebc99b7459eaf87e5046b2', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(19, 26, 'LOCAL-QA', 'eyJpdiI6IkZoUEh2dDhvVVNWMEhYYU5hdHlKVWc9PSIsInZhbHVlIjoid0E4V240WE9MOGJtL2Nxc1BwN05XMzR0TVJsMm5KeGt0SkJFUzlmMmV5MD0iLCJtYWMiOiI4MGY4NGI3YzYxM2M2ZTYzMjU5ZDZjNWZjMTJkMGQ0ZDU3OTI5MDQyMmI0ZmI0ZjcwNGM1ZDZkOTA1YTE2MzJmIiwidGFnIjoiIn0=', 'YALLA-10USD-SN-4', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '57a876c8c24bd3f0e46293e1a651bbedb2ddde8935500bc79e552f4ad1d87637', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(20, 26, 'LOCAL-QA', 'eyJpdiI6IlRjcWxXL3duWFllU3R3b1dVS2VtRmc9PSIsInZhbHVlIjoianJtUytRaitQQ1gxZWUrK0IrWnpXRUtRUTFIbHJaV3FrelBBdE9RZGhyTT0iLCJtYWMiOiI4M2JiNGY4NGRjYTE2M2FmNWE2ZmZlNWRkMWJkZTVkZDM1YWZkZWFjNmZmYzU5M2NlY2YwOTU3YWJmYjMzMDM4IiwidGFnIjoiIn0=', 'YALLA-10USD-SN-5', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'd3a0b3998ce69ac0ac3a40b1968f92c6dc5f2376b5a9ad817b071b87b063516c', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(21, 27, 'LOCAL-QA', 'eyJpdiI6InY0bmxJTVRGNFFjSmdOL3F4cUxPSEE9PSIsInZhbHVlIjoiRmRvQmI1VXlPNUZWYnY1MjdnbUoyWmlsV2Exc2ZwVld2Um81MUlibUh6Zz0iLCJtYWMiOiJhNmZkYjU1MTYxYWY3NzUxMzhjOWU4MzBiNDk1MzAzYjI0MmJjMGQ4ZmM5ODU2MDIzNjI2Mjc4ZTYwZDE3YjU4IiwidGFnIjoiIn0=', 'ROBLOX-10USD-SN-1', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '6bd480fb517744edc449a1296ce3b29a7d62733fcc174d43081ac35e0e102dbe', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(22, 27, 'LOCAL-QA', 'eyJpdiI6IjNjemV2eDlaS3l5WmRYUzZtU1VSRVE9PSIsInZhbHVlIjoiWXFFcmN4SDBRT0R0VjRPY09rL1dtRFgyb3N5bk00ZlRIWHBTSk1TWTJuTT0iLCJtYWMiOiI3MTU3MGEwZDYyZGVmYTY5NzdkODMyOTY1NWM3YzMyYWY1ODJiMTgyMGE5ZDlkZmMxYTUzODY4MzM4Y2IxY2NkIiwidGFnIjoiIn0=', 'ROBLOX-10USD-SN-2', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'a797f1fe106d094d9f88dbcba174b815dbca9efd8144afc677476143c6f6676f', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(23, 27, 'LOCAL-QA', 'eyJpdiI6IlJoSmZqVmhDOXk4ZWc2MTU2bkNHMlE9PSIsInZhbHVlIjoiWWYzRkZQR1lTZW56OWJWakd0RXArN1J5N3E4U1J6aUViMlFSTFBWMmtPMD0iLCJtYWMiOiI5OTBkMzMzOWY2MThhNGQ0MGUzOTJhODAwNTRkYjYwMzBkZmU5ZTk2ZTRmZjkyZjI1N2I2YjVjZmEwNWQ2ZTI0IiwidGFnIjoiIn0=', 'ROBLOX-10USD-SN-3', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'cd115be8a37ac13b05e88111a3d6306e881f07bb570098753c672d4b3b82d438', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(24, 27, 'LOCAL-QA', 'eyJpdiI6IkdqNTRleGwybFRITmZMK1RVNC85TVE9PSIsInZhbHVlIjoiZStIejBqTXlRTHlTNnRvUlNvQWY4Sm03RWxwQ1p6cXhnT1R1Wm9xcnNaYz0iLCJtYWMiOiIxNmQ5ZTk0MTBlMmFhYjg5ODIxZGI3YTBlOWY1ZDYzM2NjZjlhYjAzY2VhNzkxOTdmMTI3OGQxODFjMjM0NzBiIiwidGFnIjoiIn0=', 'ROBLOX-10USD-SN-4', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '6d19652dfb623c8d3bbf493c2e5167f4591634e74c96712ceded3ee7792285ff', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(25, 27, 'LOCAL-QA', 'eyJpdiI6Ijk4OFIydmVlWXZ0M2l3MC9rYXpZc0E9PSIsInZhbHVlIjoiN25XNWFKMGVQVEt2eFRsV2dmYmcydGEyMmoybDRraDVGZ1JVQ25adDFGUT0iLCJtYWMiOiI3NDUxMDU3M2QwNTRjODkxM2ZlODE4NjFjZTI0ZWI3YWU3MTMwNjIwYmM4NmNjMmVhMmU0MDM4Nzk3ZDk3M2YzIiwidGFnIjoiIn0=', 'ROBLOX-10USD-SN-5', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'b8e6ab7da9eae0561b17516977af89a48ec9e4dc24c346b54cfe3babadb6cad6', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(26, 28, 'LOCAL-QA', 'eyJpdiI6Ijk1Q3VaWFg4d2NOVVYwNDBGWlRUVVE9PSIsInZhbHVlIjoiOC8xZmF3YlE5dzhZcnFiQmc4d2F2TU1OUTlKU3Z1RWFSZWpoOEVrL2xZcz0iLCJtYWMiOiJkM2YxZjc1ZmFmOGFiZjdlMGJlYWNkMGI2MmRkMWQyMTRiOTFjMWFkZWU0Y2RkYTBjYjkyZTMzODkyMTBiMzExIiwidGFnIjoiIn0=', 'RAZER-10USD-SN-1', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '9161cd731f1014ee52d29c4168478534cb733082531a3027d9724db71bfa5609', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(27, 28, 'LOCAL-QA', 'eyJpdiI6ImxUcExiSjZyU0wzWjE5M25mdXJmREE9PSIsInZhbHVlIjoibEUvc0l1VWUxdjEzdDJkeGJIbHAyWDc3ZkVOWXVab0RzRndQVVBsUkR5UT0iLCJtYWMiOiJjNWRhNzQ0ZTQyYWY4ZjVhM2E0NTY2ODA4ZjljNzMxYzhlMDVjMWQ2NmRmMjMzYzc2Zjg1YTViNWQ4OGJjMGQ3IiwidGFnIjoiIn0=', 'RAZER-10USD-SN-2', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '41187ac9676aa9c322d9ed6e8e298680d5358095d79124c59ff2d62f878f9c77', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(28, 28, 'LOCAL-QA', 'eyJpdiI6IklHOFJnaE9yUElOeDl5QVA3OVlKRVE9PSIsInZhbHVlIjoiVWhYRHg4UTBWcWpwV21hcFFiVWVOYnhHcGhsYTBmU20zNHJPN1hyWW9vST0iLCJtYWMiOiIyMTBiMGJkNDRhZDQ3YjEyMjNkYjAzNjY3MTk1NjQ5OWQwMjA5ZDEzNDQ2ZjNiNWQ5MWFhMDUwZjcyZDM0NGE0IiwidGFnIjoiIn0=', 'RAZER-10USD-SN-3', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '177ac1704de7309f03fe407433813daa1ffd966852ebe72698bd3ab07a29a996', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(29, 28, 'LOCAL-QA', 'eyJpdiI6Ik5wVWwwYWVFSzJRN016WTRQV0pTOXc9PSIsInZhbHVlIjoiTDU5YWZVNTc1YjdSL29qTHBKeDk5UzB1cldpZmthSi82SGlmZHRGZGpHTT0iLCJtYWMiOiJiZmNmZDllMWFhNGZhNjliZDZiMjBjMzcyYjcwMzIyMjkwNTYwYTY0MzRjOTVmZjlmNDU3ZjYwN2JjNDkzMjRmIiwidGFnIjoiIn0=', 'RAZER-10USD-SN-4', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', '92b21e1a9422e80e77d3c2c7e1156ed35bedf76c806faeb51248b6707ef9b7e2', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30, 28, 'LOCAL-QA', 'eyJpdiI6InpFRGIvYkxzbHB4NjhTTXByRWxQUWc9PSIsInZhbHVlIjoiRUc3TXVVVUhzVWlIRWJ6NlBlcjc1TzhMdFBndGtxbDZsd2R2RGZoRDdHTT0iLCJtYWMiOiIwMjdmODU1YWJjOTZlNmZmMjYzM2Q4Yjk1MTExMGQ0OTAzOWEwMzY0ODZjMjI1MWJmYWFjODNmZGFkZTE3MDcwIiwidGFnIjoiIn0=', 'RAZER-10USD-SN-5', 41724, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27', 'f023fa6703c6fce75a677f06907b7a81b0f08e39816284bc894873d31e4c2092', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(31, 2, 'LOCAL-MIDASBUY', 'eyJpdiI6IllQMUQzUkFuUmlJdnpLZUxBTm1sckE9PSIsInZhbHVlIjoieEJscVdzS1VEd0x6ekM0cmJjZmJHejhmaCt1bU02OG84ZnVkNWQ2dnNJND0iLCJtYWMiOiJmYWM2YTY4OTJkY2U2ZjUyNzQ4N2U4Y2MxZGZjMWVlYmFhYzU4OGIxZTY3MjlmMWU5YThiM2RkMGM3N2EyZDI5IiwidGFnIjoiIn0=', 'LOCAL-MIDASBUY-1', 10000, 'EGP', NULL, 'available', NULL, NULL, NULL, NULL, '2026-07-19 09:14:06', '2026-07-19 09:14:06', 'a6878c8fca036af71db1cf7543d81a13dbb8e2446c802a57c93cc32daa5b3e93', NULL, NULL, NULL, 1, NULL, NULL, NULL);

CREATE TABLE `support_ticket_messages` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `support_ticket_id` BIGINT UNSIGNED NOT NULL,
  `sender_user_id` BIGINT UNSIGNED NULL,
  `sender_type` VARCHAR(255) NOT NULL DEFAULT 'customer',
  `body` LONGTEXT NOT NULL,
  `metadata` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `support_ticket_messages` (`id`, `support_ticket_id`, `sender_user_id`, `sender_type`, `body`, `metadata`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'customer', 'برجاء متابعة حالة الطلب التجريبي.', NULL, '2026-07-16 18:16:27', '2026-07-16 18:16:27');

CREATE TABLE `support_tickets` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` VARCHAR(255) NOT NULL,
  `user_id` BIGINT UNSIGNED NULL,
  `ticket_number` VARCHAR(255) NOT NULL,
  `subject` VARCHAR(255) NOT NULL,
  `status` VARCHAR(255) NOT NULL DEFAULT 'open',
  `priority` VARCHAR(255) NOT NULL DEFAULT 'normal',
  `last_message` LONGTEXT NULL,
  `last_activity_at` DATETIME NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `support_tickets` (`id`, `uuid`, `user_id`, `ticket_number`, `subject`, `status`, `priority`, `last_message`, `last_activity_at`, `created_at`, `updated_at`) VALUES
(1, '24f55e67-76d2-417d-80b2-6fdc9684dc93', 1, 'TCK-1001', 'تأكيد طلب شحن', 'open', 'normal', 'برجاء متابعة حالة الطلب التجريبي.', '2026-07-16 18:16:27', '2026-07-16 18:16:27', '2026-07-16 18:16:27');

CREATE TABLE `voucher_redemptions` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `voucher_id` BIGINT UNSIGNED NOT NULL,
  `user_id` BIGINT UNSIGNED NOT NULL,
  `wallet_id` BIGINT UNSIGNED NOT NULL,
  `amount_minor` INT NOT NULL,
  `snapshot` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `vouchers` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `code` VARCHAR(255) NOT NULL,
  `name_ar` VARCHAR(255) NOT NULL,
  `name_en` VARCHAR(255) NULL,
  `currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `amount_minor` INT NOT NULL,
  `usage_limit` INT NULL,
  `used_count` INT NOT NULL DEFAULT '0',
  `once_per_user` TINYINT(1) NOT NULL DEFAULT '1',
  `is_active` TINYINT(1) NOT NULL DEFAULT '1',
  `starts_at` DATETIME NULL,
  `ends_at` DATETIME NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vouchers` (`id`, `code`, `name_ar`, `name_en`, `currency_code`, `amount_minor`, `usage_limit`, `used_count`, `once_per_user`, `is_active`, `starts_at`, `ends_at`, `created_at`, `updated_at`) VALUES
(1, 'QA100', 'شحن تجريبي 100 جنيه', 'QA 100 EGP top-up', 'EGP', 10000, 25, 0, 1, 1, NULL, NULL, '2026-07-16 18:16:26', '2026-07-16 18:16:26');

CREATE TABLE `wallet_entries` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `wallet_id` BIGINT UNSIGNED NOT NULL,
  `uuid` VARCHAR(255) NOT NULL,
  `type` VARCHAR(255) NOT NULL,
  `amount_minor` INT NOT NULL,
  `balance_after_minor` INT NOT NULL,
  `reference_type` VARCHAR(255) NULL,
  `reference_id` BIGINT UNSIGNED NULL,
  `description` LONGTEXT NULL,
  `metadata` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `wallet_entries` (`id`, `wallet_id`, `uuid`, `type`, `amount_minor`, `balance_after_minor`, `reference_type`, `reference_id`, `description`, `metadata`, `created_at`, `updated_at`) VALUES
(1, 1, '6f0a1742-a813-4868-8f44-971850153a97', 'seed_credit', 250000, 250000, NULL, NULL, 'Local seed credit for QA only.', NULL, '2026-07-16 18:16:26', '2026-07-16 18:16:26');

CREATE TABLE `wallet_transfers` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `uuid` VARCHAR(255) NOT NULL,
  `sender_user_id` BIGINT UNSIGNED NOT NULL,
  `receiver_user_id` BIGINT UNSIGNED NOT NULL,
  `currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `amount_minor` INT NOT NULL,
  `status` VARCHAR(255) NOT NULL DEFAULT 'completed',
  `note` LONGTEXT NULL,
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `wallets` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` BIGINT UNSIGNED NOT NULL,
  `currency_code` VARCHAR(255) NOT NULL DEFAULT 'EGP',
  `balance_minor` INT NOT NULL DEFAULT '0',
  `held_minor` INT NOT NULL DEFAULT '0',
  `is_frozen` TINYINT(1) NOT NULL DEFAULT '0',
  `created_at` DATETIME NULL,
  `updated_at` DATETIME NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `wallets` (`id`, `user_id`, `currency_code`, `balance_minor`, `held_minor`, `is_frozen`, `created_at`, `updated_at`) VALUES
(1, 1, 'EGP', 250000, 0, 0, '2026-07-16 18:16:26', '2026-07-16 18:16:26');


-- Final schema upgrades and catalog taxonomy


ALTER TABLE `product_variants`
  ADD COLUMN `sort_order` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `is_best_seller`,
  ADD COLUMN `source_external_id` VARCHAR(120) NULL AFTER `sort_order`,
  ADD COLUMN `source_url` TEXT NULL AFTER `source_external_id`,
  ADD KEY `product_variants_sort_order_index` (`sort_order`),
  ADD KEY `product_variants_source_external_id_index` (`source_external_id`);

ALTER TABLE `games`
  ADD COLUMN `source_provider` VARCHAR(40) NULL AFTER `image_path`,
  ADD COLUMN `source_url` TEXT NULL AFTER `source_provider`,
  ADD COLUMN `source_imported_at` DATETIME NULL AFTER `source_url`,
  ADD KEY `games_source_provider_index` (`source_provider`);

ALTER TABLE `site_settings`
  ADD COLUMN `maintenance_mode` TINYINT(1) NOT NULL DEFAULT 0 AFTER `logo_path`,
  ADD COLUMN `maintenance_message_ar` VARCHAR(255) NULL AFTER `maintenance_mode`,
  ADD COLUMN `maintenance_message_en` VARCHAR(255) NULL AFTER `maintenance_message_ar`,
  ADD COLUMN `wallet_transfers_enabled` TINYINT(1) NOT NULL DEFAULT 1 AFTER `maintenance_message_en`,
  ADD COLUMN `wallet_transfers_require_approval` TINYINT(1) NOT NULL DEFAULT 0 AFTER `wallet_transfers_enabled`,
  ADD COLUMN `wallet_transfer_min_minor` BIGINT NOT NULL DEFAULT 100 AFTER `wallet_transfers_require_approval`,
  ADD COLUMN `wallet_transfer_max_minor` BIGINT NOT NULL DEFAULT 5000000 AFTER `wallet_transfer_min_minor`,
  ADD KEY `site_settings_maintenance_mode_index` (`maintenance_mode`);

ALTER TABLE `wallet_transfers`
  ADD COLUMN `reviewed_by_user_id` BIGINT UNSIGNED NULL AFTER `receiver_user_id`,
  ADD COLUMN `reviewed_at` DATETIME NULL AFTER `status`,
  ADD COLUMN `admin_note` TEXT NULL AFTER `note`,
  ADD COLUMN `metadata` JSON NULL AFTER `admin_note`,
  ADD KEY `wallet_transfers_reviewed_by_user_id_index` (`reviewed_by_user_id`);

INSERT IGNORE INTO `categories` (`id`,`parent_id`,`name_ar`,`name_en`,`slug`,`icon`,`color`,`description_ar`,`description_en`,`sort_order`,`is_featured`,`is_active`,`created_at`,`updated_at`) VALUES
(9,NULL,'الحسابات الرقمية','Digital Accounts','accounts','users','#6d4aff','حسابات ألعاب واشتراكات رقمية جاهزة من بائعين موثوقين.','Ready-to-use gaming and subscription accounts from trusted sellers.',3,1,1,NOW(),NOW()),
(10,1,'ألعاب الموبايل','Mobile Games','mobile-games','grid','#1268ff',NULL,NULL,1,1,1,NOW(),NOW()),
(11,1,'ألعاب الكمبيوتر والكونسول','PC & Console Games','pc-console-games','grid','#00a98f',NULL,NULL,2,1,1,NOW(),NOW()),
(12,2,'بطاقات منصات الألعاب','Gaming Gift Cards','gaming-gift-cards','grid','#ff8a1e',NULL,NULL,3,1,1,NOW(),NOW()),
(13,2,'بطاقات المتاجر','Store Gift Cards','store-gift-cards','grid','#ec4899',NULL,NULL,4,1,1,NOW(),NOW()),
(14,9,'حسابات الألعاب','Gaming Accounts','gaming-accounts','grid','#6d4aff',NULL,NULL,5,1,1,NOW(),NOW()),
(15,9,'حسابات الاشتراكات','Subscription Accounts','subscription-accounts','grid','#8b5cf6',NULL,NULL,6,1,1,NOW(),NOW());

INSERT IGNORE INTO `migrations` (`id`,`migration`,`batch`) VALUES
(45,'2026_07_23_000001_admin_beast_refinements',5),
(46,'2026_07_23_000002_add_wallet_transfer_controls',5),
(47,'2026_07_23_000003_add_granular_admin_permissions',5),
(48,'2026_08_01_000001_add_google_oauth_to_users_table',6),
(49,'2026_08_01_000002_add_import_source_fields',6);


-- RaseedNow upgrade: category images and encrypted account inventory
-- Import this file into the existing selected database in phpMyAdmin.

ALTER TABLE `categories`
  ADD COLUMN `image_path` VARCHAR(255) NULL AFTER `icon`;

INSERT IGNORE INTO `migrations` (`id`,`migration`,`batch`) VALUES
(50,'2026_08_01_000003_add_category_images_and_account_inventory',7);

