--
-- Host: localhost    Database: womp_franchise
-- ------------------------------------------------------


--
-- Table structure for table `cart_items`
--

CREATE TABLE `cart_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `product_id` int NOT NULL,
  `quantity` int NOT NULL DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` enum('Pending','Completed') COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Pending',
  `order_id` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `products_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_product` (`user_id`,`product_id`),
  KEY `product_id` (`product_id`),
  KEY `fk_cart_order` (`order_id`),
  CONSTRAINT `cart_items_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `cart_items_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `cart_items_chk_1` CHECK (json_valid(`products_json`))
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cart_items`
--

INSERT INTO `cart_items` VALUES (26,8,17,1,'2025-05-14 13:41:19','2025-05-14 13:41:57','Completed','32','[{\"productId\":\"17\",\"quantity\":1,\"name\":\"addsa\",\"description\":\"asdasd\",\"image\":\"/uploads/1747222954869-organic-store-contains-fruits-vegetables--and-reus.png\",\"metrics\":[]},{\"productId\":13,\"quantity\":1,\"name\":\"rrjydyt\",\"description\":\"yfktutkfumc\",\"image\":\"/uploads/1747061327904-image (8).jpg\",\"metrics\":[{\"id\":7,\"product_id\":13,\"name\":\"1KG\",\"common_price\":\"111.00\",\"tier1_price\":\"1111.00\",\"tier2_price\":\"111.00\",\"tier3_price\":\"111.00\",\"created_at\":\"2025-05-13T06:15:42.000Z\",\"updated_at\":\"2025-05-13T06:15:42.000Z\"}]}]'),(27,8,18,1,'2025-05-14 13:45:37','2025-05-15 04:32:14','Completed','33','[{\"productId\":18,\"quantity\":1,\"name\":\"testting Data\",\"description\":\"testting Data\",\"image\":\"/uploads/1747223482290-steaming-cup-of-chamomile-tea-with-dried-flowers-o.png\",\"metrics\":[{\"id\":8,\"product_id\":18,\"name\":\"100GM\",\"common_price\":\"11.00\",\"tier1_price\":\"11.00\",\"tier2_price\":\"11.00\",\"tier3_price\":\"11.00\",\"created_at\":\"2025-05-14T11:51:22.000Z\",\"updated_at\":\"2025-05-14T11:51:22.000Z\"},{\"id\":9,\"product_id\":18,\"name\":\"50GM\",\"common_price\":\"1.00\",\"tier1_price\":\"11111.00\",\"tier2_price\":\"1.00\",\"tier3_price\":\"1.00\",\"created_at\":\"2025-05-14T11:51:22.000Z\",\"updated_at\":\"2025-05-14T12:02:34.000Z\"}]},{\"productId\":17,\"quantity\":1,\"name\":\"addsa\",\"description\":\"asdasd\",\"image\":\"/uploads/1747222954869-organic-store-contains-fruits-vegetables--and-reus.png\",\"metrics\":[]}]'),(31,8,13,1,'2025-05-15 05:54:10','2025-05-15 09:55:25','Completed','34','[{\"productId\":13,\"quantity\":1,\"name\":\"rrjydyt\",\"description\":\"yfktutkfumc\",\"image\":\"/uploads/1747061327904-image (8).jpg\",\"metrics\":[{\"id\":7,\"product_id\":13,\"name\":\"1KG\",\"common_price\":\"111.00\",\"tier1_price\":\"1111.00\",\"tier2_price\":\"111.00\",\"tier3_price\":\"111.00\",\"created_at\":\"2025-05-13T06:15:42.000Z\",\"updated_at\":\"2025-05-13T06:15:42.000Z\"}]},{\"productId\":\"15\",\"quantity\":4,\"name\":\"TTTTTTTTTTTTTTTTTTT\",\"description\":\"jrdrtdjtrdthd\",\"image\":\"/uploads/1747163906523-enjoy-farm-fresh-organic-fruits-and-vegetables-gro (2).png\",\"metrics\":[]}]'),(33,8,15,1,'2025-05-15 06:22:19','2025-05-16 12:16:18','Completed','$','[{\"productId\":15,\"quantity\":2,\"name\":\"TTTTTTTTTTTTTTTTTTT\",\"description\":\"jrdrtdjtrdthd\",\"image\":\"/uploads/1747163906523-enjoy-farm-fresh-organic-fruits-and-vegetables-gro (2).png\",\"metrics\":[]},{\"productId\":\"17\",\"quantity\":1,\"name\":\"addsa\",\"description\":\"asdasd\",\"image\":\"/uploads/1747222954869-organic-store-contains-fruits-vegetables--and-reus.png\",\"metrics\":[]}]'),(34,8,21,1,'2025-05-16 13:59:08','2025-05-17 05:23:02','Completed','order_1747459364369','[{\"productId\":21,\"quantity\":1,\"name\":\"rrjydyt\",\"description\":\"yfktutkfumc\",\"image\":\"/uploads/1747061327904-image (8).jpg\",\"metrics\":[]}]'),(35,8,33,1,'2025-05-17 08:03:11','2025-05-17 08:03:42','Pending',NULL,'[{\"productId\":33,\"quantity\":1,\"name\":\"addsa\",\"description\":\"asdasd\",\"image\":\"/uploads/1747222954869-organic-store-contains-fruits-vegetables--and-reus.png\",\"metrics\":[]},{\"productId\":31,\"quantity\":1,\"name\":\"qqqq\",\"description\":\"qqqqqqq\",\"image\":\"/uploads/1747072427323-enjoy-farm-fresh-organic-fruits-and-vegetables-gro (3).png\",\"metrics\":[]}]');

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` text COLLATE utf8mb4_general_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `description` text COLLATE utf8mb4_general_ci,
  `image_url` text COLLATE utf8mb4_general_ci,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` VALUES (1,'fruits','Fresh Fruits','A variety of fresh fruits','/uploads/1746687913996-a-variety-of-refreshing-cold-beverages-on-a-summer.png','2025-05-08 07:05:14','2025-05-08 07:05:14'),(3,'dsgsdfsdafds','sdfdsf','fsdfsadfsdafdsf','/uploads/1746703188879-eco-friendly-alternatives-to-single-use-kitchen-it.png','2025-05-08 11:19:49','2025-05-08 11:19:49'),(4,'Testing','Testing','Testing.Testing','/uploads/1746706513183-mysore_pak.png','2025-05-08 12:15:13','2025-05-08 12:15:13'),(6,'ytfyi','uihioghu','yvugvygv','/uploads/1747070230711-a-variety-of-refreshing-cold-beverages-on-a-summer (1).png','2025-05-12 17:17:10','2025-05-12 17:17:10'),(7,'qwerqweqwe','qqqq','qqqqqq','/uploads/1747072376820-wholesome--nutrient-rich-grains-like-quinoa--brown.png','2025-05-12 17:52:56','2025-05-12 17:52:56'),(20,'dsgsdfsdafds','sdfdsf','fsdfsadfsdafdsf','/uploads/1746703188879-eco-friendly-alternatives-to-single-use-kitchen-it.png','2025-05-08 11:19:49','2025-05-08 11:19:49'),(21,'Testing','Testing','Testing.Testing','/uploads/1746706513183-mysore_pak.png','2025-05-08 12:15:13','2025-05-08 12:15:13'),(22,'ytfyi','uihioghu','yvugvygv','/downloads/organic-skincare-products---they-add-special-offer','2025-05-12 17:17:10','2025-05-12 17:17:10'),(23,'qwerqweqwe','qqqq','qqqqqq','/uploads/1747072376820-wholesome--nutrient-rich-grains-like-quinoa--brown.png','2025-05-12 17:52:56','2025-05-12 17:52:56'),(24,'Last Testing','Testing Last','Testing','/downloads/organic-skincare-products---they-add-special-offer','2025-05-15 10:38:32','2025-05-15 10:38:32'),(25,'Last Testing 1','Testing Last 1','Testing 1','/downloads/organic-skincare-products---they-add-special-offer','2025-05-15 10:38:32','2025-05-15 10:38:32'),(26,'dsgsdfsdafds','sdfdsf','fsdfsadfsdafdsf','/uploads/1746703188879-eco-friendly-alternatives-to-single-use-kitchen-it.png','2025-05-08 11:19:49','2025-05-08 11:19:49'),(27,'Testing','Testing','Testing.Testing','/uploads/1746706513183-mysore_pak.png','2025-05-08 12:15:13','2025-05-08 12:15:13'),(28,'ytfyi','uihioghu','yvugvygv','/downloads/organic-skincare-products---they-add-special-offer','2025-05-12 17:17:10','2025-05-12 17:17:10'),(29,'qwerqweqwe','qqqq','qqqqqq','/uploads/1747072376820-wholesome--nutrient-rich-grains-like-quinoa--brown.png','2025-05-12 17:52:56','2025-05-12 17:52:56'),(30,'Last Testing','Testing Last','Testing','/downloads/organic-skincare-products---they-add-special-offer','2025-05-15 15:22:01','2025-05-15 15:22:01'),(31,'Last Testing 1','Testing Last 1','Testing 1','/downloads/organic-skincare-products---they-add-special-offer','2025-05-15 15:22:01','2025-05-15 15:22:01'),(32,'FInal Testing','Final 1','Final 2','/uploads/1747072376820-wholesome--nutrient-rich-grains-like-quinoa--brown.png','2025-05-15 15:22:01','2025-05-15 15:22:01');

--
-- Table structure for table `metric_constants`
--

CREATE TABLE `metric_constants` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `metric_constants`
--

INSERT INTO `metric_constants` VALUES (1,'1KG','2025-05-12 14:30:07','2025-05-12 14:30:07'),(2,'500GM','2025-05-12 14:30:07','2025-05-12 14:30:07'),(3,'250GM','2025-05-12 14:30:07','2025-05-12 14:30:07'),(4,'100GM','2025-05-12 14:30:07','2025-05-12 14:30:07'),(5,'50GM','2025-05-12 14:30:07','2025-05-12 14:30:07'),(6,'UNPACKED','2025-05-12 14:30:07','2025-05-12 14:30:07');

--
-- Table structure for table `metrics`
--

CREATE TABLE `metrics` (
  `id` int NOT NULL AUTO_INCREMENT,
  `product_id` int NOT NULL,
  `name` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `common_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `tier1_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `tier2_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `tier3_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `product_id` (`product_id`),
  CONSTRAINT `metrics_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `metrics`
--

INSERT INTO `metrics` VALUES (2,14,'500GM',22.00,22.00,22.00,22.00,'2025-05-12 17:54:41','2025-05-12 17:54:41'),(3,14,'1KG',222.00,2222.00,222.00,2222.00,'2025-05-12 18:04:56','2025-05-12 18:04:56'),(6,12,'250GM',11.00,11.00,11.00,11.00,'2025-05-12 19:12:41','2025-05-12 19:12:41'),(7,13,'1KG',111.00,1111.00,111.00,111.00,'2025-05-13 06:15:42','2025-05-13 06:15:42'),(8,18,'100GM',11.00,11.00,11.00,11.00,'2025-05-14 11:51:22','2025-05-14 11:51:22'),(9,18,'50GM',1.00,11111.00,1.00,1.00,'2025-05-14 11:51:22','2025-05-14 12:02:34'),(22,27,'500GM',22.00,22.00,22.00,22.00,'2025-05-15 11:09:22','2025-05-15 11:09:22'),(23,27,'1KG',33.00,33.00,33.00,33.00,'2025-05-15 11:09:22','2025-05-15 11:09:22'),(24,28,'1KG',1.00,1.00,1.00,1.00,'2025-05-15 14:30:53','2025-05-15 14:30:53'),(25,28,'500GM',1.00,1.00,1.00,1.00,'2025-05-15 14:30:54','2025-05-15 14:30:54'),(26,14,'500GM',22.00,22.00,22.00,22.00,'2025-05-12 17:54:41','2025-05-12 17:54:41'),(27,14,'1KG',222.00,2222.00,222.00,2222.00,'2025-05-12 18:04:56','2025-05-12 18:04:56'),(28,12,'250GM',11.00,11.00,11.00,11.00,'2025-05-12 19:12:41','2025-05-12 19:12:41'),(29,13,'1KG',111.00,1111.00,111.00,111.00,'2025-05-13 06:15:42','2025-05-13 06:15:42'),(30,18,'100GM',11.00,11.00,11.00,11.00,'2025-05-14 11:51:22','2025-05-14 11:51:22'),(31,18,'50GM',1.00,11111.00,1.00,1.00,'2025-05-14 11:51:22','2025-05-14 12:02:34'),(32,27,'500GM',22.00,22.00,22.00,22.00,'2025-05-15 11:09:22','2025-05-15 11:09:22'),(33,27,'1KG',33.00,33.00,33.00,33.00,'2025-05-15 11:09:22','2025-05-15 11:09:22'),(34,28,'1KG',1.00,1.00,1.00,1.00,'2025-05-15 14:30:53','2025-05-15 14:30:53'),(35,28,'500GM',1.00,1.00,1.00,1.00,'2025-05-15 14:30:54','2025-05-15 14:30:54'),(36,28,'250GM',3.00,3.00,3.00,3.00,'2025-05-15 15:17:48','2025-05-15 15:17:48'),(37,14,'500GM',22.00,22.00,22.00,22.00,'2025-05-12 17:54:41','2025-05-12 17:54:41'),(38,14,'1KG',222.00,2222.00,222.00,2222.00,'2025-05-12 18:04:56','2025-05-12 18:04:56'),(39,12,'250GM',11.00,11.00,11.00,11.00,'2025-05-12 19:12:41','2025-05-12 19:12:41'),(40,13,'1KG',111.00,1111.00,111.00,111.00,'2025-05-13 06:15:42','2025-05-13 06:15:42'),(41,18,'100GM',11.00,11.00,11.00,11.00,'2025-05-14 11:51:22','2025-05-14 11:51:22'),(42,18,'50GM',1.00,11111.00,1.00,1.00,'2025-05-14 11:51:22','2025-05-14 12:02:34'),(43,27,'500GM',22.00,22.00,22.00,22.00,'2025-05-15 11:09:22','2025-05-15 11:09:22'),(44,27,'1KG',33.00,33.00,33.00,33.00,'2025-05-15 11:09:22','2025-05-15 11:09:22'),(45,28,'1KG',1.00,1.00,1.00,1.00,'2025-05-15 14:30:53','2025-05-15 14:30:53'),(46,28,'500GM',1.00,1.00,1.00,1.00,'2025-05-15 14:30:54','2025-05-15 14:30:54'),(47,28,'250GM',3.00,3.00,3.00,3.00,'2025-05-15 15:29:22','2025-05-15 15:29:22'),(48,27,'100GM',44.00,44.00,44.00,44.00,'2025-05-15 15:29:22','2025-05-15 15:29:22');

--
-- Table structure for table `order_details`
--

CREATE TABLE `order_details` (
  `id` int NOT NULL AUTO_INCREMENT,
  `order_id` int NOT NULL,
  `products_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_id` (`order_id`),
  CONSTRAINT `order_details_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_details_chk_1` CHECK (json_valid(`products_json`))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `order_details`
--


--
-- Table structure for table `order_items`
--

CREATE TABLE `order_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `order_id` int NOT NULL,
  `product_id` int NOT NULL,
  `quantity` int NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`),
  KEY `product_id` (`product_id`),
  CONSTRAINT `order_items_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`),
  CONSTRAINT `order_items_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `order_items`
--

INSERT INTO `order_items` VALUES (1,1,15,1,0.00,'2025-05-14 04:48:41'),(2,2,15,1,0.00,'2025-05-14 04:53:36'),(3,3,14,1,0.00,'2025-05-14 04:54:26'),(4,3,13,1,0.00,'2025-05-14 04:54:26'),(5,4,14,2,0.00,'2025-05-14 04:58:30'),(6,5,13,2,0.00,'2025-05-14 05:02:43'),(7,6,14,2,0.00,'2025-05-14 05:09:52'),(8,7,14,2,0.00,'2025-05-14 07:21:49'),(9,7,13,1,0.00,'2025-05-14 07:21:49'),(10,8,14,2,0.00,'2025-05-14 07:28:24'),(11,8,13,1,0.00,'2025-05-14 07:28:24'),(12,9,14,2,0.00,'2025-05-14 07:49:10'),(13,9,13,2,0.00,'2025-05-14 07:49:10'),(14,10,14,2,0.00,'2025-05-14 07:56:01'),(15,10,13,2,0.00,'2025-05-14 07:56:01'),(16,11,14,2,0.00,'2025-05-14 08:01:07'),(17,11,13,2,0.00,'2025-05-14 08:01:07'),(18,12,14,2,0.00,'2025-05-14 08:11:07'),(19,12,13,2,0.00,'2025-05-14 08:11:07'),(20,13,14,3,0.00,'2025-05-14 08:49:52'),(21,13,13,2,0.00,'2025-05-14 08:49:52'),(22,14,14,3,0.00,'2025-05-14 08:52:16'),(23,14,13,2,0.00,'2025-05-14 08:52:16'),(24,15,14,3,0.00,'2025-05-14 08:56:22'),(25,15,13,2,0.00,'2025-05-14 08:56:22'),(26,16,14,3,0.00,'2025-05-14 09:07:01'),(27,16,13,2,0.00,'2025-05-14 09:07:01'),(28,17,14,3,0.00,'2025-05-14 09:15:04'),(29,17,13,2,0.00,'2025-05-14 09:15:04'),(30,18,14,3,0.00,'2025-05-14 09:22:57'),(31,18,13,2,0.00,'2025-05-14 09:22:57'),(32,19,14,3,0.00,'2025-05-14 09:23:36'),(33,19,13,2,0.00,'2025-05-14 09:23:36'),(34,20,14,3,0.00,'2025-05-14 09:24:35'),(35,20,13,2,0.00,'2025-05-14 09:24:35'),(36,21,14,3,0.00,'2025-05-14 09:27:54'),(37,21,13,2,0.00,'2025-05-14 09:27:54'),(38,22,14,3,0.00,'2025-05-14 09:31:45'),(39,22,13,2,0.00,'2025-05-14 09:31:45'),(40,23,14,3,0.00,'2025-05-14 09:34:31'),(41,23,13,2,0.00,'2025-05-14 09:34:31'),(42,24,14,3,0.00,'2025-05-14 09:37:36'),(43,24,13,2,0.00,'2025-05-14 09:37:37'),(44,25,14,3,0.00,'2025-05-14 09:53:19'),(45,25,13,2,0.00,'2025-05-14 09:53:19'),(46,26,14,3,0.00,'2025-05-14 09:58:09'),(47,26,13,2,0.00,'2025-05-14 09:58:09'),(48,27,14,3,0.00,'2025-05-14 09:59:26'),(49,27,13,2,0.00,'2025-05-14 09:59:26'),(50,28,14,3,0.00,'2025-05-14 10:02:04'),(51,28,13,2,0.00,'2025-05-14 10:02:04'),(52,29,14,3,0.00,'2025-05-14 10:14:26'),(53,29,13,2,0.00,'2025-05-14 10:14:26');

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `status` enum('pending','processing','completed','cancelled','paid') COLLATE utf8mb4_general_ci DEFAULT NULL,
  `payment_id` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `payment_method` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `order_id` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` VALUES (1,8,50.00,'pending',NULL,NULL,'2025-05-14 04:48:41','2025-05-14 04:48:41',NULL),(2,8,50.00,'paid','2',NULL,'2025-05-14 04:53:36','2025-05-14 04:53:36',NULL),(3,8,50.00,'paid','3',NULL,'2025-05-14 04:54:26','2025-05-14 04:54:27',NULL),(4,8,50.00,'paid','4',NULL,'2025-05-14 04:58:30','2025-05-14 04:58:30',NULL),(5,8,50.00,'paid','5',NULL,'2025-05-14 05:02:43','2025-05-14 05:02:43',NULL),(6,8,50.00,'pending','6',NULL,'2025-05-14 05:09:52','2025-05-14 05:09:52',NULL),(7,8,50.00,'pending',NULL,NULL,'2025-05-14 07:21:49','2025-05-14 07:21:49',NULL),(8,8,50.00,'pending',NULL,NULL,'2025-05-14 07:28:24','2025-05-14 07:28:24',NULL),(9,8,50.00,'pending',NULL,NULL,'2025-05-14 07:49:10','2025-05-14 07:49:10',NULL),(10,8,50.00,'pending',NULL,NULL,'2025-05-14 07:56:01','2025-05-14 07:56:01',NULL),(11,8,50.00,'pending',NULL,NULL,'2025-05-14 08:01:07','2025-05-14 08:01:07',NULL),(12,8,50.00,'pending',NULL,NULL,'2025-05-14 08:11:07','2025-05-14 08:11:07',NULL),(13,8,50.00,'pending',NULL,NULL,'2025-05-14 08:49:52','2025-05-14 08:49:52',NULL),(14,8,50.00,'pending',NULL,NULL,'2025-05-14 08:52:16','2025-05-14 08:52:16',NULL),(15,8,50.00,'pending',NULL,NULL,'2025-05-14 08:56:22','2025-05-14 08:56:22',NULL),(16,8,50.00,'pending',NULL,NULL,'2025-05-14 09:07:01','2025-05-14 09:07:01',NULL),(17,8,50.00,'pending',NULL,NULL,'2025-05-14 09:15:04','2025-05-14 09:15:04',NULL),(18,8,50.00,'pending',NULL,NULL,'2025-05-14 09:22:57','2025-05-14 09:22:57',NULL),(19,8,50.00,'pending',NULL,NULL,'2025-05-14 09:23:36','2025-05-14 09:23:36',NULL),(20,8,50.00,'pending',NULL,NULL,'2025-05-14 09:24:35','2025-05-14 09:24:35',NULL),(21,8,50.00,'pending',NULL,NULL,'2025-05-14 09:27:54','2025-05-14 09:27:54',NULL),(22,8,50.00,'pending',NULL,NULL,'2025-05-14 09:31:45','2025-05-14 09:31:45',NULL),(23,8,50.00,'pending',NULL,NULL,'2025-05-14 09:34:31','2025-05-14 09:34:31',NULL),(24,8,50.00,'pending',NULL,NULL,'2025-05-14 09:37:36','2025-05-14 09:37:36',NULL),(25,8,50.00,'pending',NULL,NULL,'2025-05-14 09:53:19','2025-05-14 09:53:19',NULL),(26,8,50.00,'pending',NULL,NULL,'2025-05-14 09:58:09','2025-05-14 09:58:09',NULL),(27,8,50.00,'pending',NULL,NULL,'2025-05-14 09:59:26','2025-05-14 09:59:26',NULL),(28,8,50.00,'pending',NULL,NULL,'2025-05-14 10:02:03','2025-05-14 10:02:03',NULL),(29,8,50.00,'pending',NULL,NULL,'2025-05-14 10:14:26','2025-05-14 10:14:26',NULL),(30,8,0.00,'paid',NULL,NULL,'2025-05-14 13:36:07','2025-05-14 13:36:07',NULL),(31,8,0.00,'paid',NULL,NULL,'2025-05-14 13:37:36','2025-05-14 13:37:36','order_1747229828368'),(32,8,0.00,'paid',NULL,NULL,'2025-05-14 13:41:57','2025-05-14 13:41:57','order_1747230099898'),(33,8,0.00,'paid',NULL,NULL,'2025-05-15 04:32:14','2025-05-15 04:32:14',NULL),(34,8,0.00,'paid',NULL,NULL,'2025-05-15 09:55:25','2025-05-15 09:55:25',NULL);

--
-- Table structure for table `product_metrics`
--

CREATE TABLE `product_metrics` (
  `id` int NOT NULL AUTO_INCREMENT,
  `product_id` int NOT NULL,
  `name` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `common_price` decimal(10,2) NOT NULL,
  `tier1_price` decimal(10,2) NOT NULL,
  `tier2_price` decimal(10,2) NOT NULL,
  `tier3_price` decimal(10,2) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `product_id` (`product_id`),
  CONSTRAINT `product_metrics_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product_metrics`
--


--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` text COLLATE utf8mb4_general_ci NOT NULL,
  `description` text COLLATE utf8mb4_general_ci,
  `common_price` decimal(10,2) NOT NULL,
  `tier1_price` decimal(10,2) NOT NULL,
  `tier2_price` decimal(10,2) NOT NULL,
  `tier3_price` decimal(10,2) NOT NULL,
  `image_url` text COLLATE utf8mb4_general_ci,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `category_id` int DEFAULT NULL,
  `metrics_enabled` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `fk_category` (`category_id`),
  CONSTRAINT `fk_category` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` VALUES (11,'Testing 23123','qwfwef',0.00,0.00,0.00,0.00,'/uploads/1747059159354-organic-food-and-snacks-with-name-organic-snacks.png','2025-05-12 14:04:00','2025-05-12 14:12:39',1,0),(12,'fawreteqrtrqe','qtu4ygqera',0.00,0.00,0.00,0.00,'/uploads/1747058671919-a-variety-of-refreshing-cold-beverages-on-a-summer.png','2025-05-12 14:04:31','2025-05-12 14:04:31',1,0),(13,'rrjydyt','yfktutkfumc',0.00,0.00,0.00,0.00,'/uploads/1747061327904-image (8).jpg','2025-05-12 14:48:48','2025-05-12 14:48:48',4,0),(14,'qqqq','qqqqqqq',0.00,0.00,0.00,0.00,'/uploads/1747072427323-enjoy-farm-fresh-organic-fruits-and-vegetables-gro (3).png','2025-05-12 17:53:47','2025-05-12 17:53:47',7,0),(15,'TTTTTTTTTTTTTTTTTTT','jrdrtdjtrdthd',0.00,0.00,0.00,0.00,'/uploads/1747163906523-enjoy-farm-fresh-organic-fruits-and-vegetables-gro (2).png','2025-05-13 19:18:26','2025-05-13 19:18:26',NULL,0),(17,'addsa','asdasd',0.00,0.00,0.00,0.00,'/uploads/1747222954869-organic-store-contains-fruits-vegetables--and-reus.png','2025-05-14 11:42:35','2025-05-14 11:42:35',1,0),(18,'testting Data','testting Data',0.00,0.00,0.00,0.00,'/uploads/1747223482290-steaming-cup-of-chamomile-tea-with-dried-flowers-o.png','2025-05-14 11:51:22','2025-05-14 11:51:22',3,0),(20,'fawreteqrtrqe','qtu4ygqera',0.00,0.00,0.00,0.00,'/uploads/1747058671919-a-variety-of-refreshing-cold-beverages-on-a-summer.png','2025-05-12 14:04:31','2025-05-12 14:04:31',1,0),(21,'rrjydyt','yfktutkfumc',0.00,0.00,0.00,0.00,'/uploads/1747061327904-image (8).jpg','2025-05-12 14:48:48','2025-05-12 14:48:48',4,0),(22,'qqqq','qqqqqqq',0.00,0.00,0.00,0.00,'/uploads/1747072427323-enjoy-farm-fresh-organic-fruits-and-vegetables-gro (3).png','2025-05-12 17:53:47','2025-05-12 17:53:47',7,0),(23,'TTTTTTTTTTTTTTTTTTT','jrdrtdjtrdthd',0.00,0.00,0.00,0.00,'/uploads/1747163906523-enjoy-farm-fresh-organic-fruits-and-vegetables-gro (2).png','2025-05-13 19:18:26','2025-05-13 19:18:26',NULL,0),(24,'addsa','asdasd',0.00,0.00,0.00,0.00,'/uploads/1747222954869-organic-store-contains-fruits-vegetables--and-reus.png','2025-05-14 11:42:35','2025-05-14 11:42:35',1,0),(25,'testting Data','testting Data',0.00,0.00,0.00,0.00,'/uploads/1747223482290-steaming-cup-of-chamomile-tea-with-dried-flowers-o.png','2025-05-14 11:51:22','2025-05-14 11:51:22',3,0),(26,'New Product','New Product Description',0.00,0.00,0.00,0.00,'/uploads/1747223482290-steaming-cup-of-chamomile-tea-with-dried-flowers-o.png','2025-05-15 10:50:15','2025-05-15 10:50:15',4,0),(27,'Test','wgtretretertfgdfg',0.00,0.00,0.00,0.00,'/uploads/1747307362677-grains.jpeg','2025-05-15 11:09:22','2025-05-15 11:09:22',20,0),(28,'last Test','gergewrg',0.00,0.00,0.00,0.00,'/uploads/1747319451598-dev.jpg','2025-05-15 14:30:53','2025-05-15 14:30:53',25,0),(29,'fawreteqrtrqe','qtu4ygqera',0.00,0.00,0.00,0.00,'/uploads/1747058671919-a-variety-of-refreshing-cold-beverages-on-a-summer.png','2025-05-12 14:04:31','2025-05-12 14:04:31',1,0),(30,'rrjydyt','yfktutkfumc',0.00,0.00,0.00,0.00,'/uploads/1747061327904-image (8).jpg','2025-05-12 14:48:48','2025-05-12 14:48:48',4,0),(31,'qqqq','qqqqqqq',0.00,0.00,0.00,0.00,'/uploads/1747072427323-enjoy-farm-fresh-organic-fruits-and-vegetables-gro (3).png','2025-05-12 17:53:47','2025-05-12 17:53:47',7,0),(32,'TTTTTTTTTTTTTTTTTTT','jrdrtdjtrdthd',0.00,0.00,0.00,0.00,'/uploads/1747163906523-enjoy-farm-fresh-organic-fruits-and-vegetables-gro (2).png','2025-05-13 19:18:26','2025-05-13 19:18:26',NULL,0),(33,'addsa','asdasd',0.00,0.00,0.00,0.00,'/uploads/1747222954869-organic-store-contains-fruits-vegetables--and-reus.png','2025-05-14 11:42:35','2025-05-14 11:42:35',1,0),(34,'testting Data','testting Data',0.00,0.00,0.00,0.00,'/uploads/1747223482290-steaming-cup-of-chamomile-tea-with-dried-flowers-o.png','2025-05-14 11:51:22','2025-05-14 11:51:22',3,0),(35,'New Product','New Product Description',0.00,0.00,0.00,0.00,'/uploads/1747223482290-steaming-cup-of-chamomile-tea-with-dried-flowers-o.png','2025-05-15 15:27:15','2025-05-15 15:27:15',4,0),(36,'Final Product','FInal Product 1',0.00,0.00,0.00,0.00,'/uploads/1747223482290-steaming-cup-of-chamomile-tea-with-dried-flowers-o.png','2025-05-15 15:27:15','2025-05-15 15:27:15',4,0);


