-- Felixes/Shobley manual backup (PHP fallback) — 2026-10-23 14:12:28

SET FOREIGN_KEY_CHECKS=0;

DROP TABLE IF EXISTS `app_settings`;
CREATE TABLE `app_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `app_settings_key_unique` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `audit_logs`;
CREATE TABLE `audit_logs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `action` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `details` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `audit_logs_user_id_foreign` (`user_id`),
  CONSTRAINT `audit_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `audit_logs` VALUES ('1', '2', 'Tax Rate Updated', 'California (CA): 7.25% → 7.50%', '2026-10-23 10:14:54');
INSERT INTO `audit_logs` VALUES ('2', '2', 'Price Override', 'Product \"Unisex Staple T-Shirt\" (#1): $24.38 → $26.99', '2026-10-23 10:15:32');
INSERT INTO `audit_logs` VALUES ('3', '2', 'Refund Issued', 'Order SHB-90002: $48.2 full refund (failed)', '2026-10-23 10:15:58');
INSERT INTO `audit_logs` VALUES ('4', '2', 'Staff Added', 'Nadia Fonseka (nadia@shobley.test) added as admin', '2026-10-23 10:16:25');
INSERT INTO `audit_logs` VALUES ('5', '2', 'Gateway Settings Changed', 'Updated: printful.store_id', '2026-10-23 10:16:56');

DROP TABLE IF EXISTS `cache`;
CREATE TABLE `cache` (
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` bigint NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `cache` VALUES ('shobley-cache-app_setting:cj.api_key', 'N;', '2108110617');
INSERT INTO `cache` VALUES ('shobley-cache-app_setting:cj.email', 'N;', '2108110617');
INSERT INTO `cache` VALUES ('shobley-cache-app_setting:printful.api_key', 'N;', '2108110617');
INSERT INTO `cache` VALUES ('shobley-cache-app_setting:stripe.key', 'N;', '2108110617');
INSERT INTO `cache` VALUES ('shobley-cache-app_setting:stripe.secret', 'N;', '2108110617');
INSERT INTO `cache` VALUES ('shobley-cache-app_setting:stripe.webhook_secret', 'N;', '2108110617');

DROP TABLE IF EXISTS `cache_locks`;
CREATE TABLE `cache_locks` (
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` bigint NOT NULL,
  PRIMARY KEY (`key`),
  KEY `cache_locks_expiration_index` (`expiration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `carousel_slides`;
CREATE TABLE `carousel_slides` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `media_type` enum('image','video') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'image',
  `media_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `eyebrow_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `headline` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subtext` text COLLATE utf8mb4_unicode_ci,
  `cta_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cta_link` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sort_order` int unsigned NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `carousel_slides` VALUES ('1', 'image', NULL, 'SHOP SMART • LIVE BETTER', 'Quality Products for a Smarter You.', 'Top brands. Great value. Fast & reliable delivery across USA.', 'Shop Now', '/products', '0', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `carousel_slides` VALUES ('2', 'video', NULL, 'NEW ARRIVALS', 'Discover More. Shop Smarter.', 'Quality products, great value & a seamless online shopping experience.', 'Shop Now', '/products', '1', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `carousel_slides` VALUES ('3', 'image', NULL, 'LIMITED TIME', 'Holiday Deals Are Here', NULL, 'Explore Deals', '/products?deals=1', '2', '0', '2026-10-23 08:06:20', '2026-10-23 08:06:20');

DROP TABLE IF EXISTS `cart_items`;
CREATE TABLE `cart_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cart_id` bigint unsigned NOT NULL,
  `product_variant_id` bigint unsigned NOT NULL,
  `quantity` int unsigned NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cart_items_cart_id_product_variant_id_unique` (`cart_id`,`product_variant_id`),
  KEY `cart_items_product_variant_id_foreign` (`product_variant_id`),
  CONSTRAINT `cart_items_cart_id_foreign` FOREIGN KEY (`cart_id`) REFERENCES `carts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `cart_items_product_variant_id_foreign` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `cart_items` VALUES ('1', '1', '1', '1', '2026-10-23 09:27:28', '2026-10-23 09:27:28');

DROP TABLE IF EXISTS `carts`;
CREATE TABLE `carts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `session_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `carts_user_id_unique` (`user_id`),
  UNIQUE KEY `carts_session_id_unique` (`session_id`),
  CONSTRAINT `carts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `carts` VALUES ('1', '2', NULL, '2026-10-23 09:27:20', '2026-10-23 09:27:20');

DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `icon` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'bi-box-seam',
  `sort_order` int unsigned NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `categories_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `categories` VALUES ('1', 'Electronics', 'electronics', 'bi-cpu', '0', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `categories` VALUES ('2', 'Home & Living', 'home-living', 'bi-house-door', '1', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `categories` VALUES ('3', 'Fashion', 'fashion', 'bi-bag', '2', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `categories` VALUES ('4', 'Beauty & Health', 'beauty-health', 'bi-flower1', '3', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `categories` VALUES ('5', 'Sports & Outdoors', 'sports-outdoors', 'bi-bicycle', '4', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `categories` VALUES ('6', 'Toys & Games', 'toys-games', 'bi-controller', '5', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `categories` VALUES ('7', 'Automotive', 'automotive', 'bi-car-front', '6', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');

DROP TABLE IF EXISTS `failed_jobs`;
CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` varchar(255) 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,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`),
  KEY `failed_jobs_connection_queue_failed_at_index` (`connection`,`queue`,`failed_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `fulfillment_attempts`;
CREATE TABLE `fulfillment_attempts` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `vendor_order_id` bigint unsigned NOT NULL,
  `attempt_number` int unsigned NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `response_payload` json DEFAULT NULL,
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fulfillment_attempts_vendor_order_id_foreign` (`vendor_order_id`),
  CONSTRAINT `fulfillment_attempts_vendor_order_id_foreign` FOREIGN KEY (`vendor_order_id`) REFERENCES `vendor_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `fulfillment_attempts` VALUES ('1', '1', '1', 'skipped', NULL, 'Printful API credentials are not configured yet.', '2026-10-23 09:45:01', '2026-10-23 09:45:01');
INSERT INTO `fulfillment_attempts` VALUES ('2', '1', '2', 'failed', NULL, 'HTTP request returned status code 401:\n{\"code\":401,\"result\":\"The access token provided is invalid.\",\"error\":{\"reason\":\"Unauthorized\",\"message\":\"The access toke (truncated...)\n', '2026-10-23 09:45:32', '2026-10-23 09:45:32');
INSERT INTO `fulfillment_attempts` VALUES ('3', '1', '3', 'failed', NULL, 'HTTP request returned status code 401:\n{\"code\":401,\"result\":\"The access token provided is invalid.\",\"error\":{\"reason\":\"Unauthorized\",\"message\":\"The access toke (truncated...)\n', '2026-10-23 09:45:42', '2026-10-23 09:45:42');
INSERT INTO `fulfillment_attempts` VALUES ('4', '1', '4', 'skipped', NULL, 'Printful API credentials are not configured yet.', '2026-10-23 09:46:32', '2026-10-23 09:46:32');

DROP TABLE IF EXISTS `job_batches`;
CREATE TABLE `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `jobs`;
CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` smallint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `migrations` VALUES ('1', '0001_01_01_000000_create_users_table', '1');
INSERT INTO `migrations` VALUES ('2', '0001_01_01_000001_create_cache_table', '1');
INSERT INTO `migrations` VALUES ('3', '0001_01_01_000002_create_jobs_table', '1');
INSERT INTO `migrations` VALUES ('4', '2026_10_23_073411_create_permission_tables', '1');
INSERT INTO `migrations` VALUES ('5', '2026_10_23_080438_create_categories_table', '2');
INSERT INTO `migrations` VALUES ('6', '2026_10_23_080439_create_subcategories_table', '2');
INSERT INTO `migrations` VALUES ('7', '2026_10_23_080441_create_tax_rates_table', '2');
INSERT INTO `migrations` VALUES ('8', '2026_10_23_080442_create_carousel_slides_table', '2');
INSERT INTO `migrations` VALUES ('9', '2026_10_23_082503_create_vendor_product_candidates_table', '3');
INSERT INTO `migrations` VALUES ('10', '2026_10_23_082504_create_products_table', '3');
INSERT INTO `migrations` VALUES ('11', '2026_10_23_082505_create_product_variants_table', '3');
INSERT INTO `migrations` VALUES ('12', '2026_10_23_091819_create_carts_table', '4');
INSERT INTO `migrations` VALUES ('13', '2026_10_23_091820_create_cart_items_table', '4');
INSERT INTO `migrations` VALUES ('14', '2026_10_23_091821_create_orders_table', '4');
INSERT INTO `migrations` VALUES ('15', '2026_10_23_091822_create_order_items_table', '4');
INSERT INTO `migrations` VALUES ('16', '2026_10_23_091823_create_payments_table', '4');
INSERT INTO `migrations` VALUES ('17', '2026_10_23_091824_create_webhook_events_table', '4');
INSERT INTO `migrations` VALUES ('18', '2026_10_23_093634_create_vendor_orders_table', '5');
INSERT INTO `migrations` VALUES ('19', '2026_10_23_093635_create_vendor_order_items_table', '5');
INSERT INTO `migrations` VALUES ('20', '2026_10_23_093636_create_fulfillment_attempts_table', '5');
INSERT INTO `migrations` VALUES ('21', '2026_10_23_093637_create_refunds_table', '5');
INSERT INTO `migrations` VALUES ('22', '2026_10_23_095348_create_audit_logs_table', '6');
INSERT INTO `migrations` VALUES ('23', '2026_10_23_095349_create_app_settings_table', '6');
INSERT INTO `migrations` VALUES ('24', '2026_10_23_095739_add_shipped_notified_at_to_orders_table', '7');

DROP TABLE IF EXISTS `model_has_permissions`;
CREATE TABLE `model_has_permissions` (
  `permission_id` bigint unsigned NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `model_has_roles`;
CREATE TABLE `model_has_roles` (
  `role_id` bigint unsigned NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `model_has_roles` VALUES ('2', 'App\\Models\\User', '1');
INSERT INTO `model_has_roles` VALUES ('1', 'App\\Models\\User', '2');
INSERT INTO `model_has_roles` VALUES ('3', 'App\\Models\\User', '3');
INSERT INTO `model_has_roles` VALUES ('3', 'App\\Models\\User', '4');
INSERT INTO `model_has_roles` VALUES ('3', 'App\\Models\\User', '5');
INSERT INTO `model_has_roles` VALUES ('3', 'App\\Models\\User', '6');

DROP TABLE IF EXISTS `order_items`;
CREATE TABLE `order_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `product_variant_id` bigint unsigned DEFAULT NULL,
  `product_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `variant_option_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sku` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_vendor` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unit_price` decimal(10,2) NOT NULL,
  `unit_cost` decimal(10,2) NOT NULL,
  `quantity` int unsigned NOT NULL,
  `line_total` decimal(10,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_items_order_id_foreign` (`order_id`),
  KEY `order_items_product_variant_id_foreign` (`product_variant_id`),
  CONSTRAINT `order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_items_product_variant_id_foreign` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `order_items` VALUES ('1', '1', '1', 'Unisex Staple T-Shirt', 'Black / M', 'SHB-UNISEX-STAPL-1', 'printful', '24.38', '9.75', '1', '24.38', '2026-10-23 09:30:03', '2026-10-23 09:30:03');
INSERT INTO `order_items` VALUES ('2', '2', '1', 'Unisex Staple T-Shirt', 'Black / M', 'SHB-UNISEX-STAPL-1', 'printful', '24.38', '9.75', '1', '24.38', '2026-10-23 09:33:00', '2026-10-23 09:33:00');
INSERT INTO `order_items` VALUES ('3', '3', NULL, 'Wireless Mouse', 'Black', 'SKU-1', 'printful', '30.00', '15.00', '2', '60.00', '2026-10-23 10:12:18', '2026-10-23 10:12:18');
INSERT INTO `order_items` VALUES ('4', '4', NULL, 'Phone Case', 'Clear', 'SKU-2', 'cj', '40.00', '20.00', '1', '40.00', '2026-10-23 10:12:18', '2026-10-23 10:12:18');
INSERT INTO `order_items` VALUES ('5', '5', NULL, 'USB Cable', '2m', 'SKU-3', 'printful', '20.00', '10.00', '1', '20.00', '2026-10-23 10:12:18', '2026-10-23 10:12:18');

DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `guest_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_address_line1` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_address_line2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_city` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_state` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_zip` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `shipping_country` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'US',
  `shipping_method` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'standard',
  `subtotal` decimal(10,2) NOT NULL,
  `shipping_total` decimal(10,2) NOT NULL,
  `tax_total` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'USD',
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending_payment',
  `vendor_split_tax_breakdown` json DEFAULT NULL,
  `release_at` timestamp NULL DEFAULT NULL,
  `shipped_notified_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `orders_order_number_unique` (`order_number`),
  KEY `orders_user_id_foreign` (`user_id`),
  CONSTRAINT `orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `orders` VALUES ('1', 'SHB-74843', '2', NULL, 'john@example.com', NULL, 'John Carter', '1420 Maple Avenue', NULL, 'Los Angeles', 'CA', '90001', 'US', 'standard', '24.38', '8.50', '1.77', '34.65', 'USD', 'cancelled', '{\"printful\": {\"tax\": 1.77, \"subtotal\": 24.38, \"tax_source\": \"tax_rates_table\"}}', '2026-10-23 11:30:56', NULL, '2026-10-23 09:43:56', '2026-10-23 09:30:03', '2026-10-23 09:43:56');
INSERT INTO `orders` VALUES ('2', 'SHB-20008', NULL, 'fcf6a270-73ca-4561-aa83-9dc5495f1e1a', 'guest@example.com', NULL, 'Guest Buyer', '500 Guest St', NULL, 'Austin', 'TX', '73301', 'US', 'standard', '24.38', '8.50', '1.52', '34.40', 'USD', 'paid', '{\"printful\": {\"tax\": 1.52, \"subtotal\": 24.38, \"tax_source\": \"tax_rates_table\"}}', '2026-10-23 09:39:38', NULL, NULL, '2026-10-23 09:33:00', '2026-10-23 09:44:38');
INSERT INTO `orders` VALUES ('3', 'SHB-90001', '5', NULL, 'customer@test.com', NULL, 'Test Customer', '500 Market Street', NULL, 'San Francisco', 'CA', '94105', 'US', 'standard', '60.00', '8.50', '4.80', '73.30', 'USD', 'paid', NULL, '2026-10-23 12:12:13', NULL, NULL, '2026-10-23 10:12:13', '2026-10-23 10:12:13');
INSERT INTO `orders` VALUES ('4', 'SHB-90002', '5', NULL, 'customer@test.com', NULL, 'Test Customer', '500 Market Street', NULL, 'San Francisco', 'CA', '94105', 'US', 'standard', '40.00', '5.00', '3.20', '48.20', 'USD', 'paid', NULL, '2026-10-23 07:12:18', NULL, NULL, '2026-10-23 10:12:18', '2026-10-23 10:12:18');
INSERT INTO `orders` VALUES ('5', 'SHB-90003', '5', NULL, 'customer@test.com', NULL, 'Test Customer', '500 Market Street', NULL, 'San Francisco', 'CA', '94105', 'US', 'standard', '20.00', '5.00', '1.60', '26.60', 'USD', 'pending_payment', NULL, '2026-10-23 12:12:18', NULL, NULL, '2026-10-23 10:12:18', '2026-10-23 10:12:18');

DROP TABLE IF EXISTS `password_reset_tokens`;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `payments`;
CREATE TABLE `payments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `stripe_payment_intent_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'USD',
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'requires_payment_method',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payments_stripe_payment_intent_id_unique` (`stripe_payment_intent_id`),
  KEY `payments_order_id_foreign` (`order_id`),
  CONSTRAINT `payments_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `payments` VALUES ('1', '1', 'pi_test_8fbf735a6900b200', '34.65', 'USD', 'succeeded', '2026-10-23 09:30:50', '2026-10-23 09:30:56');
INSERT INTO `payments` VALUES ('2', '2', 'pi_test_080640be229ae452', '34.40', 'USD', 'succeeded', '2026-10-23 09:34:15', '2026-10-23 09:34:20');

DROP TABLE IF EXISTS `permissions`;
CREATE TABLE `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `product_variants`;
CREATE TABLE `product_variants` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint unsigned NOT NULL,
  `sku` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `vendor_sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `option_label` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cost_price` decimal(10,2) NOT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `weight_lb` decimal(6,2) DEFAULT NULL,
  `stock_status` enum('in_stock','low_stock','out_of_stock') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'in_stock',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_variants_sku_unique` (`sku`),
  KEY `product_variants_product_id_foreign` (`product_id`),
  CONSTRAINT `product_variants_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `product_variants` VALUES ('1', '1', 'SHB-UNISEX-STAPL-1', NULL, 'Black / M', 'Black', 'M', '9.75', NULL, '0.31', 'in_stock', '1', '2026-10-23 08:34:01', '2026-10-23 08:34:01');
INSERT INTO `product_variants` VALUES ('2', '1', 'SHB-UNISEX-STAPL-2', NULL, 'Black / L', 'Black', 'L', '9.75', NULL, '0.34', 'in_stock', '1', '2026-10-23 08:34:01', '2026-10-23 08:34:01');
INSERT INTO `product_variants` VALUES ('3', '1', 'SHB-UNISEX-STAPL-3', NULL, 'White / M', 'White', 'M', '9.75', NULL, '0.31', 'in_stock', '1', '2026-10-23 08:34:01', '2026-10-23 08:34:01');

DROP TABLE IF EXISTS `products`;
CREATE TABLE `products` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `category_id` bigint unsigned DEFAULT NULL,
  `subcategory_id` bigint unsigned DEFAULT NULL,
  `vendor_product_candidate_id` bigint unsigned DEFAULT NULL,
  `source_vendor` enum('printful','cj') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `price` decimal(10,2) NOT NULL,
  `compare_at_price` decimal(10,2) DEFAULT NULL,
  `images` json DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `products_slug_unique` (`slug`),
  KEY `products_category_id_foreign` (`category_id`),
  KEY `products_subcategory_id_foreign` (`subcategory_id`),
  KEY `products_vendor_product_candidate_id_foreign` (`vendor_product_candidate_id`),
  CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL,
  CONSTRAINT `products_subcategory_id_foreign` FOREIGN KEY (`subcategory_id`) REFERENCES `subcategories` (`id`) ON DELETE SET NULL,
  CONSTRAINT `products_vendor_product_candidate_id_foreign` FOREIGN KEY (`vendor_product_candidate_id`) REFERENCES `vendor_product_candidates` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `products` VALUES ('1', '3', '11', '1', 'printful', 'Unisex Staple T-Shirt', 'unisex-staple-t-shirt', NULL, '26.99', NULL, '[\"https://placehold.co/600x600/F8FAFC/64748B?text=Tee\", \"https://placehold.co/600x600/111827/FFFFFF?text=Black\", \"https://placehold.co/600x600/F8FAFC/111827?text=White\"]', '1', '2026-10-23 08:34:01', '2026-10-23 10:15:32');

DROP TABLE IF EXISTS `refunds`;
CREATE TABLE `refunds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `stripe_refund_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `initiated_by` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `refunds_stripe_refund_id_unique` (`stripe_refund_id`),
  KEY `refunds_order_id_foreign` (`order_id`),
  KEY `refunds_initiated_by_foreign` (`initiated_by`),
  CONSTRAINT `refunds_initiated_by_foreign` FOREIGN KEY (`initiated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `refunds_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `refunds` VALUES ('1', '1', NULL, '34.65', 'Changed my mind', 'failed', NULL, '2026-10-23 09:43:56', '2026-10-23 09:43:56');
INSERT INTO `refunds` VALUES ('2', '2', NULL, '10.00', 'Admin-issued partial refund', 'failed', '2', '2026-10-23 09:47:11', '2026-10-23 09:47:46');
INSERT INTO `refunds` VALUES ('3', '4', NULL, '48.20', 'Admin-issued full refund', 'failed', '2', '2026-10-23 10:15:58', '2026-10-23 10:15:58');

DROP TABLE IF EXISTS `role_has_permissions`;
CREATE TABLE `role_has_permissions` (
  `permission_id` bigint unsigned NOT NULL,
  `role_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`),
  CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


DROP TABLE IF EXISTS `roles`;
CREATE TABLE `roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `roles` VALUES ('1', 'super-admin', 'web', '2026-10-23 07:48:51', '2026-10-23 07:48:51');
INSERT INTO `roles` VALUES ('2', 'admin', 'web', '2026-10-23 07:48:51', '2026-10-23 07:48:51');
INSERT INTO `roles` VALUES ('3', 'customer', 'web', '2026-10-23 07:48:52', '2026-10-23 07:48:52');

DROP TABLE IF EXISTS `sessions`;
CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `sessions` VALUES ('6xvyuW6vMiuOpc5pmBH8LMHizV2sDg0sAkGOVokj', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiI4QmltcUtXSUV6eUJxY2p5M2R0OFlsTlpYSWtTT3lyY0U5ZHdqWW5SIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdDo4MDgwXC9sb2dpbiIsInJvdXRlIjoibG9naW4ifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', '1792764713');
INSERT INTO `sessions` VALUES ('bxGEMcCYbDk9wkp6pDx3Xg4WHOWbn93y9sbplo1g', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Electron/44.9.3 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJNZ1ZkdXM2VnJCTG82WWhFb3M1YjN3UW1ZanQ3M2pyYlNUSnBLaUh1IiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', '1792764712');
INSERT INTO `sessions` VALUES ('CNLXKHeE79ic1V4gem8ifBTyftJqz9vD9rjmHRuf', '2', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJGSklXYXFLOExDbTJrM1ZldmFiQ3Q5MTlkaHpLVWVibTN3ZkQ2Y1RSIiwidXJsIjpbXSwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdDo4MDgwXC9hZG1pblwvbWFpbnRlbmFuY2UiLCJyb3V0ZSI6ImFkbWluLm1haW50ZW5hbmNlIn0sIl9mbGFzaCI6eyJvbGQiOltdLCJuZXciOltdfSwibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiOjIsInBhc3N3b3JkX2hhc2hfd2ViIjoiYzE1NjU2MDJlN2IzYjc5YzdhZmJkMjI1N2MzNThhMWY3MTc4ZTE3ZDQxN2QwYjU4ODQ3NGQ2ZjkxZTgxOTQzNiJ9', '1792764739');
INSERT INTO `sessions` VALUES ('feRwKnKeyrpH3vd4kgOnUeAiuRcXMRB2wz90ICmY', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Electron/44.9.3 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJ3RnN1a1ZGMVF0MVU4WE5hUXpNbnRuR1k2YkhidjJwQXlYSlFBMWUzIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', '1792764711');
INSERT INTO `sessions` VALUES ('iH6VqWFXm6DLq55lskW2qcm1fwaL5zaCyvmmUIg0', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJWbnVPUFRWRlZTZFlJcTV5Y3JlR0c3WWFaOHdZd21ZNVF4WXVhQ3NuIiwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdDo4MDgwIiwicm91dGUiOiJob21lIn0sIl9mbGFzaCI6eyJvbGQiOltdLCJuZXciOltdfX0=', '1792764710');
INSERT INTO `sessions` VALUES ('p0HEBPbbvDcrpZLIqncNmHRUAiPUflh0PxwEx2uY', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Electron/44.9.3 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJmazFrcTJqMTRERlhQM0k4R3NsaWxkOW44VXBIb0d5cjVxVklQbzhKIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', '1792764714');
INSERT INTO `sessions` VALUES ('PJOsazsjStQfAcvl03y0Tj0EL0061scFHTQTybmx', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Electron/44.9.3 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJwT1NqSTQ2M1JOeHVBaFJ0Uk1sbkxhcFVVNzNQTzBZNEtjSEk0aVZtIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', '1792764715');
INSERT INTO `sessions` VALUES ('PPuN3kv5AJbs6LlLtJkIEDLdHBP1fKRwzr5Y80sB', '2', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJTNWFzcEtEUzVJQ2tIdzF0dzVJSVpSOUROQk93UW0xd2VRcHZGU0tmIiwidXJsIjpbXSwiX3ByZXZpb3VzIjp7InVybCI6Imh0dHA6XC9cL2xvY2FsaG9zdDo4MDgwXC9sb2dpbiIsInJvdXRlIjoibG9naW4ifSwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119LCJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI6MiwicGFzc3dvcmRfaGFzaF93ZWIiOiJjMTU2NTYwMmU3YjNiNzljN2FmYmQyMjU3YzM1OGExZjcxNzhlMTdkNDE3ZDBiNTg4NDc0ZDZmOTFlODE5NDM2In0=', '1792764724');
INSERT INTO `sessions` VALUES ('q9FIL46S7i8Hg2yYGS1oJ7IgUaGCDm0YyxgoDeJS', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Electron/44.9.3 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJXSU1WWE83NkNOeXJkWjNGTzJITW43ekw5ZTlmVm93RXF3OXpkUTRYIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', '1792764714');
INSERT INTO `sessions` VALUES ('up2XXUt9EeSRPFSpwAQ3wru6R98hPIH1Kqw2k72I', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Electron/44.9.3 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJqQnA1UGpsZ3MyNXphMTBCNkZXQ2pwUENoWFlYd0U1YVNxVDJkZjh1IiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', '1792764713');
INSERT INTO `sessions` VALUES ('wENovgeEwKw68QKOLGWg8qbskq8IJlZCVpOSw7n6', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Electron/44.9.3 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJFWHdEYWFHVXhaMGYxYk04b1g4azBaZEo1TGlGbGJKYWdVMTN6dzEyIiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', '1792764716');
INSERT INTO `sessions` VALUES ('WxYmObO0kbZvZIW1lSKdFacEVrBKSgBQJOIIHp6G', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Claude/3.6556.2 Chrome/152.0.7977.167 Electron/44.9.3 Safari/537.36 MSIX', 'eyJfdG9rZW4iOiJHWlE0TTh6N0l2VUZ4MHpLWGVQTXJocHBmNEpUYW5DSG03UkJWb1B3IiwiX2ZsYXNoIjp7Im9sZCI6W10sIm5ldyI6W119fQ==', '1792764715');

DROP TABLE IF EXISTS `subcategories`;
CREATE TABLE `subcategories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `category_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sort_order` int unsigned NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `subcategories_category_id_slug_unique` (`category_id`,`slug`),
  CONSTRAINT `subcategories_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `subcategories` VALUES ('1', '1', 'Headphones & Audio', 'headphones-audio', '0', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('2', '1', 'Smart Watches', 'smart-watches', '1', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('3', '1', 'Phone Accessories', 'phone-accessories', '2', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('4', '1', 'Computer Accessories', 'computer-accessories', '3', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('5', '1', 'Cameras', 'cameras', '4', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('6', '2', 'Kitchen & Dining', 'kitchen-dining', '0', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('7', '2', 'Furniture', 'furniture', '1', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('8', '2', 'Bedding', 'bedding', '2', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('9', '2', 'Decor', 'decor', '3', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('10', '2', 'Storage & Organization', 'storage-organization', '4', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('11', '3', 'Men\'s Clothing', 'mens-clothing', '0', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('12', '3', 'Women\'s Clothing', 'womens-clothing', '1', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('13', '3', 'Shoes', 'shoes', '2', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('14', '3', 'Bags & Accessories', 'bags-accessories', '3', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('15', '3', 'Jewelry', 'jewelry', '4', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('16', '4', 'Skincare', 'skincare', '0', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('17', '4', 'Haircare', 'haircare', '1', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('18', '4', 'Personal Care', 'personal-care', '2', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('19', '4', 'Wellness', 'wellness', '3', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('20', '5', 'Fitness Equipment', 'fitness-equipment', '0', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('21', '5', 'Outdoor Gear', 'outdoor-gear', '1', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('22', '5', 'Activewear', 'activewear', '2', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('23', '5', 'Cycling', 'cycling', '3', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('24', '6', 'Action Figures', 'action-figures', '0', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('25', '6', 'Board Games', 'board-games', '1', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('26', '6', 'Educational Toys', 'educational-toys', '2', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('27', '6', 'Outdoor Play', 'outdoor-play', '3', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('28', '7', 'Car Accessories', 'car-accessories', '0', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('29', '7', 'Car Electronics', 'car-electronics', '1', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `subcategories` VALUES ('30', '7', 'Car Care', 'car-care', '2', '1', '2026-10-23 08:06:20', '2026-10-23 08:06:20');

DROP TABLE IF EXISTS `tax_rates`;
CREATE TABLE `tax_rates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `state_code` varchar(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `state_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` decimal(5,4) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tax_rates_state_code_unique` (`state_code`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `tax_rates` VALUES ('1', 'AL', 'Alabama', '0.0400', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('2', 'AK', 'Alaska', '0.0000', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('3', 'AZ', 'Arizona', '0.0560', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('4', 'AR', 'Arkansas', '0.0650', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('5', 'CA', 'California', '0.0750', '2026-10-23 08:06:20', '2026-10-23 10:14:54');
INSERT INTO `tax_rates` VALUES ('6', 'CO', 'Colorado', '0.0290', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('7', 'CT', 'Connecticut', '0.0635', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('8', 'DE', 'Delaware', '0.0000', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('9', 'FL', 'Florida', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('10', 'GA', 'Georgia', '0.0400', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('11', 'HI', 'Hawaii', '0.0400', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('12', 'ID', 'Idaho', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('13', 'IL', 'Illinois', '0.0625', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('14', 'IN', 'Indiana', '0.0700', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('15', 'IA', 'Iowa', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('16', 'KS', 'Kansas', '0.0650', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('17', 'KY', 'Kentucky', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('18', 'LA', 'Louisiana', '0.0445', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('19', 'ME', 'Maine', '0.0550', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('20', 'MD', 'Maryland', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('21', 'MA', 'Massachusetts', '0.0625', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('22', 'MI', 'Michigan', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('23', 'MN', 'Minnesota', '0.0688', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('24', 'MS', 'Mississippi', '0.0700', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('25', 'MO', 'Missouri', '0.0423', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('26', 'MT', 'Montana', '0.0000', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('27', 'NE', 'Nebraska', '0.0550', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('28', 'NV', 'Nevada', '0.0685', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('29', 'NH', 'New Hampshire', '0.0000', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('30', 'NJ', 'New Jersey', '0.0663', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('31', 'NM', 'New Mexico', '0.0513', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('32', 'NY', 'New York', '0.0400', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('33', 'NC', 'North Carolina', '0.0475', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('34', 'ND', 'North Dakota', '0.0500', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('35', 'OH', 'Ohio', '0.0575', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('36', 'OK', 'Oklahoma', '0.0450', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('37', 'OR', 'Oregon', '0.0000', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('38', 'PA', 'Pennsylvania', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('39', 'RI', 'Rhode Island', '0.0700', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('40', 'SC', 'South Carolina', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('41', 'SD', 'South Dakota', '0.0420', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('42', 'TN', 'Tennessee', '0.0700', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('43', 'TX', 'Texas', '0.0625', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('44', 'UT', 'Utah', '0.0485', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('45', 'VT', 'Vermont', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('46', 'VA', 'Virginia', '0.0530', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('47', 'WA', 'Washington', '0.0650', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('48', 'WV', 'West Virginia', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('49', 'WI', 'Wisconsin', '0.0500', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('50', 'WY', 'Wyoming', '0.0400', '2026-10-23 08:06:20', '2026-10-23 08:06:20');
INSERT INTO `tax_rates` VALUES ('51', 'DC', 'District of Columbia', '0.0600', '2026-10-23 08:06:20', '2026-10-23 08:06:20');

DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `users` VALUES ('1', 'Test Admin', 'admin@example.com', '2026-10-23 07:48:52', '$2y$12$huNuvEyyin/Mbiv26QHBjeZdJaru7PJPi/NXo803i0HuHuS.YW0Ve', 'sMdUdrHAUDbI1SagOAA1nJcwbG7ZnAUC4MDI8rfgrpk7gn9rX0R8VNnqDDja', '2026-10-23 07:48:52', '2026-10-23 07:53:49');
INSERT INTO `users` VALUES ('2', 'Super Admin', 'super-admin@example.com', NULL, '$2y$12$PU1NlwzN4Y4eKEzkA.h8WO1CR0J30Ogrtu0HMb5lDkceoKcokNZom', NULL, '2026-10-23 08:06:21', '2026-10-23 08:06:21');
INSERT INTO `users` VALUES ('3', 'Test Customer', 'customer@example.com', NULL, '$2y$12$zkl104.kBCFvZWAT5AaMa.Yi4eeJBdYSGshHk9m/a67QataCMqn8K', NULL, '2026-10-23 08:06:21', '2026-10-23 08:06:21');
INSERT INTO `users` VALUES ('4', 'New Test Customer', 'newcustomer@example.com', NULL, '$2y$12$v8F96l.CARfRupmZRYt4LuL/aMydOqYcqzFbg.f0/Mx7XxZKSjtFu', NULL, '2026-10-23 08:21:14', '2026-10-23 08:21:14');
INSERT INTO `users` VALUES ('5', 'Test Customer Updated', 'customer@test.com', '2026-10-23 10:11:32', '$2y$12$0Vl4XltmQzPVkum6KpfE9ut0oXvW57tkqepWlja0y1cvGIXivBnfu', 'xxeTtASJCLod2NtLrvFQzvnV3pYAIZA1olTjslIklM9VhfXBB5Z8GnJ3nkwT', '2026-10-23 10:11:32', '2026-10-23 10:14:00');
INSERT INTO `users` VALUES ('6', 'Nadia Fonseka', 'nadia@shobley.test', NULL, '$2y$12$eagnpIN7owXOSKmE.ZU4SO7l77qbhMczNeY8bA2UI3L9ZVm7vBIzS', NULL, '2026-10-23 10:16:25', '2026-10-23 10:16:25');

DROP TABLE IF EXISTS `vendor_order_items`;
CREATE TABLE `vendor_order_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `vendor_order_id` bigint unsigned NOT NULL,
  `order_item_id` bigint unsigned NOT NULL,
  `quantity` int unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vendor_order_items_vendor_order_id_order_item_id_unique` (`vendor_order_id`,`order_item_id`),
  KEY `vendor_order_items_order_item_id_foreign` (`order_item_id`),
  CONSTRAINT `vendor_order_items_order_item_id_foreign` FOREIGN KEY (`order_item_id`) REFERENCES `order_items` (`id`) ON DELETE CASCADE,
  CONSTRAINT `vendor_order_items_vendor_order_id_foreign` FOREIGN KEY (`vendor_order_id`) REFERENCES `vendor_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vendor_order_items` VALUES ('1', '1', '2', '1', '2026-10-23 09:45:01', '2026-10-23 09:45:01');

DROP TABLE IF EXISTS `vendor_orders`;
CREATE TABLE `vendor_orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `vendor` enum('printful','cj') COLLATE utf8mb4_unicode_ci NOT NULL,
  `internal_reference` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `vendor_external_order_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `submitted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vendor_orders_internal_reference_unique` (`internal_reference`),
  KEY `vendor_orders_order_id_foreign` (`order_id`),
  CONSTRAINT `vendor_orders_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vendor_orders` VALUES ('1', '2', 'printful', 'SHB-20008-printful', NULL, 'pending', NULL, '2026-10-23 09:45:01', '2026-10-23 09:46:32');
INSERT INTO `vendor_orders` VALUES ('2', '4', 'cj', 'SHB-90002-cj', NULL, 'submitted', '2026-10-23 10:12:18', '2026-10-23 10:12:18', '2026-10-23 10:12:18');

DROP TABLE IF EXISTS `vendor_product_candidates`;
CREATE TABLE `vendor_product_candidates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `vendor` enum('printful','cj') COLLATE utf8mb4_unicode_ci NOT NULL,
  `vendor_external_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `raw_payload` json NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `base_cost` decimal(10,2) NOT NULL,
  `preview_image_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category_hint` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `variant_count` int unsigned NOT NULL DEFAULT '0',
  `status` enum('researched','selected','listed','discarded') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'researched',
  `selected_by` bigint unsigned DEFAULT NULL,
  `selected_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `vendor_product_candidates_vendor_vendor_external_id_unique` (`vendor`,`vendor_external_id`),
  KEY `vendor_product_candidates_selected_by_foreign` (`selected_by`),
  CONSTRAINT `vendor_product_candidates_selected_by_foreign` FOREIGN KEY (`selected_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `vendor_product_candidates` VALUES ('1', 'printful', 'PF-20456', '{\"title\": \"Unisex Staple T-Shirt\", \"variants\": [{\"size\": \"M\", \"color\": \"Black\", \"image\": \"https://placehold.co/600x600/111827/FFFFFF?text=Black\", \"in_stock\": true, \"weight_lb\": 0.31, \"cost_price\": 9.75, \"vendor_sku\": \"PF-3001-BLK-M\", \"option_label\": \"Black / M\"}, {\"size\": \"L\", \"color\": \"Black\", \"image\": \"https://placehold.co/600x600/111827/FFFFFF?text=Black\", \"in_stock\": true, \"weight_lb\": 0.34, \"cost_price\": 9.75, \"vendor_sku\": \"PF-3001-BLK-L\", \"option_label\": \"Black / L\"}, {\"size\": \"M\", \"color\": \"White\", \"image\": \"https://placehold.co/600x600/F8FAFC/111827?text=White\", \"in_stock\": true, \"weight_lb\": 0.31, \"cost_price\": 9.75, \"vendor_sku\": \"PF-3001-WHT-M\", \"option_label\": \"White / M\"}], \"base_cost\": 9.75, \"description\": \"Soft and lightweight, a Printful bestseller made of 100% Airlume combed cotton.\", \"category_hint\": \"Apparel\", \"preview_image_url\": \"https://placehold.co/600x600/F8FAFC/64748B?text=Tee\", \"vendor_external_id\": \"PF-20456\"}', 'Unisex Staple T-Shirt', '9.75', 'https://placehold.co/600x600/F8FAFC/64748B?text=Tee', 'Apparel', '3', 'listed', '2', '2026-10-23 08:32:30', '2026-10-23 08:32:30', '2026-10-23 08:34:01');

DROP TABLE IF EXISTS `webhook_events`;
CREATE TABLE `webhook_events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `stripe_event_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` json NOT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `webhook_events_stripe_event_id_unique` (`stripe_event_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `webhook_events` VALUES ('1', 'evt_test_3d65e79cb002db5a', 'payment_intent.succeeded', '{\"id\": \"evt_test_3d65e79cb002db5a\", \"data\": {\"object\": {\"id\": \"pi_test_8fbf735a6900b200\", \"object\": \"payment_intent\", \"status\": \"succeeded\"}}, \"type\": \"payment_intent.succeeded\", \"object\": \"event\"}', '2026-10-23 09:30:56', '2026-10-23 09:30:56', '2026-10-23 09:30:56');
INSERT INTO `webhook_events` VALUES ('2', 'evt_test_1ca1ed22f1bc2afb', 'payment_intent.succeeded', '{\"id\": \"evt_test_1ca1ed22f1bc2afb\", \"data\": {\"object\": {\"id\": \"pi_test_080640be229ae452\", \"object\": \"payment_intent\", \"status\": \"succeeded\"}}, \"type\": \"payment_intent.succeeded\", \"object\": \"event\"}', '2026-10-23 09:34:20', '2026-10-23 09:34:20', '2026-10-23 09:34:20');

SET FOREIGN_KEY_CHECKS=1;
