--
-- Host: localhost    Database: ncpos
-- ------------------------------------------------------


--
-- Table structure for table `card_handover_logs`
--

CREATE TABLE `card_handover_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `card_handover_id` bigint(20) unsigned NOT NULL,
  `action` varchar(255) NOT NULL,
  `old_status` varchar(255) DEFAULT NULL,
  `new_status` varchar(255) DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `by_staff_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `card_handover_logs_card_handover_id_foreign` (`card_handover_id`),
  KEY `card_handover_logs_by_staff_id_foreign` (`by_staff_id`),
  CONSTRAINT `card_handover_logs_by_staff_id_foreign` FOREIGN KEY (`by_staff_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `card_handover_logs_card_handover_id_foreign` FOREIGN KEY (`card_handover_id`) REFERENCES `card_handovers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `card_handover_logs`
--

INSERT INTO `card_handover_logs` VALUES (1,1,'created',NULL,'awaiting_pickup','Handover created.',1,'2026-04-21 01:57:54','2026-04-21 01:57:54'),(2,1,'updated','awaiting_pickup','awaiting_pickup','Handover details updated.',1,'2026-04-21 01:58:59','2026-04-21 01:58:59'),(3,1,'collected','awaiting_pickup','collected','code match',1,'2026-04-21 02:00:37','2026-04-21 02:00:37');

--
-- Table structure for table `card_handovers`
--

CREATE TABLE `card_handovers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `handover_code` varchar(255) NOT NULL,
  `dropped_by_member_id` bigint(20) unsigned DEFAULT NULL,
  `dropped_by_name` varchar(255) NOT NULL,
  `dropped_by_phone` varchar(50) NOT NULL,
  `recipient_member_id` bigint(20) unsigned DEFAULT NULL,
  `recipient_name` varchar(255) NOT NULL,
  `recipient_phone` varchar(50) NOT NULL,
  `item_summary` text NOT NULL,
  `total_quantity` int(10) unsigned NOT NULL DEFAULT 1,
  `status` varchar(255) NOT NULL DEFAULT 'awaiting_pickup',
  `storage_location` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `verification_note` text DEFAULT NULL,
  `dropped_at` datetime NOT NULL,
  `collected_at` datetime DEFAULT NULL,
  `collected_by_name` varchar(255) DEFAULT NULL,
  `released_by_staff_id` bigint(20) unsigned DEFAULT NULL,
  `created_by_staff_id` bigint(20) unsigned NOT NULL,
  `updated_by_staff_id` bigint(20) unsigned DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `card_handovers_handover_code_unique` (`handover_code`),
  KEY `card_handovers_dropped_by_member_id_foreign` (`dropped_by_member_id`),
  KEY `card_handovers_recipient_member_id_foreign` (`recipient_member_id`),
  KEY `card_handovers_released_by_staff_id_foreign` (`released_by_staff_id`),
  KEY `card_handovers_created_by_staff_id_foreign` (`created_by_staff_id`),
  KEY `card_handovers_updated_by_staff_id_foreign` (`updated_by_staff_id`),
  KEY `card_handovers_status_index` (`status`),
  KEY `card_handovers_dropped_by_phone_index` (`dropped_by_phone`),
  KEY `card_handovers_recipient_phone_index` (`recipient_phone`),
  KEY `card_handovers_dropped_at_index` (`dropped_at`),
  CONSTRAINT `card_handovers_created_by_staff_id_foreign` FOREIGN KEY (`created_by_staff_id`) REFERENCES `users` (`id`),
  CONSTRAINT `card_handovers_dropped_by_member_id_foreign` FOREIGN KEY (`dropped_by_member_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `card_handovers_recipient_member_id_foreign` FOREIGN KEY (`recipient_member_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `card_handovers_released_by_staff_id_foreign` FOREIGN KEY (`released_by_staff_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `card_handovers_updated_by_staff_id_foreign` FOREIGN KEY (`updated_by_staff_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `card_handovers`
--

INSERT INTO `card_handovers` VALUES (1,'HO-20260421-0001',NULL,'Zamir','0187818177',NULL,'Syamsul','0146909803','barang card',1,'collected','Sheft',NULL,'code match','2026-04-21 09:57:54','2026-04-21 10:00:37','Syamsul',1,1,1,'2026-06-29 00:00:00','2026-04-21 01:57:54','2026-04-21 02:00:37');

--
-- Table structure for table `customers`
--

CREATE TABLE `customers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `member_code` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `current_level_id` bigint(20) unsigned DEFAULT NULL,
  `current_cycle_stamps` int(10) unsigned NOT NULL DEFAULT 0,
  `lifetime_stamps` int(10) unsigned NOT NULL DEFAULT 0,
  `loyalty_joined_at` timestamp NULL DEFAULT NULL,
  `level_expires_at` timestamp NULL DEFAULT NULL,
  `points_balance` int(11) NOT NULL DEFAULT 0,
  `total_spent` decimal(12,2) NOT NULL DEFAULT 0.00,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `customers_member_code_unique` (`member_code`),
  UNIQUE KEY `customers_email_unique` (`email`),
  UNIQUE KEY `customers_phone_unique` (`phone`),
  KEY `customers_current_level_id_foreign` (`current_level_id`),
  CONSTRAINT `customers_current_level_id_foreign` FOREIGN KEY (`current_level_id`) REFERENCES `member_levels` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `customers`
--

INSERT INTO `customers` VALUES (1,'CUST-00001','Sample Member','member@example.test','010-000-0001',1,0,0,'2026-04-21 03:27:39',NULL,0,0.00,1,NULL,'2026-04-20 14:22:57','2026-04-21 03:27:39'),(2,'CUST-260421-8003','Zamir Saufi','zamirsaufi97@gmail.com','0187818177',1,1,1,'2026-04-21 01:44:29',NULL,747,747.50,1,NULL,'2026-04-21 01:44:29','2026-04-21 03:02:22');

--
-- Table structure for table `expense_categories`
--

CREATE TABLE `expense_categories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `expense_categories_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `expense_categories`
--

INSERT INTO `expense_categories` VALUES (1,'Rent','rent','2026-04-18 13:29:12','2026-04-18 13:29:12'),(2,'Payroll','payroll','2026-04-18 13:29:12','2026-04-18 13:29:12'),(3,'Shipping','shipping','2026-04-18 13:29:12','2026-04-18 13:29:12'),(4,'Marketing','marketing','2026-04-18 13:29:12','2026-04-18 13:29:12'),(5,'Events','events','2026-04-18 13:29:12','2026-04-18 13:29:12');

--
-- Table structure for table `expenses`
--

CREATE TABLE `expenses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `category_id` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned NOT NULL,
  `expense_date` date NOT NULL,
  `vendor` varchar(255) DEFAULT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `amount` decimal(12,2) NOT NULL,
  `payment_method` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expenses_category_id_foreign` (`category_id`),
  KEY `expenses_created_by_foreign` (`created_by`),
  KEY `expenses_expense_date_index` (`expense_date`),
  CONSTRAINT `expenses_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `expense_categories` (`id`) ON DELETE SET NULL,
  CONSTRAINT `expenses_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `expenses`
--


--
-- Table structure for table `loyalty_level_histories`
--

CREATE TABLE `loyalty_level_histories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `customer_id` bigint(20) unsigned NOT NULL,
  `old_level_id` bigint(20) unsigned DEFAULT NULL,
  `new_level_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `stamps_used` int(10) unsigned NOT NULL DEFAULT 0,
  `upgraded_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loyalty_level_histories_old_level_id_foreign` (`old_level_id`),
  KEY `loyalty_level_histories_new_level_id_foreign` (`new_level_id`),
  KEY `loyalty_level_histories_user_id_foreign` (`user_id`),
  KEY `loyalty_level_histories_customer_id_upgraded_at_index` (`customer_id`,`upgraded_at`),
  CONSTRAINT `loyalty_level_histories_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loyalty_level_histories_new_level_id_foreign` FOREIGN KEY (`new_level_id`) REFERENCES `member_levels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loyalty_level_histories_old_level_id_foreign` FOREIGN KEY (`old_level_id`) REFERENCES `member_levels` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loyalty_level_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loyalty_level_histories`
--


--
-- Table structure for table `loyalty_point_transactions`
--

CREATE TABLE `loyalty_point_transactions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `customer_id` bigint(20) unsigned NOT NULL,
  `sale_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `type` varchar(255) NOT NULL,
  `points_change` int(11) NOT NULL,
  `balance_before` int(11) NOT NULL,
  `balance_after` int(11) NOT NULL,
  `money_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `description` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loyalty_point_transactions_sale_id_foreign` (`sale_id`),
  KEY `loyalty_point_transactions_user_id_foreign` (`user_id`),
  KEY `loyalty_point_transactions_customer_id_created_at_index` (`customer_id`,`created_at`),
  CONSTRAINT `loyalty_point_transactions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loyalty_point_transactions_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loyalty_point_transactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loyalty_point_transactions`
--

INSERT INTO `loyalty_point_transactions` VALUES (1,1,4,1,'earned',250,0,250,0.00,'Earned from sale S-20260421024049-486','2026-04-20 18:40:49','2026-04-20 18:40:49'),(2,2,6,1,'earned',250,0,250,0.00,'Earned from sale S-20260421094752-366','2026-04-21 01:47:52','2026-04-21 01:47:52'),(3,2,7,1,'earned',250,250,500,0.00,'Earned from sale S-20260421100611-749','2026-04-21 02:06:11','2026-04-21 02:06:11'),(4,2,8,1,'earned',247,500,747,0.00,'Earned from sale S-20260421110222-188','2026-04-21 03:02:22','2026-04-21 03:02:22');

--
-- Table structure for table `loyalty_stamp_transactions`
--

CREATE TABLE `loyalty_stamp_transactions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `customer_id` bigint(20) unsigned NOT NULL,
  `sale_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `stamp_count` int(11) NOT NULL,
  `week_key` varchar(255) DEFAULT NULL,
  `type` enum('earned','revoked','adjusted','level_up_reset') NOT NULL,
  `notes` text DEFAULT NULL,
  `needs_manual_review` tinyint(1) NOT NULL DEFAULT 0,
  `earned_sale_id` bigint(20) unsigned DEFAULT NULL,
  `weekly_earned_key` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `loyalty_stamp_transactions_earned_sale_id_unique` (`earned_sale_id`),
  UNIQUE KEY `loyalty_stamp_transactions_weekly_earned_key_unique` (`weekly_earned_key`),
  KEY `loyalty_stamp_transactions_sale_id_foreign` (`sale_id`),
  KEY `loyalty_stamp_transactions_user_id_foreign` (`user_id`),
  KEY `loyalty_stamp_transactions_customer_id_type_created_at_index` (`customer_id`,`type`,`created_at`),
  KEY `loyalty_stamp_transactions_week_key_index` (`week_key`),
  CONSTRAINT `loyalty_stamp_transactions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loyalty_stamp_transactions_earned_sale_id_foreign` FOREIGN KEY (`earned_sale_id`) REFERENCES `sales` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loyalty_stamp_transactions_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loyalty_stamp_transactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loyalty_stamp_transactions`
--

INSERT INTO `loyalty_stamp_transactions` VALUES (1,1,4,1,1,'2026-W17','earned','Earned from sale S-20260421024049-486.',0,4,'1:2026-W17','2026-04-20 18:40:49','2026-04-20 18:40:49'),(2,2,6,1,1,'2026-W17','earned','Earned from sale S-20260421094752-366.',0,6,'2:2026-W17','2026-04-21 01:47:52','2026-04-21 01:47:52');

--
-- Table structure for table `member_levels`
--

CREATE TABLE `member_levels` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `rank_order` int(10) unsigned NOT NULL,
  `stamps_required` int(10) unsigned NOT NULL DEFAULT 8,
  `discount_type` varchar(255) NOT NULL DEFAULT 'none',
  `discount_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `benefit_description` text 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 `member_levels_rank_order_unique` (`rank_order`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `member_levels`
--

INSERT INTO `member_levels` VALUES (1,'Rookie',1,8,'none',0.00,'Base loyalty tier with stamp and point earning.',1,'2026-04-20 15:22:25','2026-04-21 03:09:42'),(2,'Grinder',2,8,'percent',2.00,'Automatic 2% checkout discount.',1,'2026-04-20 15:22:25','2026-04-21 02:16:35'),(3,'Elite',3,8,'percent',5.00,'Automatic 5% checkout discount.',1,'2026-04-20 15:22:25','2026-04-21 02:16:35'),(4,'Legend',4,8,'percent',10.00,'Automatic 10% checkout discount.',1,'2026-04-20 15:22:25','2026-04-21 02:16:35');

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

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

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

INSERT INTO `migrations` 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_personal_access_tokens_table',1),(4,'2026_04_16_000100_create_roles_and_permissions_tables',1),(5,'2026_04_16_000200_create_catalog_tables',1),(6,'2026_04_16_000300_create_supplier_purchase_tables',1),(7,'2026_04_16_000400_create_sales_tables',1),(8,'2026_04_16_000500_create_expense_tables',1),(9,'2026_04_16_000600_create_stock_movements_table',1),(10,'2026_04_16_000700_create_settings_table',1),(11,'2026_04_18_000800_create_tournament_tables',1),(12,'2026_04_19_000900_create_customers_and_loyalty_tables',2),(13,'2026_04_20_001000_create_member_levels_and_stamp_loyalty_tables',3),(14,'2026_04_21_001100_add_level_expiry_to_customers',4),(15,'2026_04_21_001200_create_product_types_table',5),(16,'2026_04_21_001300_add_result_fields_to_tournament_registrations',6),(17,'2026_04_21_001400_create_tournament_games_table',7),(18,'2026_04_21_001500_add_sale_document_fields',8),(19,'2026_04_21_001600_add_customer_to_tournament_registrations',9),(20,'2026_04_21_001700_create_card_handover_tables',10),(21,'2026_04_21_001800_add_benefits_to_member_levels_and_sales',11);

--
-- Table structure for table `permission_role`
--

CREATE TABLE `permission_role` (
  `permission_id` bigint(20) unsigned NOT NULL,
  `role_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `permission_role_role_id_foreign` (`role_id`),
  CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permission_role`
--

INSERT INTO `permission_role` VALUES (1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(4,1),(4,3),(5,1),(5,2),(5,3),(6,1),(7,1),(7,2),(7,3),(8,1),(9,1),(9,2),(10,1),(10,2),(11,1),(11,2),(12,1),(13,1),(13,2),(14,1),(15,1),(15,2),(15,3),(16,1),(17,1),(17,3),(18,1),(18,2),(19,1),(19,2),(20,1),(21,1),(22,1),(22,2),(22,3),(23,1),(24,1),(24,2),(24,3),(25,1),(25,3);

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `label` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` VALUES (1,'dashboard.view','View dashboard','2026-04-18 13:29:12','2026-04-18 13:29:12'),(2,'products.view','View products','2026-04-18 13:29:12','2026-04-18 13:29:12'),(3,'products.manage','Manage products','2026-04-18 13:29:12','2026-04-18 13:29:12'),(4,'sales.create','Process POS sales','2026-04-18 13:29:12','2026-04-18 13:29:12'),(5,'sales.view','View sales history','2026-04-18 13:29:12','2026-04-18 13:29:12'),(6,'sales.refund','Refund or void sales','2026-04-18 13:29:12','2026-04-18 13:29:12'),(7,'inventory.view','View inventory','2026-04-18 13:29:12','2026-04-18 13:29:12'),(8,'inventory.adjust','Adjust inventory','2026-04-18 13:29:12','2026-04-18 13:29:12'),(9,'expenses.view','View expenses','2026-04-18 13:29:12','2026-04-18 13:29:12'),(10,'expenses.manage','Manage expenses','2026-04-18 13:29:12','2026-04-18 13:29:12'),(11,'suppliers.view','View suppliers','2026-04-18 13:29:12','2026-04-18 13:29:12'),(12,'suppliers.manage','Manage suppliers','2026-04-18 13:29:12','2026-04-18 13:29:12'),(13,'purchases.view','View purchases','2026-04-18 13:29:12','2026-04-18 13:29:12'),(14,'purchases.manage','Manage purchases','2026-04-18 13:29:12','2026-04-18 13:29:12'),(15,'tournaments.view','View tournaments','2026-04-18 13:29:12','2026-04-18 13:29:12'),(16,'tournaments.manage','Manage tournaments','2026-04-18 13:29:12','2026-04-18 13:29:12'),(17,'tournaments.register','Register players for tournaments','2026-04-18 13:29:12','2026-04-18 13:29:12'),(18,'reports.view','View operational reports','2026-04-18 13:29:12','2026-04-18 13:29:12'),(19,'reports.financial','View financial reports','2026-04-18 13:29:12','2026-04-18 13:29:12'),(20,'users.manage','Manage users and roles','2026-04-18 13:29:12','2026-04-18 13:29:12'),(21,'settings.manage','Manage settings','2026-04-18 13:29:12','2026-04-18 13:29:12'),(22,'customers.view','View customers and loyalty points','2026-04-20 14:22:56','2026-04-20 14:22:56'),(23,'customers.manage','Manage customers and loyalty points','2026-04-20 14:22:56','2026-04-20 14:22:56'),(24,'handovers.view','View card handovers','2026-04-20 19:57:35','2026-04-20 19:57:35'),(25,'handovers.manage','Manage card handovers','2026-04-20 19:57:35','2026-04-20 19:57:35');

--
-- Table structure for table `product_categories`
--

CREATE TABLE `product_categories` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_categories_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_categories`
--

INSERT INTO `product_categories` VALUES (1,'Singles','singles','2026-04-18 13:29:12','2026-04-18 13:29:12'),(2,'Sealed Products','sealed-products','2026-04-18 13:29:12','2026-04-18 13:29:12'),(3,'Accessories','accessories','2026-04-18 13:29:12','2026-04-18 13:29:12'),(4,'Tournament Entries','tournament-entries','2026-04-18 13:29:12','2026-04-18 13:29:12');

--
-- Table structure for table `product_images`
--

CREATE TABLE `product_images` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `path` varchar(255) NOT NULL,
  `is_primary` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_images_product_id_foreign` (`product_id`),
  CONSTRAINT `product_images_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_images`
--

INSERT INTO `product_images` VALUES (1,8,'products/M0JNCGLxY4WyaNOM47DplQsZ2QaX7hE0jXyDHmTk.webp',1,'2026-04-21 17:31:07','2026-04-21 17:31:07'),(2,7,'products/hVQSWF1SEG0avRwQk3LrnHYgLRl3B5O30x4Ao0TL.jpg',1,'2026-04-21 18:08:46','2026-04-21 18:08:46');

--
-- Table structure for table `product_types`
--

CREATE TABLE `product_types` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `value` varchar(255) NOT NULL,
  `label` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `default_category_id` bigint(20) unsigned DEFAULT NULL,
  `tracks_inventory` tinyint(1) NOT NULL DEFAULT 1,
  `has_set_name` tinyint(1) NOT NULL DEFAULT 0,
  `is_card` tinyint(1) NOT NULL DEFAULT 0,
  `is_tournament_entry` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(10) unsigned NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_types_value_unique` (`value`),
  KEY `product_types_default_category_id_foreign` (`default_category_id`),
  KEY `product_types_is_active_sort_order_index` (`is_active`,`sort_order`),
  CONSTRAINT `product_types_default_category_id_foreign` FOREIGN KEY (`default_category_id`) REFERENCES `product_categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_types`
--

INSERT INTO `product_types` VALUES (1,'single_card','Single card','Individual cards with set, condition, rarity, and foil details.',1,1,1,1,0,1,10,'2026-04-20 16:58:44','2026-04-20 16:58:44'),(2,'sealed_product','Sealed product','Booster boxes, packs, decks, bundles, and cases.',2,1,1,0,0,1,20,'2026-04-20 16:58:44','2026-04-20 16:58:44'),(3,'accessory','Accessory','Sleeves, deck boxes, binders, playmats, dice, and supplies.',3,1,0,0,0,1,30,'2026-04-20 16:58:44','2026-04-20 16:58:44'),(4,'tournament_entry','Tournament entry','Non-stock registration products used by tournaments.',4,0,0,0,1,1,40,'2026-04-20 16:58:44','2026-04-20 16:58:44');

--
-- Table structure for table `purchase_items`
--

CREATE TABLE `purchase_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `quantity` int(11) NOT NULL,
  `unit_cost` decimal(12,2) NOT NULL,
  `line_total` decimal(12,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_items_purchase_id_foreign` (`purchase_id`),
  KEY `purchase_items_product_id_foreign` (`product_id`),
  CONSTRAINT `purchase_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
  CONSTRAINT `purchase_items_purchase_id_foreign` FOREIGN KEY (`purchase_id`) REFERENCES `purchases` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_items`
--


--
-- Table structure for table `purchases`
--

CREATE TABLE `purchases` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_number` varchar(255) NOT NULL,
  `supplier_id` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned NOT NULL,
  `purchase_date` date NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'received',
  `subtotal` decimal(12,2) NOT NULL DEFAULT 0.00,
  `shipping_cost` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL DEFAULT 0.00,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchases_purchase_number_unique` (`purchase_number`),
  KEY `purchases_supplier_id_foreign` (`supplier_id`),
  KEY `purchases_created_by_foreign` (`created_by`),
  CONSTRAINT `purchases_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `purchases_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchases`
--


--
-- Table structure for table `role_user`
--

CREATE TABLE `role_user` (
  `role_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`user_id`),
  KEY `role_user_user_id_foreign` (`user_id`),
  CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_user`
--

INSERT INTO `role_user` VALUES (1,1),(1,2),(3,3);

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

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

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` VALUES (1,'admin','Admin','2026-04-18 13:29:12','2026-04-18 13:29:12'),(2,'accountant','Accountant','2026-04-18 13:29:12','2026-04-18 13:29:12'),(3,'staff','Staff','2026-04-18 13:29:12','2026-04-18 13:29:12');

--
-- Table structure for table `sale_items`
--

CREATE TABLE `sale_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sale_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `quantity` int(11) NOT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `cost_price` decimal(12,2) NOT NULL,
  `discount_total` decimal(12,2) NOT NULL DEFAULT 0.00,
  `line_total` decimal(12,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_items_sale_id_foreign` (`sale_id`),
  KEY `sale_items_product_id_foreign` (`product_id`),
  CONSTRAINT `sale_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
  CONSTRAINT `sale_items_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_items`
--

INSERT INTO `sale_items` VALUES (3,3,4,1,35.00,0.00,0.00,35.00,'2026-04-19 06:51:28','2026-04-19 06:51:28'),(4,4,7,1,250.00,130.00,0.00,250.00,'2026-04-20 18:40:49','2026-04-20 18:40:49'),(5,5,6,1,35.00,0.00,0.00,35.00,'2026-04-20 18:43:11','2026-04-20 18:43:11'),(6,6,7,1,250.00,130.00,0.00,250.00,'2026-04-21 01:47:52','2026-04-21 01:47:52'),(7,7,7,1,250.00,130.00,0.00,250.00,'2026-04-21 02:06:11','2026-04-21 02:06:11'),(8,8,7,1,250.00,130.00,0.00,250.00,'2026-04-21 03:02:22','2026-04-21 03:02:22');

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) 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;

--
-- Dumping data for table `sessions`
--


--
-- Table structure for table `stock_movements`
--

CREATE TABLE `stock_movements` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `movement_type` varchar(255) NOT NULL,
  `quantity_change` int(11) NOT NULL,
  `stock_before` int(11) NOT NULL,
  `stock_after` int(11) NOT NULL,
  `source_type` varchar(255) DEFAULT NULL,
  `source_id` bigint(20) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stock_movements_user_id_foreign` (`user_id`),
  KEY `stock_movements_source_type_source_id_index` (`source_type`,`source_id`),
  KEY `stock_movements_product_id_created_at_index` (`product_id`,`created_at`),
  KEY `stock_movements_movement_type_index` (`movement_type`),
  CONSTRAINT `stock_movements_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
  CONSTRAINT `stock_movements_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `stock_movements`
--

INSERT INTO `stock_movements` VALUES (1,7,1,'adjustment',10,0,10,NULL,NULL,'add stock','2026-04-20 18:40:27','2026-04-20 18:40:27'),(2,7,1,'sale',-1,10,9,'App\\Models\\SaleItem',4,'Sale S-20260421024049-486','2026-04-20 18:40:49','2026-04-20 18:40:49'),(3,7,1,'sale',-1,9,8,'App\\Models\\SaleItem',6,'Sale S-20260421094752-366','2026-04-21 01:47:52','2026-04-21 01:47:52'),(4,7,1,'sale',-1,8,7,'App\\Models\\SaleItem',7,'Sale S-20260421100611-749','2026-04-21 02:06:11','2026-04-21 02:06:11'),(5,7,1,'sale',-1,7,6,'App\\Models\\SaleItem',8,'Sale S-20260421110222-188','2026-04-21 03:02:22','2026-04-21 03:02:22'),(6,8,1,'adjustment',5,0,5,NULL,NULL,'add','2026-04-21 17:32:26','2026-04-21 17:32:26');

--
-- Table structure for table `suppliers`
--

CREATE TABLE `suppliers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `contact_name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `notes` text 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`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `suppliers`
--

INSERT INTO `suppliers` VALUES (1,'Premium TCG Distributor','Purchasing Desk','orders@example.test',NULL,NULL,NULL,1,'2026-04-18 13:29:12','2026-04-18 13:29:12');

--
-- Table structure for table `tournament_games`
--

CREATE TABLE `tournament_games` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `slug` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(10) unsigned NOT NULL DEFAULT 50,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tournament_games_name_unique` (`name`),
  UNIQUE KEY `tournament_games_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tournament_games`
--

INSERT INTO `tournament_games` VALUES (1,'Magic: The Gathering','magic-the-gathering',NULL,1,10,'2026-04-20 17:27:30','2026-04-20 17:27:30'),(2,'One Piece Card Game','one-piece-card-game',NULL,1,20,'2026-04-20 17:27:30','2026-04-20 17:27:30'),(3,'Pokemon','pokemon',NULL,1,30,'2026-04-20 17:27:30','2026-04-20 17:27:30'),(4,'Yu-Gi-Oh!','yu-gi-oh',NULL,1,40,'2026-04-20 17:27:30','2026-04-20 17:27:30'),(5,'Disney Lorcana','disney-lorcana',NULL,1,50,'2026-04-20 17:27:30','2026-04-20 17:27:30');

--
-- Table structure for table `tournament_registrations`
--

CREATE TABLE `tournament_registrations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tournament_id` bigint(20) unsigned NOT NULL,
  `registered_by` bigint(20) unsigned DEFAULT NULL,
  `sale_id` bigint(20) unsigned DEFAULT NULL,
  `customer_id` bigint(20) unsigned DEFAULT NULL,
  `player_name` varchar(255) NOT NULL,
  `player_email` varchar(255) DEFAULT NULL,
  `player_phone` varchar(255) DEFAULT NULL,
  `player_identifier` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'registered',
  `paid_amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `registered_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `match_wins` int(10) unsigned NOT NULL DEFAULT 0,
  `match_draws` int(10) unsigned NOT NULL DEFAULT 0,
  `match_losses` int(10) unsigned NOT NULL DEFAULT 0,
  `tournament_points` int(10) unsigned NOT NULL DEFAULT 0,
  `standing_rank` int(10) unsigned DEFAULT NULL,
  `result_recorded_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tournament_registrations_tournament_id_player_identifier_unique` (`tournament_id`,`player_identifier`),
  KEY `tournament_registrations_registered_by_foreign` (`registered_by`),
  KEY `tournament_registrations_sale_id_foreign` (`sale_id`),
  KEY `tournament_registrations_tournament_id_status_index` (`tournament_id`,`status`),
  KEY `tournament_registrations_customer_id_foreign` (`customer_id`),
  CONSTRAINT `tournament_registrations_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tournament_registrations_registered_by_foreign` FOREIGN KEY (`registered_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tournament_registrations_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE SET NULL,
  CONSTRAINT `tournament_registrations_tournament_id_foreign` FOREIGN KEY (`tournament_id`) REFERENCES `tournaments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tournament_registrations`
--

INSERT INTO `tournament_registrations` VALUES (3,2,1,3,NULL,'Ariff',NULL,NULL,NULL,'cancelled',35.00,'2026-04-19 06:51:28',NULL,'2026-04-19 06:51:28','2026-04-20 17:19:17',0,0,0,0,NULL,NULL),(4,4,1,5,NULL,'Ariff',NULL,NULL,NULL,'paid',35.00,'2026-04-20 18:43:11',NULL,'2026-04-20 18:43:11','2026-04-20 18:43:11',0,0,0,0,NULL,NULL);

--
-- Table structure for table `tournaments`
--

CREATE TABLE `tournaments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `registration_product_id` bigint(20) unsigned DEFAULT NULL,
  `created_by` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `game` varchar(255) DEFAULT NULL,
  `format` varchar(255) DEFAULT NULL,
  `starts_at` datetime NOT NULL,
  `entry_fee` decimal(12,2) NOT NULL DEFAULT 0.00,
  `capacity` int(10) unsigned NOT NULL DEFAULT 16,
  `status` varchar(255) NOT NULL DEFAULT 'scheduled',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tournaments_registration_product_id_foreign` (`registration_product_id`),
  KEY `tournaments_created_by_foreign` (`created_by`),
  KEY `tournaments_starts_at_status_index` (`starts_at`,`status`),
  CONSTRAINT `tournaments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `tournaments_registration_product_id_foreign` FOREIGN KEY (`registration_product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tournaments`
--

INSERT INTO `tournaments` VALUES (1,4,2,'Weekly Standard Showdown','Magic: The Gathering','Standard','2026-04-24 19:30:00',25.00,32,'scheduled','Seeded sample tournament.','2026-04-18 13:29:12','2026-04-20 16:58:45'),(2,NULL,1,'Extra Battle April 2026','One Piece Card Game','Swiss','2026-04-18 21:00:00',35.00,32,'cancelled',NULL,'2026-04-18 13:31:52','2026-04-20 17:19:13'),(4,6,1,'Flagship April','One Piece Card Game',NULL,'2026-04-25 21:00:00',35.00,32,'scheduled',NULL,'2026-04-20 17:35:54','2026-04-20 17:35:54');


