-- MariaDB dump 10.19  Distrib 10.4.28-MariaDB, for Linux (x86_64)
--
-- Host: 127.0.0.1    Database: TESVISCOVENTURES
-- ------------------------------------------------------
-- Server version	10.4.28-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `admin_activity_logs`
--

DROP TABLE IF EXISTS `admin_activity_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_activity_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `admin_user_id` bigint(20) unsigned DEFAULT NULL,
  `action` varchar(80) NOT NULL,
  `target_type` varchar(60) NOT NULL DEFAULT '',
  `target_id` bigint(20) unsigned DEFAULT NULL,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`meta`)),
  `ip_address` varbinary(16) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_aal_admin` (`admin_user_id`,`created_at`),
  CONSTRAINT `fk_aal_admin` FOREIGN KEY (`admin_user_id`) REFERENCES `admin_users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `admin_activity_logs`
--

LOCK TABLES `admin_activity_logs` WRITE;
/*!40000 ALTER TABLE `admin_activity_logs` DISABLE KEYS */;
/*!40000 ALTER TABLE `admin_activity_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `admin_permissions`
--

DROP TABLE IF EXISTS `admin_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_permissions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(80) NOT NULL,
  `label` varchar(120) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_admin_permissions_slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `admin_permissions`
--

LOCK TABLES `admin_permissions` WRITE;
/*!40000 ALTER TABLE `admin_permissions` DISABLE KEYS */;
INSERT INTO `admin_permissions` VALUES (1,'dashboard.view','View dashboard'),(2,'products.view','View products'),(3,'products.manage','Create/edit/delete products'),(4,'categories.manage','Manage categories'),(5,'brands.manage','Manage brands'),(6,'inventory.manage','Adjust stock & view stock history'),(7,'orders.view','View orders'),(8,'orders.manage','Update order status'),(9,'orders.refund','Issue refunds'),(10,'customers.view','View customer accounts'),(11,'customers.manage','Edit/deactivate customers'),(12,'reviews.moderate','Approve/reject reviews'),(13,'coupons.manage','Manage coupons & promotions'),(14,'delivery.manage','Manage delivery zones & charges'),(15,'payments.manage','Configure payment gateways'),(16,'reports.view','View sales/revenue reports'),(17,'settings.manage','Manage site settings'),(18,'smtp.manage','Configure SMTP'),(19,'email.manage','Manage email templates & campaigns'),(20,'blog.manage','Manage blog posts'),(21,'seo.manage','Manage SEO settings'),(22,'homepage.manage','Manage homepage & banners'),(23,'loyalty.manage','Manage loyalty & referrals'),(24,'admins.manage','Manage admin users & roles'),(25,'logs.view','View activity & security logs'),(26,'backups.manage','Create/restore backups');
/*!40000 ALTER TABLE `admin_permissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `admin_role_permissions`
--

DROP TABLE IF EXISTS `admin_role_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_role_permissions` (
  `role_id` int(10) unsigned NOT NULL,
  `permission_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`permission_id`),
  KEY `fk_arp_perm` (`permission_id`),
  CONSTRAINT `fk_arp_perm` FOREIGN KEY (`permission_id`) REFERENCES `admin_permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_arp_role` FOREIGN KEY (`role_id`) REFERENCES `admin_roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `admin_role_permissions`
--

LOCK TABLES `admin_role_permissions` WRITE;
/*!40000 ALTER TABLE `admin_role_permissions` DISABLE KEYS */;
INSERT INTO `admin_role_permissions` VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(1,13),(1,14),(1,15),(1,16),(1,17),(1,18),(1,19),(1,20),(1,21),(1,22),(1,23),(1,24),(1,25),(1,26);
/*!40000 ALTER TABLE `admin_role_permissions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `admin_roles`
--

DROP TABLE IF EXISTS `admin_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(60) NOT NULL,
  `description` varchar(255) NOT NULL DEFAULT '',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_admin_roles_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `admin_roles`
--

LOCK TABLES `admin_roles` WRITE;
/*!40000 ALTER TABLE `admin_roles` DISABLE KEYS */;
INSERT INTO `admin_roles` VALUES (1,'super_admin','Full access to everything','2026-10-30 14:51:34'),(2,'administrator','All operational areas, no admin-user management','2026-10-30 14:51:34'),(3,'product_manager','Products, categories, brands, inventory','2026-10-30 14:51:34'),(4,'order_manager','Orders, fulfilment, refunds','2026-10-30 14:51:34'),(5,'customer_support','View customers, orders; limited edits','2026-10-30 14:51:34'),(6,'inventory_manager','Stock adjustments & stock history','2026-10-30 14:51:34');
/*!40000 ALTER TABLE `admin_roles` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `admin_users`
--

DROP TABLE IF EXISTS `admin_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_users` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `role_id` int(10) unsigned NOT NULL,
  `name` varchar(120) NOT NULL DEFAULT '',
  `email` varchar(191) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `last_login_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_admin_users_email` (`email`),
  KEY `idx_admin_users_role` (`role_id`),
  CONSTRAINT `fk_admin_users_role` FOREIGN KEY (`role_id`) REFERENCES `admin_roles` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `admin_users`
--

LOCK TABLES `admin_users` WRITE;
/*!40000 ALTER TABLE `admin_users` DISABLE KEYS */;
INSERT INTO `admin_users` VALUES (1,1,'Elroi Super Admin','admin@elroifoods.example','<PASTE_HASH_HERE>',1,NULL,'2026-10-30 14:51:34');
/*!40000 ALTER TABLE `admin_users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `banners`
--

DROP TABLE IF EXISTS `banners`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `banners` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(120) NOT NULL,
  `image_path` varchar(255) NOT NULL DEFAULT '',
  `link_url` varchar(500) NOT NULL DEFAULT '',
  `position` enum('hero','promo','banner','strip') NOT NULL DEFAULT 'hero',
  `headline` varchar(200) NOT NULL DEFAULT '',
  `subheadline` varchar(200) NOT NULL DEFAULT '',
  `cta_text` varchar(80) NOT NULL DEFAULT '',
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `starts_at` datetime DEFAULT NULL,
  `ends_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `banners`
--

LOCK TABLES `banners` WRITE;
/*!40000 ALTER TABLE `banners` DISABLE KEYS */;
/*!40000 ALTER TABLE `banners` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `blog_categories`
--

DROP TABLE IF EXISTS `blog_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `blog_categories` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(120) NOT NULL,
  `slug` varchar(140) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_bc_slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `blog_categories`
--

LOCK TABLES `blog_categories` WRITE;
/*!40000 ALTER TABLE `blog_categories` DISABLE KEYS */;
INSERT INTO `blog_categories` VALUES (1,'Recipes','recipes'),(2,'Guides','guides'),(3,'News','news');
/*!40000 ALTER TABLE `blog_categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `blog_posts`
--

DROP TABLE IF EXISTS `blog_posts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `blog_posts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `category_id` int(10) unsigned DEFAULT NULL,
  `title` varchar(200) NOT NULL,
  `slug` varchar(220) NOT NULL,
  `excerpt` varchar(500) NOT NULL DEFAULT '',
  `body_html` longtext NOT NULL,
  `cover_image` varchar(255) NOT NULL DEFAULT '',
  `meta_title` varchar(200) NOT NULL DEFAULT '',
  `meta_description` varchar(300) NOT NULL DEFAULT '',
  `status` enum('draft','published','archived') NOT NULL DEFAULT 'draft',
  `published_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_bp_slug` (`slug`),
  KEY `idx_bp_status` (`status`,`published_at`),
  KEY `bp_fk_cat` (`category_id`),
  CONSTRAINT `bp_fk_cat` FOREIGN KEY (`category_id`) REFERENCES `blog_categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `blog_posts`
--

LOCK TABLES `blog_posts` WRITE;
/*!40000 ALTER TABLE `blog_posts` DISABLE KEYS */;
INSERT INTO `blog_posts` VALUES (1,1,'How to make perfect jollof rice','perfect-jollof-rice','The secrets to smoky, fluffy jollof every single time.','<p>Start with parboiled long-grain rice. Fry your tomato-pepper base until the oil floats. Add stock, cover, and let it steam undisturbed for 25 minutes.</p><p>The key to that classic smoky taste is <strong>not stirring</strong> in the last 10 minutes — let the bottom catch just slightly.</p>','','','','published','2026-10-31 12:27:05','2026-10-31 12:27:05','2026-10-31 12:27:05'),(2,2,'A guide to West African pantry staples','west-african-pantry','Egusi, garri, palm oil — what to buy and how to store it.','<p>Every West African kitchen runs on a small handful of essentials. Here is what to keep, and how to store each so it lasts.</p><ul><li>Egusi — cool, dry, airtight, 6 months</li><li>Palm oil — dark glass, no sunlight</li><li>Garri — dry container, away from steam</li></ul>','','','','published','2026-10-31 12:27:05','2026-10-31 12:27:05','2026-10-31 12:27:05'),(3,3,'Elroi Foods is now delivering across the UK','uk-delivery-launch','Free delivery on orders over £20. Same-day in London.','<p>We are live. Same-day delivery across Greater London, next-day elsewhere in the UK. Free delivery over £20.</p>','','','','published','2026-10-31 12:27:05','2026-10-31 12:27:05','2026-10-31 12:27:05'),(4,NULL,'hhhhhh yyyhvygy bhh','hhhhhh-yyyhvygy-bhh','','','','','','draft',NULL,'2026-11-03 18:18:27','2026-11-03 18:18:27');
/*!40000 ALTER TABLE `blog_posts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `brands`
--

DROP TABLE IF EXISTS `brands`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `brands` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(120) NOT NULL,
  `slug` varchar(140) NOT NULL,
  `logo_path` varchar(255) NOT NULL DEFAULT '',
  `is_visible` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_brands_slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `brands`
--

LOCK TABLES `brands` WRITE;
/*!40000 ALTER TABLE `brands` DISABLE KEYS */;
INSERT INTO `brands` VALUES (1,'Elroi Pantry','elroi-pantry','',1,'2026-10-30 15:25:42'),(2,'Mama Africa','mama-africa','',1,'2026-10-30 15:25:42'),(3,'Golden Harvest','golden-harvest','',1,'2026-10-30 15:25:42'),(4,'Farm Fresh','farm-fresh','',1,'2026-10-30 15:25:42'),(5,'Bella Cucina','bella-cucina','',1,'2026-10-30 15:25:42'),(6,'Britannia Foods','britannia-foods','',1,'2026-10-30 15:25:42'),(7,'Spice Route','spice-route','',1,'2026-10-30 15:25:42'),(8,'Ocean Catch','ocean-catch','',1,'2026-10-30 15:25:42'),(9,'Sunrise Dairy','sunrise-dairy','',1,'2026-10-30 15:25:42'),(10,'Green Basket','green-basket','',1,'2026-10-30 15:25:42');
/*!40000 ALTER TABLE `brands` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `cart_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cart_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `cart_id` bigint(20) unsigned NOT NULL,
  `variant_id` bigint(20) unsigned NOT NULL,
  `qty` int(10) unsigned NOT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_cart_variant` (`cart_id`,`variant_id`),
  KEY `idx_ci_variant` (`variant_id`),
  CONSTRAINT `ci_fk_cart` FOREIGN KEY (`cart_id`) REFERENCES `carts` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ci_fk_variant` FOREIGN KEY (`variant_id`) REFERENCES `product_variants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `cart_items` WRITE;
/*!40000 ALTER TABLE `cart_items` DISABLE KEYS */;
INSERT INTO `cart_items` VALUES (14,31,20,1,3.80,'2026-11-02 18:08:26','2026-11-02 18:08:26'),(15,6,37,1,2.80,'2026-11-02 18:10:38','2026-11-02 18:10:38'),(20,36,83,1,3.20,'2026-11-02 18:41:22','2026-11-02 18:41:22');
/*!40000 ALTER TABLE `cart_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `carts`
--

DROP TABLE IF EXISTS `carts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `carts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `cart_token` char(64) DEFAULT NULL,
  `status` enum('active','merged','abandoned','converted') NOT NULL DEFAULT 'active',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_carts_token` (`cart_token`),
  KEY `idx_carts_user` (`user_id`,`status`),
  KEY `idx_carts_active` (`status`,`updated_at`),
  CONSTRAINT `carts_fk_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `carts`
--

LOCK TABLES `carts` WRITE;
/*!40000 ALTER TABLE `carts` DISABLE KEYS */;
INSERT INTO `carts` VALUES (1,1,NULL,'active','2026-10-31 11:59:22','2026-11-02 13:54:12'),(2,NULL,'1996621674b5a91ff96d56e5204d252a916b24eee081f6debd8dbac7e8a08073','active','2026-10-31 12:02:14','2026-10-31 12:02:14'),(3,NULL,'3ea67359b39266be9c4ea9199346c4a4213b4c4c0644b632fc3c97b7cdfde484','active','2026-10-31 12:09:47','2026-10-31 12:09:47'),(4,NULL,'a3d551fdcce14e6167e872cb6d99d9b105a37905e83575e3d310b756cd706ded','active','2026-10-31 12:59:50','2026-10-31 12:59:50'),(5,NULL,'3689f0e54ed49161bf1649e4f08c92603136beacf924bce1362ca952656763b2','active','2026-10-31 20:44:57','2026-10-31 20:44:57'),(6,NULL,'1346773849720f7e4560a2018fa857ecfea707d288e824f7e924daaca6f3bdd5','active','2026-10-31 20:44:57','2026-11-03 09:55:39'),(7,NULL,'c1ac94b2cb70f66f913117c42ad6eee81573ea741cc320ac528015e60350b9b1','active','2026-11-02 14:22:29','2026-11-02 14:22:29'),(30,NULL,'cb6cd3914444f2ac42633b121e99d11325cab71e14c539077af02000f16190cd','active','2026-11-02 18:08:25','2026-11-02 18:08:25'),(31,NULL,'c9dd8462503db6cc5c5040550ff3103068523497d6a43c9c08a55ea0877f5696','active','2026-11-02 18:08:26','2026-11-02 18:08:26'),(36,1,'cf4edbe873a0756d481e1ddd02eff3fd9cf7822dadebd29128d65e7f1061f92c','active','2026-11-02 18:18:46','2026-11-02 18:41:22');
/*!40000 ALTER TABLE `carts` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `categories` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(120) NOT NULL,
  `slug` varchar(140) NOT NULL,
  `image_path` varchar(255) NOT NULL DEFAULT '',
  `description` text DEFAULT NULL,
  `position` int(11) NOT NULL DEFAULT 0,
  `is_visible` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `icon_type` enum('emoji','icon','url','none') NOT NULL DEFAULT 'emoji',
  `icon_value` varchar(255) NOT NULL DEFAULT '?️',
  `loyalty_redeemable` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_categories_slug` (`slug`),
  KEY `idx_categories_parent` (`parent_id`),
  CONSTRAINT `fk_categories_parent` FOREIGN KEY (`parent_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `categories` WRITE;
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
INSERT INTO `categories` VALUES (1,NULL,'Produce','produce','',NULL,1,1,'2026-10-30 14:51:34','emoji','🍽️',1),(2,NULL,'Pantry','pantry','',NULL,2,1,'2026-10-30 14:51:34','emoji','🍽️',1),(3,NULL,'Dairy & Eggs','dairy-eggs','',NULL,3,1,'2026-10-30 14:51:34','emoji','🍽️',1),(4,NULL,'Bakery','bakery','',NULL,4,1,'2026-10-30 14:51:34','emoji','🍽️',1),(5,NULL,'Beverages','beverages','',NULL,5,1,'2026-10-30 14:51:34','emoji','🍽️',1),(6,NULL,'Meat & Seafood','meat-seafood','',NULL,6,1,'2026-10-30 14:51:34','emoji','🍽️',1),(7,NULL,'Household','household','',NULL,7,1,'2026-10-30 14:51:34','emoji','🍽️',1);
/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `coupon_categories`
--

DROP TABLE IF EXISTS `coupon_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coupon_categories` (
  `coupon_id` bigint(20) unsigned NOT NULL,
  `category_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`coupon_id`,`category_id`),
  KEY `cc_fk_category` (`category_id`),
  CONSTRAINT `cc_fk_category` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
  CONSTRAINT `cc_fk_coupon` FOREIGN KEY (`coupon_id`) REFERENCES `coupons` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `coupon_categories`
--

LOCK TABLES `coupon_categories` WRITE;
/*!40000 ALTER TABLE `coupon_categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `coupon_categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `coupon_products`
--

DROP TABLE IF EXISTS `coupon_products`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coupon_products` (
  `coupon_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`coupon_id`,`product_id`),
  KEY `cp_fk_product` (`product_id`),
  CONSTRAINT `cp_fk_coupon` FOREIGN KEY (`coupon_id`) REFERENCES `coupons` (`id`) ON DELETE CASCADE,
  CONSTRAINT `cp_fk_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `coupon_products`
--

LOCK TABLES `coupon_products` WRITE;
/*!40000 ALTER TABLE `coupon_products` DISABLE KEYS */;
/*!40000 ALTER TABLE `coupon_products` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `coupon_usage`
--

DROP TABLE IF EXISTS `coupon_usage`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coupon_usage` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `coupon_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `email` varchar(191) NOT NULL DEFAULT '',
  `order_id` bigint(20) unsigned DEFAULT NULL,
  `used_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_cu_coupon` (`coupon_id`,`used_at`),
  KEY `idx_cu_user` (`user_id`),
  KEY `cu_fk_order` (`order_id`),
  CONSTRAINT `cu_fk_coupon` FOREIGN KEY (`coupon_id`) REFERENCES `coupons` (`id`) ON DELETE CASCADE,
  CONSTRAINT `cu_fk_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `coupon_usage`
--

LOCK TABLES `coupon_usage` WRITE;
/*!40000 ALTER TABLE `coupon_usage` DISABLE KEYS */;
/*!40000 ALTER TABLE `coupon_usage` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `coupons`
--

DROP TABLE IF EXISTS `coupons`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coupons` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(60) NOT NULL,
  `description` varchar(255) NOT NULL DEFAULT '',
  `discount_type` enum('percent','fixed','free_delivery') NOT NULL DEFAULT 'percent',
  `applies_to` enum('cart','products','categories') NOT NULL DEFAULT 'cart',
  `discount_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `min_order_subtotal` decimal(12,2) NOT NULL DEFAULT 0.00,
  `max_discount_amount` decimal(12,2) DEFAULT NULL,
  `starts_at` datetime DEFAULT NULL,
  `ends_at` datetime DEFAULT NULL,
  `usage_limit` int(10) unsigned DEFAULT NULL,
  `per_customer_limit` int(10) unsigned NOT NULL DEFAULT 1,
  `times_used` int(10) unsigned NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `exclude_sale_items` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_coupon_code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `coupons`
--

LOCK TABLES `coupons` WRITE;
/*!40000 ALTER TABLE `coupons` DISABLE KEYS */;
INSERT INTO `coupons` VALUES (4,'WELCOME','Save 15% on your first basket','percent','cart',15.00,10.00,NULL,NULL,NULL,NULL,1,0,1,'2026-11-03 15:42:50',0);
/*!40000 ALTER TABLE `coupons` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `customer_addresses`
--

DROP TABLE IF EXISTS `customer_addresses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_addresses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `label` varchar(40) NOT NULL DEFAULT 'Home',
  `first_name` varchar(80) NOT NULL,
  `last_name` varchar(80) NOT NULL DEFAULT '',
  `phone` varchar(30) NOT NULL DEFAULT '',
  `address1` varchar(255) NOT NULL,
  `address2` varchar(255) NOT NULL DEFAULT '',
  `city` varchar(100) NOT NULL,
  `state` varchar(100) NOT NULL DEFAULT '',
  `postcode` varchar(20) NOT NULL DEFAULT '',
  `country` varchar(2) NOT NULL DEFAULT 'GB',
  `delivery_notes` text DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_addr_user` (`user_id`,`is_default`),
  CONSTRAINT `addr_fk_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customer_addresses`
--

LOCK TABLES `customer_addresses` WRITE;
/*!40000 ALTER TABLE `customer_addresses` DISABLE KEYS */;
INSERT INTO `customer_addresses` VALUES (1,1,'Home','kingsley','Madu','+2348167677704','FPNO nigeria','','Owerri','Imo state','463121','NG','',1,'2026-10-31 12:49:15','2026-10-31 12:49:15');
/*!40000 ALTER TABLE `customer_addresses` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `customer_notes`
--

DROP TABLE IF EXISTS `customer_notes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_notes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `admin_user_id` bigint(20) unsigned DEFAULT NULL,
  `body` text NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_cn_user` (`user_id`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `customer_notes`
--

LOCK TABLES `customer_notes` WRITE;
/*!40000 ALTER TABLE `customer_notes` DISABLE KEYS */;
/*!40000 ALTER TABLE `customer_notes` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `delivery_methods`
--

DROP TABLE IF EXISTS `delivery_methods`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `delivery_methods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(40) NOT NULL,
  `label` varchar(80) NOT NULL,
  `description` varchar(200) NOT NULL DEFAULT '',
  `base_fee` decimal(12,2) NOT NULL DEFAULT 0.00,
  `free_above` decimal(12,2) DEFAULT NULL,
  `min_days` int(10) unsigned NOT NULL DEFAULT 1,
  `max_days` int(10) unsigned NOT NULL DEFAULT 3,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `position` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_dm_code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `delivery_methods`
--

LOCK TABLES `delivery_methods` WRITE;
/*!40000 ALTER TABLE `delivery_methods` DISABLE KEYS */;
INSERT INTO `delivery_methods` VALUES (1,'standard','Standard delivery','Delivered in 1–2 business days',5.00,20.00,1,2,1,1),(2,'express','Express delivery','Same-day in eligible postcodes',8.00,NULL,0,1,0,2),(3,'collection','Click & collect','Pick up from our store',0.00,NULL,0,1,0,3);
/*!40000 ALTER TABLE `delivery_methods` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `delivery_slots`
--

DROP TABLE IF EXISTS `delivery_slots`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `delivery_slots` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(20) NOT NULL,
  `label` varchar(60) NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `surcharge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `position` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_ds_code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `delivery_slots`
--

LOCK TABLES `delivery_slots` WRITE;
/*!40000 ALTER TABLE `delivery_slots` DISABLE KEYS */;
INSERT INTO `delivery_slots` VALUES (1,'morning','Morning (8am–12pm)','08:00:00','12:00:00',0.00,1,1),(2,'afternoon','Afternoon (12pm–5pm)','12:00:00','17:00:00',0.00,1,2),(3,'evening','Evening (5pm–9pm)','17:00:00','21:00:00',2.00,1,3);
/*!40000 ALTER TABLE `delivery_slots` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `email_templates`
--

DROP TABLE IF EXISTS `email_templates`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `email_templates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(60) NOT NULL,
  `name` varchar(120) NOT NULL,
  `subject` varchar(200) NOT NULL DEFAULT '',
  `body_html` longtext NOT NULL,
  `variables` text DEFAULT NULL,
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `email_templates`
--

LOCK TABLES `email_templates` WRITE;
/*!40000 ALTER TABLE `email_templates` DISABLE KEYS */;
INSERT INTO `email_templates` VALUES (1,'welcome','Welcome email','Welcome to Elroi Foods, {first_name}!','<p>Hi {first_name},</p><p>Welcome to Elroi Foods. Thanks for joining us!</p>','first_name,email','2026-11-03 15:59:27'),(2,'order_confirmation','Order confirmation','Your order #{order_number} is confirmed','<p>Hi {first_name},</p><p>Thanks for your order #{order_number}. Total: {grand_total}</p>','first_name,order_number,grand_total','2026-11-03 15:59:27'),(3,'order_shipped','Order shipped','Your order #{order_number} is on the way','<p>Hi {first_name},</p><p>Your order #{order_number} has been dispatched.</p>','first_name,order_number','2026-11-03 15:59:27'),(4,'password_reset','Password reset','Reset your Elroi Foods password','<p>Hi {first_name},</p><p>Click <a href=\"{reset_url}\">here</a> to reset your password.</p>','first_name,reset_url','2026-11-03 15:59:27'),(5,'cod_collected','COD collected','Payment received for order #{order_number}','<p>Hi {first_name},</p><p>We have received payment for order #{order_number}. Thank you!</p>','first_name,order_number','2026-11-03 15:59:27'),(6,'refund_issued','Refund issued','Refund processed for order #{order_number}','<p>Hi {first_name},</p><p>Your refund of {refund_amount} for order #{order_number} has been processed.</p>','first_name,order_number,refund_amount','2026-11-03 15:59:27');
/*!40000 ALTER TABLE `email_templates` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `email_verifications`
--

DROP TABLE IF EXISTS `email_verifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `email_verifications` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `token_hash` char(64) NOT NULL,
  `expires_at` datetime NOT NULL,
  `used_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_ev_token` (`token_hash`),
  KEY `idx_ev_user` (`user_id`),
  CONSTRAINT `fk_ev_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `email_verifications`
--

LOCK TABLES `email_verifications` WRITE;
/*!40000 ALTER TABLE `email_verifications` DISABLE KEYS */;
INSERT INTO `email_verifications` VALUES (1,1,'2ca363b2d36bf1461ff49e9da5017118870399cc0d1929ebd8a0420632af56d3','2026-10-31 12:46:14',NULL,'2026-10-31 11:46:14'),(2,2,'fe00e328f02d329c95860eb605112a7790bde821786198b939f39054811936d2','2026-11-02 11:18:05',NULL,'2026-11-02 10:18:05'),(3,3,'ee68e900e38644e2e6cb9296fec8b0b098bfd02afd04eddb540a9a5d348faf68','2026-11-02 11:26:05',NULL,'2026-11-02 10:26:05'),(4,4,'e1cec96f7e5b834c09534c0ccdaad58db933ed2e8aecc00edb498cf1c4823a00','2026-11-02 11:27:26',NULL,'2026-11-02 10:27:26');
/*!40000 ALTER TABLE `email_verifications` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `export_jobs`
--

DROP TABLE IF EXISTS `export_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `export_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `export_type` varchar(60) NOT NULL,
  `params_json` mediumtext DEFAULT NULL,
  `status` enum('queued','processing','completed','failed') NOT NULL DEFAULT 'queued',
  `file_path` varchar(255) DEFAULT NULL,
  `row_count` int(10) unsigned NOT NULL DEFAULT 0,
  `error_message` text DEFAULT NULL,
  `admin_user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `completed_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ex_status` (`status`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `export_jobs`
--

LOCK TABLES `export_jobs` WRITE;
/*!40000 ALTER TABLE `export_jobs` DISABLE KEYS */;
INSERT INTO `export_jobs` VALUES (1,'orders',NULL,'completed','backups/orders_20261104_054223.csv',9,NULL,1,'2026-11-04 06:42:23','2026-11-04 06:42:23');
/*!40000 ALTER TABLE `export_jobs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `login_attempts`
--

DROP TABLE IF EXISTS `login_attempts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `login_attempts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `identifier` varchar(191) NOT NULL,
  `ip_address` varbinary(16) NOT NULL,
  `scope` varchar(30) NOT NULL,
  `success` tinyint(1) NOT NULL DEFAULT 0,
  `user_agent` varchar(255) NOT NULL DEFAULT '',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_la_ident` (`identifier`,`scope`,`created_at`),
  KEY `idx_la_ip` (`ip_address`,`scope`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `login_attempts`
--

LOCK TABLES `login_attempts` WRITE;
/*!40000 ALTER TABLE `login_attempts` DISABLE KEYS */;
INSERT INTO `login_attempts` VALUES (3,'test@example.com','\0\0','register',1,'curl/7.53.1','2026-10-31 11:46:14'),(5,'test@example.com','\0\0','customer',1,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-10-31 11:46:33'),(6,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-10-31 12:22:50'),(8,'welcome@example.com','\0\0','register',1,'curl/7.53.1','2026-11-02 10:18:05'),(9,'newuser@example.com','\0\0','register',1,'curl/7.53.1','2026-11-02 10:26:05'),(10,'newuser2@example.com','\0\0','register',1,'curl/7.53.1','2026-11-02 10:27:26'),(11,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-11-02 10:38:18'),(12,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-11-02 10:39:09'),(13,'test@example.com','\0\0','customer',1,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-11-02 10:42:14'),(15,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-11-02 10:52:47'),(16,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-11-02 11:00:20'),(17,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-11-02 11:02:55'),(18,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-11-02 14:20:20'),(19,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-11-02 14:20:46'),(21,'test@example.com','\0\0','customer',1,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36','2026-11-02 18:14:24'),(22,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-11-02 18:18:47'),(23,'test@example.com','\0\0','customer',1,'curl/7.53.1','2026-11-02 18:18:48');
/*!40000 ALTER TABLE `login_attempts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `loyalty_ledger`
--

DROP TABLE IF EXISTS `loyalty_ledger`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `loyalty_ledger` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `points` int(11) NOT NULL,
  `reason` enum('order','redeem','adjust','refund','referral','signup') NOT NULL DEFAULT 'order',
  `order_id` bigint(20) unsigned DEFAULT NULL,
  `note` varchar(200) NOT NULL DEFAULT '',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_ll_user` (`user_id`,`created_at`),
  KEY `ll_fk_order` (`order_id`),
  CONSTRAINT `ll_fk_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE SET NULL,
  CONSTRAINT `ll_fk_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `loyalty_ledger`
--

LOCK TABLES `loyalty_ledger` WRITE;
/*!40000 ALTER TABLE `loyalty_ledger` DISABLE KEYS */;
INSERT INTO `loyalty_ledger` VALUES (1,1,60,'order',2,'Order ELR-20261102-84DE943C','2026-11-02 11:05:41'),(2,1,24,'order',3,'Order ELR-20261102-2D2346E6','2026-11-02 11:06:01'),(3,1,63,'order',4,'Order ELR-20261102-78816D9A','2026-11-02 11:33:48'),(4,1,24,'order',5,'Order ELR-20261102-682BC332','2026-11-02 12:13:22'),(5,1,24,'order',6,'Order ELR-20261102-9CCC6768','2026-11-02 13:52:04'),(6,1,16,'order',7,'Order ELR-20261102-897876B6','2026-11-02 13:52:19'),(7,1,28,'order',8,'Order ELR-20261102-8BEE2359','2026-11-02 15:47:43'),(8,1,57,'order',9,'Order ELR-20261102-9B309EED','2026-11-02 18:22:10');
/*!40000 ALTER TABLE `loyalty_ledger` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `newsletter_campaigns`
--

DROP TABLE IF EXISTS `newsletter_campaigns`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `newsletter_campaigns` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `subject` varchar(200) NOT NULL,
  `body_html` longtext NOT NULL,
  `audience` enum('confirmed','all','unsubscribed') NOT NULL DEFAULT 'confirmed',
  `status` enum('draft','sending','sent','failed') NOT NULL DEFAULT 'draft',
  `recipient_count` int(10) unsigned NOT NULL DEFAULT 0,
  `sent_count` int(10) unsigned NOT NULL DEFAULT 0,
  `failed_count` int(10) unsigned NOT NULL DEFAULT 0,
  `error_message` text DEFAULT NULL,
  `created_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `sent_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `newsletter_campaigns`
--

LOCK TABLES `newsletter_campaigns` WRITE;
/*!40000 ALTER TABLE `newsletter_campaigns` DISABLE KEYS */;
/*!40000 ALTER TABLE `newsletter_campaigns` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `newsletter_subscribers`
--

DROP TABLE IF EXISTS `newsletter_subscribers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `newsletter_subscribers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(191) NOT NULL,
  `name` varchar(120) NOT NULL DEFAULT '',
  `source` varchar(40) NOT NULL DEFAULT 'footer',
  `status` enum('pending','confirmed','unsubscribed') NOT NULL DEFAULT 'confirmed',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_nl_email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `newsletter_subscribers`
--

LOCK TABLES `newsletter_subscribers` WRITE;
/*!40000 ALTER TABLE `newsletter_subscribers` DISABLE KEYS */;
INSERT INTO `newsletter_subscribers` VALUES (1,'news@example.com','','test','confirmed','2026-10-31 12:34:35'),(2,'wingaincome@gmail.com','','footer','confirmed','2026-11-02 11:13:03');
/*!40000 ALTER TABLE `newsletter_subscribers` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `order_access_tokens`
--

DROP TABLE IF EXISTS `order_access_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `order_access_tokens` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint(20) unsigned NOT NULL,
  `token_hash` char(64) NOT NULL,
  `email` varchar(191) NOT NULL,
  `expires_at` datetime NOT NULL,
  `used_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_oat_token` (`token_hash`),
  KEY `idx_oat_order` (`order_id`),
  CONSTRAINT `oat_fk_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `order_access_tokens`
--

LOCK TABLES `order_access_tokens` WRITE;
/*!40000 ALTER TABLE `order_access_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `order_access_tokens` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `order_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `order_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `variant_id` bigint(20) unsigned NOT NULL,
  `product_name` varchar(200) NOT NULL,
  `variant_label` varchar(120) NOT NULL,
  `sku` varchar(80) NOT NULL,
  `qty` int(10) unsigned NOT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `line_total` decimal(12,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_oi_order` (`order_id`),
  KEY `idx_oi_prod` (`product_id`),
  KEY `oi_fk_variant` (`variant_id`),
  CONSTRAINT `oi_fk_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `oi_fk_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
  CONSTRAINT `oi_fk_variant` FOREIGN KEY (`variant_id`) REFERENCES `product_variants` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `order_items` WRITE;
/*!40000 ALTER TABLE `order_items` DISABLE KEYS */;
INSERT INTO `order_items` VALUES (1,1,37,81,'Gala Apples','6 pack','0',1,2.40,2.40),(2,1,17,37,'Ripe Plantain','Bunch (4–5)','0',3,2.80,8.40),(3,2,49,106,'Sourdough Loaf','400 g loaf','0',1,3.20,3.20),(4,2,54,116,'Ground Coffee','500 g','0',1,8.90,8.90),(5,3,54,115,'Ground Coffee','250 g','0',1,4.80,4.80),(6,4,52,112,'Puff Puff Mix','500 g','0',1,2.40,2.40),(7,4,37,81,'Gala Apples','6 pack','0',1,2.40,2.40),(8,4,45,99,'Free-Range Eggs','30 eggs','0',1,7.90,7.90),(9,5,54,115,'Ground Coffee','250 g','0',1,4.80,4.80),(10,6,54,115,'Ground Coffee','250 g','0',1,4.80,4.80),(11,7,49,106,'Sourdough Loaf','400 g loaf','0',1,3.20,3.20),(12,8,48,104,'Mature Cheddar','200 g','0',1,2.80,2.80),(13,8,17,37,'Ripe Plantain','Bunch (4–5)','0',1,2.80,2.80),(14,9,49,107,'Sourdough Loaf','800 g loaf','0',1,5.80,5.80),(15,9,17,37,'Ripe Plantain','Bunch (4–5)','0',2,2.80,5.60);
/*!40000 ALTER TABLE `order_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `order_status_history`
--

DROP TABLE IF EXISTS `order_status_history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `order_status_history` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint(20) unsigned NOT NULL,
  `old_status` varchar(30) NOT NULL DEFAULT '',
  `new_status` varchar(30) NOT NULL,
  `note` varchar(255) NOT NULL DEFAULT '',
  `actor_type` enum('system','admin','customer') NOT NULL DEFAULT 'system',
  `actor_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_osh_order` (`order_id`,`created_at`),
  CONSTRAINT `osh_fk_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `order_status_history`
--

LOCK TABLES `order_status_history` WRITE;
/*!40000 ALTER TABLE `order_status_history` DISABLE KEYS */;
INSERT INTO `order_status_history` VALUES (1,1,'','pending','Order created','customer',NULL,'2026-10-31 12:56:06'),(2,2,'','pending','Order created','customer',NULL,'2026-11-02 11:05:41'),(3,3,'','pending','Order created','customer',NULL,'2026-11-02 11:06:01'),(4,4,'','pending','Order created','customer',NULL,'2026-11-02 11:33:48'),(5,5,'','pending','Order created','customer',NULL,'2026-11-02 12:13:22'),(6,6,'','pending','Order created','customer',NULL,'2026-11-02 13:52:04'),(7,7,'','pending','Order created','customer',NULL,'2026-11-02 13:52:19'),(8,8,'','pending','Order created','customer',NULL,'2026-11-02 15:47:43'),(9,9,'','pending','Order created','customer',NULL,'2026-11-02 18:22:10');
/*!40000 ALTER TABLE `order_status_history` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_number` varchar(32) NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `email` varchar(191) NOT NULL,
  `phone` varchar(30) NOT NULL DEFAULT '',
  `first_name` varchar(80) NOT NULL,
  `last_name` varchar(80) NOT NULL DEFAULT '',
  `shipping_address1` varchar(255) NOT NULL,
  `shipping_address2` varchar(255) NOT NULL DEFAULT '',
  `shipping_city` varchar(100) NOT NULL,
  `shipping_state` varchar(100) NOT NULL DEFAULT '',
  `shipping_postcode` varchar(20) NOT NULL DEFAULT '',
  `shipping_country` varchar(2) NOT NULL DEFAULT 'GB',
  `delivery_notes` text DEFAULT NULL,
  `currency` char(3) NOT NULL DEFAULT 'GBP',
  `subtotal` decimal(12,2) NOT NULL DEFAULT 0.00,
  `discount_total` decimal(12,2) NOT NULL DEFAULT 0.00,
  `delivery_fee` decimal(12,2) NOT NULL DEFAULT 0.00,
  `tax_total` decimal(12,2) NOT NULL DEFAULT 0.00,
  `grand_total` decimal(12,2) NOT NULL DEFAULT 0.00,
  `payment_method` varchar(30) NOT NULL DEFAULT 'pending',
  `payment_status` enum('pending','paid','failed','partially_refunded','refunded','cod_awaiting') NOT NULL DEFAULT 'pending',
  `status` enum('pending','confirmed','processing','ready_for_dispatch','shipped','out_for_delivery','delivered','cancelled','returned','refunded') NOT NULL DEFAULT 'pending',
  `coupon_code` varchar(60) DEFAULT NULL,
  `coupon_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `paid_at` datetime DEFAULT NULL,
  `delivered_at` datetime DEFAULT NULL,
  `delivery_method_code` varchar(40) NOT NULL DEFAULT 'standard',
  `delivery_slot_code` varchar(20) DEFAULT NULL,
  `delivery_date` date DEFAULT NULL,
  `points_redeemed` int(10) unsigned NOT NULL DEFAULT 0,
  `points_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `referral_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_orders_number` (`order_number`),
  KEY `idx_orders_user` (`user_id`,`created_at`),
  KEY `idx_orders_email` (`email`),
  KEY `idx_orders_status` (`status`,`created_at`),
  KEY `idx_orders_payment` (`payment_status`),
  CONSTRAINT `ord_fk_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `orders` WRITE;
/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
INSERT INTO `orders` VALUES (1,'ELR-20261031-DFF1DBD4',1,'test@example.com','+2348167677704','kingsley','Madu','FPNO nigeria','','Owerri','Imo state','463121','NG','','GBP',10.80,0.00,5.00,0.00,15.80,'cod','cod_awaiting','pending','',NULL,'2026-10-31 12:56:06','2026-10-31 12:56:06',NULL,NULL,'standard',NULL,NULL,0,0.00,0.00),(2,'ELR-20261102-84DE943C',1,'test@example.com','+2348167677704','kingsley','Madu','FPNO nigeria','','Owerri','Imo state','463121','NG','','GBP',12.10,0.00,5.00,0.00,17.10,'cod','cod_awaiting','pending','',NULL,'2026-11-02 11:05:41','2026-11-02 11:05:41',NULL,NULL,'standard',NULL,NULL,0,0.00,0.00),(3,'ELR-20261102-2D2346E6',1,'test@example.com','+2348167677704','kingsley','Madu','FPNO nigeria','','Owerri','Imo state','463121','NG','','GBP',4.80,0.00,5.00,0.00,9.80,'stripe','pending','pending','',NULL,'2026-11-02 11:06:01','2026-11-02 11:06:01',NULL,NULL,'standard',NULL,NULL,0,0.00,0.00),(4,'ELR-20261102-78816D9A',1,'test@example.com','+2348167677704','kingsley','Madu','FPNO nigeria','','Owerri','Imo state','463121','NG','','GBP',12.70,0.00,5.00,0.00,17.70,'mollie','pending','pending','',NULL,'2026-11-02 11:33:48','2026-11-02 11:33:48',NULL,NULL,'standard',NULL,NULL,0,0.00,0.00),(5,'ELR-20261102-682BC332',1,'test@example.com','+2348167677704','kingsley','Madu','FPNO nigeria','','Owerri','Imo state','463121','NG','','GBP',4.80,0.00,5.00,0.00,9.80,'paypal','pending','pending','',NULL,'2026-11-02 12:13:22','2026-11-02 12:13:22',NULL,NULL,'standard',NULL,NULL,0,0.00,0.00),(6,'ELR-20261102-9CCC6768',1,'test@example.com','+2348167677704','kingsley','Madu','FPNO nigeria','','Owerri','Imo state','463121','NG','','GBP',4.80,0.00,5.00,0.00,9.80,'cod','cod_awaiting','pending','',NULL,'2026-11-02 13:52:04','2026-11-02 13:52:04',NULL,NULL,'standard',NULL,NULL,0,0.00,0.00),(7,'ELR-20261102-897876B6',1,'test@example.com','+2348167677704','kingsley','Madu','FPNO nigeria','','Owerri','Imo state','463121','NG','','GBP',3.20,0.00,5.00,0.00,8.20,'paypal','pending','pending','',NULL,'2026-11-02 13:52:19','2026-11-02 13:52:19',NULL,NULL,'standard',NULL,NULL,0,0.00,0.00),(8,'ELR-20261102-8BEE2359',1,'test@example.com','+2348167677704','kingsley','Madu','FPNO nigeria','','Owerri','Imo state','463121','NG','','GBP',5.60,0.00,5.00,0.00,10.60,'paypal','pending','pending','',NULL,'2026-11-02 15:47:43','2026-11-02 15:47:43',NULL,NULL,'standard',NULL,NULL,0,0.00,0.00),(9,'ELR-20261102-9B309EED',1,'test@example.com','+2348167677704','kingsley','Madu','FPNO nigeria','','Owerri','Imo state','463121','NG','','GBP',11.40,0.00,5.00,0.00,16.40,'paypal','pending','pending','',NULL,'2026-11-02 18:22:10','2026-11-02 18:22:10',NULL,NULL,'standard',NULL,NULL,0,0.00,0.00);
/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `password_resets`
--

DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_resets` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `token_hash` char(64) NOT NULL,
  `expires_at` datetime NOT NULL,
  `used_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_pr_token` (`token_hash`),
  KEY `idx_pr_user` (`user_id`),
  CONSTRAINT `fk_pr_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `password_resets`
--

LOCK TABLES `password_resets` WRITE;
/*!40000 ALTER TABLE `password_resets` DISABLE KEYS */;
INSERT INTO `password_resets` VALUES (1,3,'72ada2468039bf5505ec233c5898c0db2b69b85f23416ea93bcd2cb2b438fc9a','2026-11-02 10:56:05','2026-11-02 10:27:26','2026-11-02 10:26:05'),(2,3,'8ab9cb988ee205c7d25bbc35c9ba3f848b826125184d5624de26e68957010091','2026-11-02 10:57:26',NULL,'2026-11-02 10:27:26');
/*!40000 ALTER TABLE `password_resets` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payment_webhook_events`
--

DROP TABLE IF EXISTS `payment_webhook_events`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_webhook_events` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `gateway` varchar(40) NOT NULL,
  `event_type` varchar(100) NOT NULL DEFAULT '',
  `order_reference` varchar(120) NOT NULL DEFAULT '',
  `status` varchar(40) NOT NULL DEFAULT 'received',
  `response_sent` varchar(255) NOT NULL DEFAULT '',
  `raw_payload` mediumtext DEFAULT NULL,
  `received_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_wh_gateway` (`gateway`,`received_at`),
  KEY `idx_wh_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payment_webhook_events`
--

LOCK TABLES `payment_webhook_events` WRITE;
/*!40000 ALTER TABLE `payment_webhook_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_webhook_events` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `payments`
--

DROP TABLE IF EXISTS `payments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint(20) unsigned NOT NULL,
  `order_number` varchar(32) NOT NULL DEFAULT '',
  `gateway` varchar(40) NOT NULL DEFAULT '',
  `gateway_event_id` varchar(255) DEFAULT NULL,
  `gateway_reference` varchar(255) DEFAULT NULL,
  `amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `currency` char(3) NOT NULL DEFAULT 'GBP',
  `status` varchar(40) NOT NULL DEFAULT 'succeeded',
  `event_type` varchar(80) NOT NULL DEFAULT '',
  `raw_payload` mediumtext DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_pay_gateway_event` (`gateway`,`gateway_event_id`),
  KEY `idx_pay_order` (`order_id`),
  KEY `idx_pay_gateway` (`gateway`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `payments`
--

LOCK TABLES `payments` WRITE;
/*!40000 ALTER TABLE `payments` DISABLE KEYS */;
/*!40000 ALTER TABLE `payments` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `product_attribute_values`
--

DROP TABLE IF EXISTS `product_attribute_values`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_attribute_values` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `attribute_id` int(10) unsigned NOT NULL,
  `value` varchar(80) NOT NULL,
  `slug` varchar(90) NOT NULL,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`meta`)),
  `position` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_attr_val` (`attribute_id`,`slug`),
  KEY `idx_attr_val_attr` (`attribute_id`),
  CONSTRAINT `pav_fk_attribute` FOREIGN KEY (`attribute_id`) REFERENCES `product_attributes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=277 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `product_attribute_values`
--

LOCK TABLES `product_attribute_values` WRITE;
/*!40000 ALTER TABLE `product_attribute_values` DISABLE KEYS */;
INSERT INTO `product_attribute_values` VALUES (1,1,'500 g','500-g',NULL,1),(2,1,'1 kg','1-kg',NULL,2),(3,1,'2 kg','2-kg',NULL,3),(4,1,'5 kg','5-kg',NULL,4),(5,1,'10 kg','10-kg',NULL,5),(6,1,'Single pack','single-pack',NULL,6),(7,1,'5-pack','5-pack',NULL,7),(8,1,'Family pack','family-pack',NULL,8),(9,1,'1 L','1-l',NULL,9),(10,1,'2 L','2-l',NULL,10),(11,1,'500 ml','500-ml',NULL,11),(12,1,'Dozen','dozen',NULL,12),(13,1,'Crate of 15','crate-15',NULL,13),(14,1,'Crate of 30','crate-30',NULL,14),(16,2,'250 g','250-g',NULL,1),(17,2,'500 g','500-g-w',NULL,2),(18,2,'1 kg','1-kg-w',NULL,3),(19,2,'2 kg','2-kg-w',NULL,4),(20,2,'5 kg','5-kg-w',NULL,5),(21,2,'10 kg','10-kg-w',NULL,6),(23,3,'Red','red','{\"hex\":\"#c62828\"}',1),(24,3,'Green','green','{\"hex\":\"#2e7d32\"}',2),(25,3,'Yellow','yellow','{\"hex\":\"#f9a825\"}',3),(26,3,'Orange','orange','{\"hex\":\"#ef6c00\"}',4),(27,3,'Brown','brown','{\"hex\":\"#6d4c41\"}',5),(28,3,'Mixed','mixed','{\"hex\":\"#8d6e63\"}',6),(30,4,'Nigeria','nigeria',NULL,1),(31,4,'Ghana','ghana',NULL,2),(32,4,'Kenya','kenya',NULL,3),(33,4,'Italy','italy',NULL,4),(34,4,'United Kingdom','uk',NULL,5),(35,4,'India','india',NULL,6),(36,4,'Thailand','thailand',NULL,7),(37,4,'Spain','spain',NULL,8),(38,4,'France','france',NULL,9),(39,4,'Jamaica','jamaica',NULL,10),(45,5,'Whole','whole',NULL,1),(46,5,'Fillet','fillet',NULL,2),(47,5,'Diced','diced',NULL,3),(48,5,'Ground','ground',NULL,4),(132,1,'250 g','250-g',NULL,0),(134,1,'500 g','500-g-w',NULL,0),(135,1,'1 kg','1-kg-w',NULL,0),(136,1,'2 kg','2-kg-w',NULL,0),(137,1,'5 kg','5-kg-w',NULL,0),(138,1,'10 kg','10-kg-w',NULL,0),(180,2,'500 g','500-g',NULL,0),(181,2,'1 kg','1-kg',NULL,0),(182,2,'2 kg','2-kg',NULL,0),(183,2,'5 kg','5-kg',NULL,0),(184,2,'10 kg','10-kg',NULL,0);
/*!40000 ALTER TABLE `product_attribute_values` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `product_attributes`
--

DROP TABLE IF EXISTS `product_attributes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_attributes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(60) NOT NULL,
  `slug` varchar(70) NOT NULL,
  `display_type` enum('select','radio','swatch') NOT NULL DEFAULT 'select',
  `position` int(11) NOT NULL DEFAULT 0,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_attr_slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `product_attributes`
--

LOCK TABLES `product_attributes` WRITE;
/*!40000 ALTER TABLE `product_attributes` DISABLE KEYS */;
INSERT INTO `product_attributes` VALUES (1,'Pack Size','pack-size','select',1,'2026-10-30 15:25:42'),(2,'Weight','weight','radio',2,'2026-10-30 15:25:42'),(3,'Colour','colour','swatch',3,'2026-10-30 15:25:42'),(4,'Origin','origin','select',4,'2026-10-30 15:25:42'),(5,'Cut','cut','select',5,'2026-10-30 15:25:42');
/*!40000 ALTER TABLE `product_attributes` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `product_images`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_images` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `alt_text` varchar(200) NOT NULL DEFAULT '',
  `position` int(11) NOT NULL DEFAULT 0,
  `is_cover` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_pi_product` (`product_id`,`position`),
  CONSTRAINT `pi_fk_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `product_images` WRITE;
/*!40000 ALTER TABLE `product_images` DISABLE KEYS */;
INSERT INTO `product_images` VALUES (10,10,'seed/jollof-rice.svg','Premium Jollof Rice',0,1,'2026-10-31 10:22:06'),(11,11,'seed/egusi-ground.svg','Ground Egusi Seeds',0,1,'2026-10-31 10:22:06'),(12,12,'seed/garri-ijebu.svg','Ijebu Garri',0,1,'2026-10-31 10:22:06'),(13,13,'seed/red-palm-oil.svg','Red Palm Oil',0,1,'2026-10-31 10:22:06'),(14,14,'seed/suya-spice.svg','Suya Spice Blend',0,1,'2026-10-31 10:22:06'),(15,15,'seed/dried-fish-eja.svg','Dried Eja Fish',0,1,'2026-10-31 10:22:06'),(16,16,'seed/crayfish-ground.svg','Ground Crayfish',0,1,'2026-10-31 10:22:06'),(17,17,'seed/plantain-ripe.svg','Ripe Plantain',0,1,'2026-10-31 10:22:06'),(18,18,'seed/cassava-flour.svg','Cassava Flour (Fufu)',0,1,'2026-10-31 10:22:06'),(19,19,'seed/chin-chin.svg','Chin Chin (Family Pack)',0,1,'2026-10-31 10:22:06'),(20,20,'seed/zobo-leaves.svg','Dried Zobo Leaves',0,1,'2026-10-31 10:22:06'),(21,21,'seed/groundnut-oil.svg','Groundnut Oil',0,1,'2026-10-31 10:22:06'),(22,22,'seed/basmati-rice.svg','Basmati Rice',0,1,'2026-10-31 10:22:06'),(23,23,'seed/pasta-penne.svg','Penne Pasta',0,1,'2026-10-31 10:22:06'),(24,24,'seed/olive-oil-exv.svg','Extra-Virgin Olive Oil',0,1,'2026-10-31 10:22:06'),(25,25,'seed/tinned-tomatoes.svg','Chopped Tomatoes (Tinned)',0,1,'2026-10-31 10:22:06'),(26,26,'seed/english-breakfast-tea.svg','English Breakfast Tea',0,1,'2026-10-31 10:22:06'),(27,27,'seed/thai-noodles.svg','Rice Noodles (Pad Thai)',0,1,'2026-10-31 10:22:06'),(28,28,'seed/curry-powder.svg','Madras Curry Powder',0,1,'2026-10-31 10:22:06'),(29,29,'seed/jamaican-curry.svg','Jamaican Curry Powder',0,1,'2026-10-31 10:22:06'),(30,30,'seed/coconut-milk.svg','Coconut Milk',0,1,'2026-10-31 10:22:06'),(31,31,'seed/tomatoes-vine.svg','Vine Tomatoes',0,1,'2026-10-31 10:22:06'),(32,32,'seed/bell-peppers.svg','Bell Peppers',0,1,'2026-10-31 10:22:06'),(33,33,'seed/onions-brown.svg','Brown Onions',0,1,'2026-10-31 10:22:06'),(34,34,'seed/carrots.svg','Carrots',0,1,'2026-10-31 10:22:06'),(35,35,'seed/bananas.svg','Bananas',0,1,'2026-10-31 10:22:06'),(36,36,'seed/oranges.svg','Oranges',0,1,'2026-10-31 10:22:06'),(37,37,'seed/apples.svg','Gala Apples',0,1,'2026-10-31 10:22:07'),(38,38,'seed/avocado.svg','Hass Avocados',0,1,'2026-10-31 10:22:07'),(39,39,'seed/chicken-whole.svg','Whole Chicken',0,1,'2026-10-31 10:22:07'),(40,40,'seed/chicken-fillets.svg','Chicken Breast Fillets',0,1,'2026-10-31 10:22:07'),(41,41,'seed/beef-diced.svg','Diced Beef',0,1,'2026-10-31 10:22:07'),(42,42,'seed/salmon-fillet.svg','Salmon Fillets',0,1,'2026-10-31 10:22:07'),(43,43,'seed/prawns-king.svg','King Prawns',0,1,'2026-10-31 10:22:07'),(44,44,'seed/whole-milk.svg','Whole Milk',0,1,'2026-10-31 10:22:07'),(45,45,'seed/free-range-eggs.svg','Free-Range Eggs',0,1,'2026-10-31 10:22:07'),(46,46,'seed/butter-salted.svg','Salted Butter',0,1,'2026-10-31 10:22:07'),(47,47,'seed/greek-yoghurt.svg','Greek Yoghurt',0,1,'2026-10-31 10:22:07'),(48,48,'seed/cheddar-block.svg','Mature Cheddar',0,1,'2026-10-31 10:22:07'),(49,49,'seed/sourdough-loaf.svg','Sourdough Loaf',0,1,'2026-10-31 10:22:07'),(50,50,'seed/wholemeal-bread.svg','Wholemeal Bread',0,1,'2026-10-31 10:22:07'),(51,51,'seed/croissants.svg','All-Butter Croissants',0,1,'2026-10-31 10:22:07'),(52,52,'seed/puff-puff-mix.svg','Puff Puff Mix',0,1,'2026-10-31 10:22:07'),(53,53,'seed/orange-juice.svg','Fresh Orange Juice',0,1,'2026-10-31 10:22:07'),(54,54,'seed/ground-coffee.svg','Ground Coffee',0,1,'2026-10-31 10:22:07'),(55,55,'seed/malt-drink.svg','Malt Drink (6-pack)',0,1,'2026-10-31 10:22:07');
/*!40000 ALTER TABLE `product_images` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `product_reviews`
--

DROP TABLE IF EXISTS `product_reviews`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_reviews` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `order_id` bigint(20) unsigned DEFAULT NULL,
  `rating` tinyint(3) unsigned NOT NULL,
  `title` varchar(120) NOT NULL DEFAULT '',
  `body` text NOT NULL,
  `is_verified` tinyint(1) NOT NULL DEFAULT 0,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `moderated_by` bigint(20) unsigned DEFAULT NULL,
  `moderated_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_pr_product` (`product_id`,`status`,`created_at`),
  KEY `idx_pr_user` (`user_id`),
  KEY `idx_pr_status` (`status`,`created_at`),
  KEY `idx_pr_order` (`order_id`),
  CONSTRAINT `pr_fk_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `pr_fk_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `product_reviews`
--

LOCK TABLES `product_reviews` WRITE;
/*!40000 ALTER TABLE `product_reviews` DISABLE KEYS */;
INSERT INTO `product_reviews` VALUES (1,54,1,NULL,5,'Great coffee','Best ground coffee I have had in a while!',0,'approved',1,'2026-11-03 16:19:15','2026-11-03 16:13:36','2026-11-03 16:19:15'),(2,54,1,NULL,5,'Pending test','Test body',1,'pending',NULL,NULL,'2026-11-03 16:20:58','2026-11-03 16:20:58'),(3,54,1,NULL,5,'Test pending','Test body',1,'pending',NULL,NULL,'2026-11-03 16:22:40','2026-11-03 16:22:40'),(4,35,2,NULL,5,'qqq','wwwwww',1,'pending',NULL,NULL,'2026-11-03 16:24:18','2026-11-03 16:24:18');
/*!40000 ALTER TABLE `product_reviews` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `product_stock_history`
--

DROP TABLE IF EXISTS `product_stock_history`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_stock_history` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `variant_id` bigint(20) unsigned NOT NULL,
  `change_qty` int(11) NOT NULL,
  `before_qty` int(11) NOT NULL,
  `after_qty` int(11) NOT NULL,
  `reason` enum('sale','cancel','restock','adjust','return','seed') NOT NULL DEFAULT 'adjust',
  `note` varchar(255) NOT NULL DEFAULT '',
  `actor_type` enum('system','admin','customer') NOT NULL DEFAULT 'system',
  `actor_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_psh_variant` (`variant_id`,`created_at`),
  CONSTRAINT `psh_fk_variant` FOREIGN KEY (`variant_id`) REFERENCES `product_variants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `product_stock_history`
--

LOCK TABLES `product_stock_history` WRITE;
/*!40000 ALTER TABLE `product_stock_history` DISABLE KEYS */;
INSERT INTO `product_stock_history` VALUES (18,20,120,0,120,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(19,21,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(20,22,25,0,25,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(21,23,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(22,24,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(23,25,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(24,26,55,0,55,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(25,27,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(26,28,12,0,12,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(27,29,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(28,30,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(29,31,80,0,80,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(30,32,45,0,45,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(31,33,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(32,34,15,0,15,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(33,35,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(34,36,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(35,37,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(36,38,25,0,25,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(37,39,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(38,40,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(39,41,15,0,15,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(40,42,50,0,50,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(41,43,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(42,44,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(43,45,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(44,46,25,0,25,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(45,47,12,0,12,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(46,48,80,0,80,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(47,49,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(48,50,15,0,15,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(49,51,100,0,100,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(50,52,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(51,53,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(52,54,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(53,55,120,0,120,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(54,56,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(55,57,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(56,58,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(57,59,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(58,60,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(59,61,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(60,62,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(61,63,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(62,64,80,0,80,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(63,65,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(64,66,100,0,100,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(65,67,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(66,68,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(67,69,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(68,70,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(69,71,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(70,72,100,0,100,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(71,73,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(72,74,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(73,75,80,0,80,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(74,76,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(75,77,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(76,78,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:06'),(77,79,50,0,50,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(78,80,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(79,81,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(80,82,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(81,83,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(82,84,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(83,85,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(84,86,25,0,25,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(85,87,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(86,88,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(87,89,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(88,90,12,0,12,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(89,91,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(90,92,12,0,12,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(91,93,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(92,94,10,0,10,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(93,95,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(94,96,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(95,97,60,0,60,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(96,98,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(97,99,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(98,100,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(99,101,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(100,102,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(101,103,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(102,104,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(103,105,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(104,106,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(105,107,10,0,10,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(106,108,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(107,109,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(108,110,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(109,111,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(110,112,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(111,113,40,0,40,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(112,114,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(113,115,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(114,116,20,0,20,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(115,117,30,0,30,'seed','Initial seed stock','system',NULL,'2026-10-31 10:22:07'),(116,81,1,40,39,'sale','Order ELR-20261031-DFF1DBD4','system',NULL,'2026-10-31 12:56:06'),(117,37,3,40,37,'sale','Order ELR-20261031-DFF1DBD4','system',NULL,'2026-10-31 12:56:06'),(118,106,1,20,19,'sale','Order ELR-20261102-84DE943C','system',NULL,'2026-11-02 11:05:41'),(119,116,1,20,19,'sale','Order ELR-20261102-84DE943C','system',NULL,'2026-11-02 11:05:41'),(120,115,1,30,29,'sale','Order ELR-20261102-2D2346E6','system',NULL,'2026-11-02 11:06:01'),(121,112,1,40,39,'sale','Order ELR-20261102-78816D9A','system',NULL,'2026-11-02 11:33:48'),(122,81,1,39,38,'sale','Order ELR-20261102-78816D9A','system',NULL,'2026-11-02 11:33:48'),(123,99,1,20,19,'sale','Order ELR-20261102-78816D9A','system',NULL,'2026-11-02 11:33:48'),(124,115,1,29,28,'sale','Order ELR-20261102-682BC332','system',NULL,'2026-11-02 12:13:22'),(125,115,1,28,27,'sale','Order ELR-20261102-9CCC6768','system',NULL,'2026-11-02 13:52:04'),(126,106,1,19,18,'sale','Order ELR-20261102-897876B6','system',NULL,'2026-11-02 13:52:19'),(127,104,1,30,29,'sale','Order ELR-20261102-8BEE2359','system',NULL,'2026-11-02 15:47:43'),(128,37,1,37,36,'sale','Order ELR-20261102-8BEE2359','system',NULL,'2026-11-02 15:47:43'),(129,107,1,10,9,'sale','Order ELR-20261102-9B309EED','system',NULL,'2026-11-02 18:22:10'),(130,37,2,36,34,'sale','Order ELR-20261102-9B309EED','system',NULL,'2026-11-02 18:22:10'),(131,107,991,9,1000,'adjust','','admin',1,'2026-11-03 16:29:21');
/*!40000 ALTER TABLE `product_stock_history` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `product_variant_values`
--

DROP TABLE IF EXISTS `product_variant_values`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_variant_values` (
  `variant_id` bigint(20) unsigned NOT NULL,
  `attribute_value_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`variant_id`,`attribute_value_id`),
  KEY `idx_vv_attrval` (`attribute_value_id`),
  CONSTRAINT `pvv_fk_value` FOREIGN KEY (`attribute_value_id`) REFERENCES `product_attribute_values` (`id`) ON DELETE CASCADE,
  CONSTRAINT `pvv_fk_variant` FOREIGN KEY (`variant_id`) REFERENCES `product_variants` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `product_variant_values`
--

LOCK TABLES `product_variant_values` WRITE;
/*!40000 ALTER TABLE `product_variant_values` DISABLE KEYS */;
INSERT INTO `product_variant_values` VALUES (20,2),(20,30),(21,4),(21,30),(22,5),(22,30),(23,30),(23,132),(24,1),(24,30),(25,2),(25,30),(26,2),(26,30),(27,3),(27,30),(28,4),(28,30),(29,9),(29,30),(30,10),(30,30),(31,30),(32,30),(33,16),(33,30),(33,45),(34,30),(34,45),(34,180),(35,30),(35,48),(36,16),(36,30),(36,48),(37,25),(37,30),(38,25),(38,30),(39,2),(39,30),(40,3),(40,30),(41,4),(41,30),(42,16),(42,30),(43,30),(43,180),(44,30),(45,30),(46,9),(46,30),(47,10),(47,30),(48,2),(48,35),(49,4),(49,35),(50,5),(50,35),(51,17),(51,33),(52,2),(52,33),(53,11),(53,37),(54,9),(54,37),(55,33),(56,7),(56,33),(57,34),(58,34),(59,36),(60,36),(61,35),(62,35),(63,39),(64,36),(65,9),(65,36),(66,17),(66,34),(67,2),(67,34),(68,23),(68,34),(69,24),(69,34),(70,25),(70,34),(71,28),(71,34),(72,2),(72,34),(73,3),(73,34),(74,4),(74,34),(75,17),(75,34),(76,2),(76,34),(77,25),(77,34),(78,12),(78,25),(78,34),(79,26),(79,37),(80,12),(80,26),(80,37),(81,23),(81,38),(82,12),(82,23),(82,38),(83,24),(83,32),(84,24),(84,32),(85,18),(85,34),(85,45),(86,34),(86,45),(87,17),(87,34),(87,46),(88,2),(88,34),(88,46),(89,17),(89,34),(89,47),(90,2),(90,34),(90,47),(91,16),(91,34),(91,46),(92,34),(92,46),(92,180),(93,16),(93,36),(93,45),(94,36),(94,45),(94,180),(95,9),(95,34),(96,10),(96,34),(97,34),(98,12),(98,34),(99,14),(99,34),(100,16),(100,34),(101,34),(101,180),(102,34),(102,180),(103,2),(103,34),(104,34),(105,34),(105,180),(106,34),(107,34),(107,180),(108,34),(109,34),(109,180),(110,38),(111,38),(112,30),(113,9),(113,37),(114,10),(114,37),(115,16),(115,32),(116,32),(116,180),(117,7),(117,30);
/*!40000 ALTER TABLE `product_variant_values` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `product_variants`
--

DROP TABLE IF EXISTS `product_variants`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_variants` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint(20) unsigned NOT NULL,
  `image_id` bigint(20) unsigned DEFAULT NULL,
  `sku` varchar(80) NOT NULL,
  `label` varchar(120) NOT NULL,
  `regular_price` decimal(12,2) NOT NULL,
  `sale_price` decimal(12,2) DEFAULT NULL,
  `cost_price` decimal(12,2) DEFAULT NULL,
  `stock_qty` int(11) NOT NULL DEFAULT 0,
  `low_stock_at` int(11) NOT NULL DEFAULT 5,
  `allows_cod` tinyint(1) NOT NULL DEFAULT 1,
  `loyalty_redeemable` tinyint(1) DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `weight_grams` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_variant_sku` (`sku`),
  KEY `idx_variant_product` (`product_id`,`is_active`),
  KEY `idx_variant_price` (`regular_price`,`sale_price`),
  KEY `pv_fk_image` (`image_id`),
  CONSTRAINT `pv_fk_image` FOREIGN KEY (`image_id`) REFERENCES `product_images` (`id`) ON DELETE SET NULL,
  CONSTRAINT `pv_fk_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `product_variants`
--

LOCK TABLES `product_variants` WRITE;
/*!40000 ALTER TABLE `product_variants` DISABLE KEYS */;
INSERT INTO `product_variants` VALUES (20,10,10,'JR-1KG','1 kg bag',4.20,3.80,NULL,120,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(21,10,10,'JR-5KG','5 kg bag',18.50,16.90,NULL,60,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(22,10,10,'JR-10KG','10 kg bag',34.00,30.50,NULL,25,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(23,11,11,'EG-250','250 g',3.40,NULL,NULL,60,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(24,11,11,'EG-500','500 g',6.20,5.60,NULL,40,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(25,11,11,'EG-1KG','1 kg',11.80,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(26,12,12,'GR-1KG','1 kg',3.10,NULL,NULL,55,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(27,12,12,'GR-2KG','2 kg',5.90,NULL,NULL,30,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(28,12,12,'GR-5KG','5 kg',13.90,NULL,NULL,12,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(29,13,13,'RP-1L','1 L',6.40,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(30,13,13,'RP-2L','2 L',11.90,10.80,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(31,14,14,'SU-100','100 g',3.20,NULL,NULL,80,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(32,14,14,'SU-250','250 g',6.80,NULL,NULL,45,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(33,15,15,'DE-250','250 g',7.20,NULL,NULL,30,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(34,15,15,'DE-500','500 g',13.90,12.50,NULL,15,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(35,16,16,'CR-100','100 g',4.80,NULL,NULL,60,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(36,16,16,'CR-250','250 g',10.90,NULL,NULL,30,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(37,17,17,'PL-RIPE','Bunch (4–5)',2.80,NULL,NULL,34,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-11-02 18:22:10'),(38,17,17,'PL-RIPE-L','Large bunch',4.50,NULL,NULL,25,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(39,18,18,'CF-1KG','1 kg',2.60,NULL,NULL,60,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(40,18,18,'CF-2KG','2 kg',4.90,NULL,NULL,40,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(41,18,18,'CF-5KG','5 kg',11.40,NULL,NULL,15,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(42,19,19,'CC-250','250 g',3.60,NULL,NULL,50,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(43,19,19,'CC-500','500 g',6.20,NULL,NULL,30,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(44,20,20,'ZB-100','100 g',3.20,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(45,20,20,'ZB-250','250 g',6.80,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(46,21,21,'GO-1L','1 L',7.90,NULL,NULL,25,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(47,21,21,'GO-2L','2 L',14.50,NULL,NULL,12,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(48,22,22,'BR-1KG','1 kg',3.80,NULL,NULL,80,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(49,22,22,'BR-5KG','5 kg',17.20,15.40,NULL,40,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(50,22,22,'BR-10KG','10 kg',32.50,28.90,NULL,15,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(51,23,23,'PP-500','500 g',1.80,NULL,NULL,100,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(52,23,23,'PP-1KG','1 kg',3.20,NULL,NULL,60,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(53,24,24,'OO-500','500 ml',8.40,NULL,NULL,30,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(54,24,24,'OO-1L','1 L',14.90,13.20,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(55,25,25,'TT-400','400 g tin',1.10,NULL,NULL,120,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(56,25,25,'TT-6PK','6-pack',5.90,NULL,NULL,30,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(57,26,26,'TB-40','40 bags',3.20,NULL,NULL,60,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(58,26,26,'TB-80','80 bags',5.90,NULL,NULL,40,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(59,27,27,'RN-200','200 g',1.60,NULL,NULL,60,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(60,27,27,'RN-500','500 g',3.40,NULL,NULL,30,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(61,28,28,'CU-100','100 g',2.40,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(62,28,28,'CU-250','250 g',5.60,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(63,29,29,'JC-100','100 g',2.80,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(64,30,30,'CM-400','400 ml',1.80,NULL,NULL,80,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(65,30,30,'CM-1L','1 L',3.90,NULL,NULL,30,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(66,31,31,'TO-500','500 g',1.20,NULL,NULL,100,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(67,31,31,'TO-1KG','1 kg',2.20,NULL,NULL,60,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(68,32,32,'BP-RED','Red (2 pack)',1.80,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(69,32,32,'BP-GRN','Green (2 pack)',1.60,NULL,NULL,40,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(70,32,32,'BP-YEL','Yellow (2 pack)',1.90,NULL,NULL,30,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(71,32,32,'BP-MIX','Mixed (4 pack)',3.40,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(72,33,33,'ON-1KG','1 kg',1.10,NULL,NULL,100,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(73,33,33,'ON-2KG','2 kg',2.00,NULL,NULL,60,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(74,33,33,'ON-5KG','5 kg',4.50,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(75,34,34,'CA-500','500 g',0.90,NULL,NULL,80,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(76,34,34,'CA-1KG','1 kg',1.60,NULL,NULL,60,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(77,35,35,'BN-6','6 pack',1.30,NULL,NULL,60,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(78,35,35,'BN-12','12 pack',2.40,NULL,NULL,40,5,1,NULL,0,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(79,36,36,'OR-6','6 pack',2.20,NULL,NULL,50,5,1,NULL,1,1,NULL,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(80,36,36,'OR-12','12 pack',4.10,NULL,NULL,30,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(81,37,37,'AP-6','6 pack',2.40,NULL,NULL,38,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-11-02 11:33:48'),(82,37,37,'AP-12','12 pack',4.60,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(83,38,38,'AV-2','2 pack',3.20,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(84,38,38,'AV-4','4 pack',5.90,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(85,39,39,'CH-WHOLE','Whole (~1.5 kg)',6.90,NULL,NULL,30,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(86,39,39,'CH-HALF','Half chicken',3.80,NULL,NULL,25,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(87,40,40,'CH-BR-500','500 g',4.20,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(88,40,40,'CH-BR-1KG','1 kg',7.90,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(89,41,41,'BF-500','500 g',5.40,NULL,NULL,20,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(90,41,41,'BF-1KG','1 kg',10.20,NULL,NULL,12,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(91,42,42,'SL-250','250 g',4.90,NULL,NULL,20,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(92,42,42,'SL-500','500 g',9.20,NULL,NULL,12,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(93,43,43,'PR-250','250 g',5.20,NULL,NULL,20,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(94,43,43,'PR-500','500 g',9.80,NULL,NULL,10,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(95,44,44,'MK-1L','1 L',1.20,NULL,NULL,60,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(96,44,44,'MK-2L','2 L',2.20,NULL,NULL,30,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(97,45,45,'EG-6','6 eggs',1.80,NULL,NULL,60,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(98,45,45,'EG-12','12 eggs',3.40,NULL,NULL,40,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(99,45,45,'EG-30','30 eggs',7.90,NULL,NULL,19,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-11-02 11:33:48'),(100,46,46,'BT-250','250 g',1.90,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(101,46,46,'BT-500','500 g',3.40,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(102,47,47,'GY-500','500 g',2.20,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(103,47,47,'GY-1KG','1 kg',3.90,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(104,48,48,'CD-200','200 g',2.80,NULL,NULL,29,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-11-02 15:47:43'),(105,48,48,'CD-400','400 g',5.20,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(106,49,49,'SD-400','400 g loaf',3.20,NULL,NULL,18,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-11-02 13:52:19'),(107,49,49,'SD-800','800 g loaf',5.80,NULL,NULL,1000,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-11-03 16:29:21'),(108,50,50,'WB-400','400 g',1.60,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(109,50,50,'WB-800','800 g',2.80,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(110,51,51,'CR-4','4 pack',2.80,NULL,NULL,30,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(111,51,51,'CR-8','8 pack',5.20,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(112,52,52,'PP-MIX','500 g',2.40,NULL,NULL,39,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-11-02 11:33:48'),(113,53,53,'OJ-1L','1 L',2.20,NULL,NULL,40,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(114,53,53,'OJ-2L','2 L',3.90,NULL,NULL,20,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(115,54,54,'GC-250','250 g',4.80,NULL,NULL,27,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-11-02 13:52:04'),(116,54,54,'GC-500','500 g',8.90,NULL,NULL,19,5,1,NULL,0,1,NULL,'2026-10-31 10:22:07','2026-11-02 11:05:41'),(117,55,55,'MD-6','6-pack',3.80,NULL,NULL,30,5,1,NULL,1,1,NULL,'2026-10-31 10:22:07','2026-10-31 10:22:07');
/*!40000 ALTER TABLE `product_variants` ENABLE KEYS */;
UNLOCK TABLES;

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

DROP TABLE IF EXISTS `products`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `category_id` int(10) unsigned DEFAULT NULL,
  `brand_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(200) NOT NULL,
  `slug` varchar(220) NOT NULL,
  `sku` varchar(80) NOT NULL,
  `short_desc` varchar(500) NOT NULL DEFAULT '',
  `description` longtext DEFAULT NULL,
  `fallback_type` enum('emoji','icon','url','none') NOT NULL DEFAULT 'emoji',
  `fallback_value` varchar(255) NOT NULL DEFAULT '?️',
  `regular_price` decimal(12,2) NOT NULL DEFAULT 0.00,
  `sale_price` decimal(12,2) DEFAULT NULL,
  `stock_qty` int(11) NOT NULL DEFAULT 0,
  `low_stock_at` int(11) NOT NULL DEFAULT 5,
  `allows_cod` tinyint(1) NOT NULL DEFAULT 1,
  `is_featured` tinyint(1) NOT NULL DEFAULT 0,
  `is_new_arrival` tinyint(1) NOT NULL DEFAULT 0,
  `is_visible` tinyint(1) NOT NULL DEFAULT 1,
  `loyalty_redeemable` tinyint(1) NOT NULL DEFAULT 1,
  `avg_rating` decimal(3,2) NOT NULL DEFAULT 0.00,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_products_slug` (`slug`),
  UNIQUE KEY `uq_products_sku` (`sku`),
  KEY `idx_products_cat` (`category_id`),
  KEY `idx_products_brand` (`brand_id`),
  KEY `idx_products_visible` (`is_visible`,`created_at`),
  CONSTRAINT `fk_products_brand` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk_products_cat` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` VALUES (10,2,2,'Premium Jollof Rice','jollof-rice','JOLLOF-RICE-PARENT','Long-grain parboiled rice, perfect for one-pot jollof.','Authentic long-grain parboiled rice, hand-sourced from West Africa. Holds its shape and absorbs spice beautifully.','emoji','🛍️',0.00,NULL,0,5,1,1,1,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(11,2,2,'Ground Egusi Seeds','egusi-ground','EGUSI-GROUND-PARENT','Melon seeds, finely ground. Rich, nutty base for egusi soup.','Sun-dried and ground melon seeds — the heart of egusi soup. Aromatic, deeply savoury.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(12,2,2,'Ijebu Garri','garri-ijebu','GARRI-IJEBU-PARENT','Sour, crunchy cassava flakes — perfect with cold water and groundnuts.','Traditional Ijebu-style garri, fermented for a deep tang. Great as a snack or as eba.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(13,2,2,'Red Palm Oil','red-palm-oil','RED-PALM-OIL-PARENT','Unrefined, cold-pressed palm oil for soups and stews.','Deep red, unrefined palm oil — the backbone of Nigerian soups. Rich in vitamin A.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(14,2,7,'Suya Spice Blend','suya-spice','SUYA-SPICE-PARENT','Ready-made blend of groundnuts, ginger, paprika and chilli.','The classic northern-Nigerian suya spice. Use on skewers, chicken, or grilled vegetables.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(15,6,8,'Dried Eja Fish','dried-fish-eja','DRIED-FISH-EJA-PARENT','Sun-dried catfish, ready to rehydrate for soups.','Whole sun-dried catfish (eja). Deep umami flavour — the soul of Nigerian soups.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(16,6,8,'Ground Crayfish','crayfish-ground','CRAYFISH-GROUND-PARENT','Sun-dried, ground prawns. A pinch transforms any soup.','Finely ground dried crayfish — a little goes a long way.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(17,1,4,'Ripe Plantain','plantain-ripe','PLANTAIN-RIPE-PARENT','Sweet, ripe plantain — perfect for dodo.','Ripe, starchy-sweet plantain. Fry for dodo, or bake for a healthier snack.','emoji','🛍️',0.00,NULL,0,5,1,1,1,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(18,2,2,'Cassava Flour (Fufu)','cassava-flour','CASSAVA-FLOUR-PARENT','Finely milled cassava — the base for smooth fufu.','Finely milled cassava flour. Gluten-free, ideal for fufu or baking.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(19,4,NULL,'Chin Chin (Family Pack)','chin-chin','CHIN-CHIN-PARENT','Crunchy, sweet fried dough bites — the classic Nigerian snack.','Crunchy sweet Nigerian chin chin. Perfect with tea or as a snack on the go.','emoji','🛍️',0.00,NULL,0,5,1,0,1,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(20,5,2,'Dried Zobo Leaves','zobo-leaves','ZOBO-LEAVES-PARENT','Hibiscus petals for the classic Nigerian zobo drink.','Dried hibiscus petals. Simmer with ginger, cloves and pineapple for the classic zobo.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(21,2,2,'Groundnut Oil','groundnut-oil','GROUNDNUT-OIL-PARENT','Cold-pressed groundnut oil, deep nutty flavour.','Cold-pressed groundnut oil, ideal for frying and for soups.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(22,2,3,'Basmati Rice','basmati-rice','BASMATI-RICE-PARENT','Aromatic long-grain basmati from the foothills of the Himalayas.','Aged basmati rice — fragrant, delicate, ideal for biryanis and pilaus.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(23,2,5,'Penne Pasta','pasta-penne','PASTA-PENNE-PARENT','Bronze-die penne from Puglia, Italy.','Slow-dried durum-wheat penne. Holds sauce beautifully.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(24,2,5,'Extra-Virgin Olive Oil','olive-oil-exv','OLIVE-OIL-EXV-PARENT','Cold-pressed Picual olives from Andalusia.','Peppery, grassy extra-virgin olive oil. Perfect for finishing, dressings, and light cooking.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(25,2,5,'Chopped Tomatoes (Tinned)','tinned-tomatoes','TINNED-TOMATOES-PARENT','Italian chopped tomatoes in their own juice.','Sun-ripened Italian tomatoes, chopped and tinned. The backbone of any sauce.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(26,5,NULL,'English Breakfast Tea','english-breakfast-tea','ENGLISH-BREAKFAST-TEA-PARENT','Bright, brisk blend of Assam and Ceylon.','A malty, robust Assam blend with Ceylon for brightness. Perfect with milk.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(27,2,7,'Rice Noodles (Pad Thai)','thai-noodles','THAI-NOODLES-PARENT','Flat rice noodles — perfect for pad thai.','Flat rice noodles from Thailand, ideal for pad thai or stir-fries.','emoji','🛍️',0.00,NULL,0,5,1,0,1,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(28,2,7,'Madras Curry Powder','curry-powder','CURRY-POWDER-PARENT','Warm, aromatic blend from Chennai.','Classic Madras curry powder. Coriander, cumin, turmeric, fenugreek.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(29,2,7,'Jamaican Curry Powder','jamaican-curry','JAMAICAN-CURRY-PARENT','Turmeric-forward curry blend with allspice.','Authentic Jamaican curry powder — the soul of curry goat and chicken.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(30,2,7,'Coconut Milk','coconut-milk','COCONUT-MILK-PARENT','Rich, creamy tinned coconut milk.','Full-fat coconut milk from Thailand. Rich, creamy, unctuous.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(31,1,4,'Vine Tomatoes','tomatoes-vine','TOMATOES-VINE-PARENT','Ripe vine tomatoes, sweet and juicy.','Ripe vine tomatoes, picked at peak. Perfect for salads and sauces.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(32,1,4,'Bell Peppers','bell-peppers','BELL-PEPPERS-PARENT','Sweet bell peppers — mixed colours.','Mixed sweet bell peppers. Great for stir-fries, roasting and soups.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(33,1,4,'Brown Onions','onions-brown','ONIONS-BROWN-PARENT','Everyday brown onions.','Essential kitchen staple. Firm, sweet and versatile.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(34,1,4,'Carrots','carrots','CARROTS-PARENT','Sweet, crunchy carrots.','Sweet, crunchy carrots — perfect for roasting or snacking.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(35,1,4,'Bananas','bananas','BANANAS-PARENT','Sweet ripe bananas.','Ripe bananas — great for snacking, smoothies and baking.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(36,1,4,'Oranges','oranges','ORANGES-PARENT','Juicy, sweet oranges.','Sweet, juicy oranges. Great for juicing or eating out of hand.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:06','2026-10-31 10:22:06'),(37,1,4,'Gala Apples','apples','APPLES-PARENT','Crisp, sweet Gala apples.','Crisp, sweet Gala apples. Great in lunchboxes.','emoji','🛍️',0.00,NULL,0,5,1,0,1,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(38,1,4,'Hass Avocados','avocado','AVOCADO-PARENT','Creamy, ripe Hass avocados.','Ripe Hass avocados — rich, creamy, ready to eat.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(39,6,10,'Whole Chicken','chicken-whole','CHICKEN-WHOLE-PARENT','Free-range whole chicken, ready to roast.','Free-range whole chicken, ~1.5 kg. Perfect for roasting.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(40,6,10,'Chicken Breast Fillets','chicken-fillets','CHICKEN-FILLETS-PARENT','Skinless chicken breast fillets.','Skinless chicken breast fillets — lean, versatile, quick to cook.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(41,6,10,'Diced Beef','beef-diced','BEEF-DICED-PARENT','Diced beef — for stews and curries.','Diced beef from grass-fed cattle. Ideal for slow cooking.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(42,6,8,'Salmon Fillets','salmon-fillet','SALMON-FILLET-PARENT','Atlantic salmon fillets, skin on.','Atlantic salmon fillets — rich, tender, ready to pan-fry.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(43,6,8,'King Prawns','prawns-king','PRAWNS-KING-PARENT','Raw king prawns, shell on.','Raw king prawns — sweet, firm, ready to peel and cook.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(44,3,9,'Whole Milk','whole-milk','WHOLE-MILK-PARENT','Fresh whole milk, glass bottle.','Fresh whole milk from grass-fed cows. Creamy, rich.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(45,3,9,'Free-Range Eggs','free-range-eggs','FREE-RANGE-EGGS-PARENT','Free-range eggs from happy hens.','Free-range eggs with deep golden yolks.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(46,3,9,'Salted Butter','butter-salted','BUTTER-SALTED-PARENT','Creamy salted butter.','Churned salted butter — perfect for toast, baking.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(47,3,9,'Greek Yoghurt','greek-yoghurt','GREEK-YOGHURT-PARENT','Thick, creamy Greek yoghurt.','Strained Greek yoghurt — thick, tangy, high in protein.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(48,3,9,'Mature Cheddar','cheddar-block','CHEDDAR-BLOCK-PARENT','Mature cheddar, aged 12 months.','Mature British cheddar, aged 12 months. Sharp, crumbly, full-flavoured.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(49,4,NULL,'Sourdough Loaf','sourdough-loaf','SOURDOUGH-LOAF-PARENT','Naturally leavened sourdough.','Naturally leavened sourdough with a crisp crust and open crumb.','emoji','🛍️',0.00,NULL,0,5,1,1,1,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(50,4,NULL,'Wholemeal Bread','wholemeal-bread','WHOLEMEAL-BREAD-PARENT','Soft wholemeal sandwich loaf.','Soft wholemeal sandwich loaf — great for lunchboxes.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(51,4,NULL,'All-Butter Croissants','croissants','CROISSANTS-PARENT','Flaky all-butter croissants.','All-butter croissants — flaky, golden, ready to warm.','emoji','🛍️',0.00,NULL,0,5,1,0,1,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(52,4,2,'Puff Puff Mix','puff-puff-mix','PUFF-PUFF-MIX-PARENT','Ready-to-fry puff puff mix.','Just add water, rest, and fry. The easiest way to puff puff.','emoji','🛍️',0.00,NULL,0,5,1,0,1,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(53,5,4,'Fresh Orange Juice','orange-juice','ORANGE-JUICE-PARENT','Freshly squeezed, not from concentrate.','Freshly squeezed orange juice. No added sugar.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07'),(54,5,7,'Ground Coffee','ground-coffee','GROUND-COFFEE-PARENT','Medium-roast ground coffee.','Medium-roast arabica ground coffee. Chocolatey, smooth.','emoji','🛍️',0.00,NULL,0,5,1,1,0,1,1,5.00,'2026-10-31 10:22:07','2026-11-03 16:19:15'),(55,5,NULL,'Malt Drink (6-pack)','malt-drink','MALT-DRINK-PARENT','Classic Nigerian-style malt drink.','Sweet, malty Nigerian-style malt drink. Six 330ml cans.','emoji','🛍️',0.00,NULL,0,5,1,0,0,1,1,0.00,'2026-10-31 10:22:07','2026-10-31 10:22:07');
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `promotion_items`
--

DROP TABLE IF EXISTS `promotion_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `promotion_items` (
  `promotion_id` bigint(20) unsigned NOT NULL,
  `item_type` enum('product','category') NOT NULL,
  `item_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`promotion_id`,`item_type`,`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `promotion_items`
--

LOCK TABLES `promotion_items` WRITE;
/*!40000 ALTER TABLE `promotion_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `promotion_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `promotions`
--

DROP TABLE IF EXISTS `promotions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `promotions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(150) NOT NULL,
  `description` varchar(500) NOT NULL DEFAULT '',
  `discount_type` enum('percent','fixed') NOT NULL DEFAULT 'percent',
  `discount_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `scope` enum('all','category','product') NOT NULL DEFAULT 'all',
  `starts_at` datetime DEFAULT NULL,
  `ends_at` datetime DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `promotions`
--

LOCK TABLES `promotions` WRITE;
/*!40000 ALTER TABLE `promotions` DISABLE KEYS */;
INSERT INTO `promotions` VALUES (1,'Test Sale','','percent',20.00,'all',NULL,NULL,1,'2026-11-03 15:42:50');
/*!40000 ALTER TABLE `promotions` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `rate_limits`
--

DROP TABLE IF EXISTS `rate_limits`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rate_limits` (
  `bucket_key` varchar(191) NOT NULL,
  `window_start` datetime NOT NULL,
  `hits` int(10) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`bucket_key`,`window_start`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `rate_limits`
--

LOCK TABLES `rate_limits` WRITE;
/*!40000 ALTER TABLE `rate_limits` DISABLE KEYS */;
INSERT INTO `rate_limits` VALUES ('cart:add:127.0.0.1','2026-11-02 18:18:00',2),('cart:add:127.0.0.1','2026-11-02 18:19:00',3),('cart:add:127.0.0.1','2026-11-02 18:21:00',3),('cart:add:127.0.0.1','2026-11-02 18:41:00',1),('checkout:127.0.0.1','2026-11-02 18:00:00',1);
/*!40000 ALTER TABLE `rate_limits` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `recently_viewed`
--

DROP TABLE IF EXISTS `recently_viewed`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `recently_viewed` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `session_key` char(64) DEFAULT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `viewed_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_rv_user` (`user_id`,`viewed_at`),
  KEY `idx_rv_session` (`session_key`,`viewed_at`),
  KEY `rv_fk_product` (`product_id`),
  CONSTRAINT `rv_fk_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `recently_viewed`
--

LOCK TABLES `recently_viewed` WRITE;
/*!40000 ALTER TABLE `recently_viewed` DISABLE KEYS */;
/*!40000 ALTER TABLE `recently_viewed` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `referrals`
--

DROP TABLE IF EXISTS `referrals`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `referrals` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `referrer_id` bigint(20) unsigned NOT NULL,
  `referred_id` bigint(20) unsigned DEFAULT NULL,
  `code_used` varchar(20) NOT NULL,
  `status` enum('pending','qualified','rewarded','expired') NOT NULL DEFAULT 'pending',
  `qualifying_order_id` bigint(20) unsigned DEFAULT NULL,
  `referrer_reward` decimal(12,2) NOT NULL DEFAULT 0.00,
  `referred_reward` decimal(12,2) NOT NULL DEFAULT 0.00,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `qualified_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_ref_referred` (`referred_id`),
  KEY `idx_ref_referrer` (`referrer_id`,`status`),
  CONSTRAINT `ref_fk_referred` FOREIGN KEY (`referred_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `ref_fk_referrer` FOREIGN KEY (`referrer_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `referrals`
--

LOCK TABLES `referrals` WRITE;
/*!40000 ALTER TABLE `referrals` DISABLE KEYS */;
/*!40000 ALTER TABLE `referrals` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `refunds`
--

DROP TABLE IF EXISTS `refunds`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `refunds` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint(20) unsigned NOT NULL,
  `order_number` varchar(32) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `reason` varchar(255) NOT NULL DEFAULT '',
  `method` varchar(30) NOT NULL DEFAULT 'manual',
  `status` enum('pending','processing','completed','failed') NOT NULL DEFAULT 'pending',
  `gateway_reference` varchar(120) NOT NULL DEFAULT '',
  `notes` text DEFAULT NULL,
  `requested_by` bigint(20) unsigned DEFAULT NULL,
  `processed_by` bigint(20) unsigned DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `processed_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_refund_order` (`order_id`),
  KEY `idx_refund_status` (`status`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `refunds`
--

LOCK TABLES `refunds` WRITE;
/*!40000 ALTER TABLE `refunds` DISABLE KEYS */;
INSERT INTO `refunds` VALUES (1,2,'ELR-20261102-84DE943C',5.00,'0','manual','pending','','Admin test',1,1,'2026-11-03 16:35:10',NULL);
/*!40000 ALTER TABLE `refunds` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `security_logs`
--

DROP TABLE IF EXISTS `security_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `security_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `event` varchar(80) NOT NULL,
  `scope` varchar(30) NOT NULL,
  `identifier` varchar(191) NOT NULL DEFAULT '',
  `ip_address` varbinary(16) NOT NULL,
  `detail` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_sl_event` (`event`,`created_at`),
  KEY `idx_sl_ip` (`ip_address`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `security_logs`
--

LOCK TABLES `security_logs` WRITE;
/*!40000 ALTER TABLE `security_logs` DISABLE KEYS */;
INSERT INTO `security_logs` VALUES (1,'login_failed','customer','test@example.com','\0\0','bad credentials','2026-10-31 11:44:37'),(2,'login_failed','customer','test@example.com','\0\0','bad credentials','2026-10-31 11:44:40'),(3,'user_registered','customer','test@example.com','\0\0','user_id=1','2026-10-31 11:46:14'),(4,'login_failed','customer','test@example.com','\0\0','bad credentials','2026-10-31 11:46:22'),(5,'login_success','customer','test@example.com','\0\0','user_id=1','2026-10-31 11:46:33'),(6,'login_success','customer','test@example.com','\0\0','user_id=1','2026-10-31 12:22:50'),(7,'csrf_fail','system','','\0\0','/tesvisco-store/backend/public/api/customers/addresses-save','2026-10-31 12:22:50'),(8,'csrf_fail','system','','\0\0','/tesvisco-store/backend/public/api/cart/add','2026-10-31 12:22:50'),(9,'csrf_fail','system','','\0\0','/tesvisco-store/backend/public/api/checkout/create-order','2026-10-31 12:22:50'),(10,'order_created','customer','test@example.com','\0\0','order=ELR-20261031-DFF1DBD4 method=cod','2026-10-31 12:56:06'),(11,'login_failed','customer','test@example.com','\0\0','bad credentials','2026-11-02 10:03:20'),(12,'user_registered','customer','newuser@example.com','\0\0','user_id=3','2026-11-02 10:26:05'),(13,'password_reset_requested','customer','newuser@example.com','\0\0','user_id=3','2026-11-02 10:26:05'),(14,'user_registered','customer','newuser2@example.com','\0\0','user_id=4','2026-11-02 10:27:26'),(15,'password_reset_requested','customer','newuser@example.com','\0\0','user_id=3','2026-11-02 10:27:26'),(16,'bucket_limited','system','register:127.0.0.1','\0\0','key=register:127.0.0.1 hits=4 max=3','2026-11-02 10:28:26'),(17,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 10:38:18'),(18,'csrf_fail','system','','\0\0','/tesvisco-store/backend/public/api/cart/add','2026-11-02 10:38:18'),(19,'csrf_fail','system','','\0\0','/tesvisco-store/backend/public/api/checkout/create-order','2026-11-02 10:38:18'),(20,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 10:39:09'),(21,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 10:42:15'),(22,'login_failed','customer','test@example.com','\0\0','bad credentials','2026-11-02 10:49:22'),(23,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 10:52:47'),(24,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=6 max=5','2026-11-02 10:58:28'),(25,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=7 max=5','2026-11-02 10:58:40'),(26,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=8 max=5','2026-11-02 10:58:41'),(27,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 11:00:20'),(28,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 11:02:55'),(29,'order_created','customer','test@example.com','\0\0','order=ELR-20261102-84DE943C method=cod','2026-11-02 11:05:41'),(30,'order_created','customer','test@example.com','\0\0','order=ELR-20261102-2D2346E6 method=stripe','2026-11-02 11:06:01'),(31,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=6 max=5','2026-11-02 11:06:25'),(32,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=7 max=5','2026-11-02 11:06:38'),(33,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=8 max=5','2026-11-02 11:06:48'),(34,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=9 max=5','2026-11-02 11:08:01'),(35,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=10 max=5','2026-11-02 11:08:02'),(36,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=11 max=5','2026-11-02 11:08:12'),(37,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=12 max=5','2026-11-02 11:14:23'),(38,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=13 max=5','2026-11-02 11:14:43'),(39,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=14 max=5','2026-11-02 11:16:23'),(40,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=15 max=5','2026-11-02 11:16:24'),(41,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=16 max=5','2026-11-02 11:16:25'),(42,'bucket_limited','system','checkout:127.0.0.1','\0\0','key=checkout:127.0.0.1 hits=17 max=5','2026-11-02 11:16:25'),(43,'order_created','customer','test@example.com','\0\0','order=ELR-20261102-78816D9A method=mollie','2026-11-02 11:33:48'),(44,'order_created','customer','test@example.com','\0\0','order=ELR-20261102-682BC332 method=paypal','2026-11-02 12:13:36'),(45,'order_created','customer','test@example.com','\0\0','order=ELR-20261102-9CCC6768 method=cod','2026-11-02 13:52:05'),(46,'order_created','customer','test@example.com','\0\0','order=ELR-20261102-897876B6 method=paypal','2026-11-02 13:52:46'),(47,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 14:20:20'),(48,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 14:20:46'),(49,'order_created','customer','test@example.com','\0\0','order=ELR-20261102-8BEE2359 method=paypal','2026-11-02 15:47:56'),(50,'csrf_fail','system','','\0\0','/tesvisco-store/backend/public/api/cart/add','2026-11-02 17:33:18'),(51,'login_failed','customer','test@example.com','\0\0','bad credentials','2026-11-02 18:14:14'),(52,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 18:14:24'),(53,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 18:18:47'),(54,'login_success','customer','test@example.com','\0\0','user_id=1','2026-11-02 18:18:48'),(55,'order_created','customer','test@example.com','\0\0','order=ELR-20261102-9B309EED method=paypal','2026-11-02 18:22:25');
/*!40000 ALTER TABLE `security_logs` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `static_pages`
--

DROP TABLE IF EXISTS `static_pages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `static_pages` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(120) NOT NULL,
  `title` varchar(200) NOT NULL,
  `body_html` longtext NOT NULL,
  `meta_title` varchar(200) NOT NULL DEFAULT '',
  `meta_description` varchar(300) NOT NULL DEFAULT '',
  `is_published` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `static_pages`
--

LOCK TABLES `static_pages` WRITE;
/*!40000 ALTER TABLE `static_pages` DISABLE KEYS */;
INSERT INTO `static_pages` VALUES (1,'about','About Us','<p>We are Elroi Foods.</p>','','',1,'2026-11-03 15:49:13','2026-11-03 15:49:13'),(2,'contact','Contact Us','<p>Email: support@elroifoods.example</p>','','',1,'2026-11-03 15:49:13','2026-11-03 15:49:13'),(3,'privacy','Privacy Policy','<p>Your privacy matters.</p>','','',1,'2026-11-03 15:49:13','2026-11-03 15:49:13'),(4,'terms','Terms of Service','<p>Terms of service.</p>','','',1,'2026-11-03 15:49:13','2026-11-03 15:49:13'),(5,'shipping','Shipping Policy','<p>Shipping info.</p>','','',1,'2026-11-03 15:49:13','2026-11-03 15:49:13'),(6,'returns','Returns Policy','<p>Returns info.</p>','','',1,'2026-11-03 15:49:13','2026-11-03 15:49:13');
/*!40000 ALTER TABLE `static_pages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(191) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `first_name` varchar(80) NOT NULL DEFAULT '',
  `last_name` varchar(80) NOT NULL DEFAULT '',
  `phone` varchar(30) NOT NULL DEFAULT '',
  `email_verified` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `loyalty_points` int(11) NOT NULL DEFAULT 0,
  `referral_code` varchar(20) DEFAULT NULL,
  `referred_by` bigint(20) unsigned DEFAULT NULL,
  `referred_by_code` varchar(20) DEFAULT NULL,
  `last_login_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_users_email` (`email`),
  UNIQUE KEY `uq_users_refcode` (`referral_code`),
  KEY `idx_users_referred` (`referred_by`),
  CONSTRAINT `fk_users_referred` FOREIGN KEY (`referred_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'test@example.com','$2y$10$H3ZdFyR6epvE5FdNMg9ob.xw2hxzwV15HoWwF.PVq7.MTvpWHK8aS','Test','User','',0,1,296,'2FB199B878',NULL,NULL,'2026-11-02 18:18:48','2026-10-31 11:46:14','2026-11-02 18:22:10'),(2,'welcome@example.com','$2y$10$mlpqtKn951Kr9aP2s27im.HZJ/bm1OY/AiFCI1umCngT9KYBUw7V2','Test','Welcome','',0,1,0,'DC358C2F49',NULL,NULL,NULL,'2026-11-02 10:18:05','2026-11-02 10:18:05'),(3,'newuser@example.com','$2y$10$xcZOC6GzunEKbw8xeFTBSehiGkV7T1nJOXuNo8EboxzqLTK5Vbw8u','New','User','',0,1,0,'D260F85E22',NULL,NULL,NULL,'2026-11-02 10:26:05','2026-11-02 10:26:05'),(4,'newuser2@example.com','$2y$10$w6dJ3rxKTgY.mFc6qrxlIuFYkIczJ0eAV6/7gKZqD7txqxeuVMale','New','User2','',0,1,0,'671DC0BFC4',NULL,NULL,NULL,'2026-11-02 10:27:26','2026-11-02 10:27:26');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `website_settings`
--

DROP TABLE IF EXISTS `website_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `website_settings` (
  `setting_key` varchar(80) NOT NULL,
  `setting_value` longtext NOT NULL,
  `is_secret` tinyint(1) NOT NULL DEFAULT 0,
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`setting_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `website_settings`
--

LOCK TABLES `website_settings` WRITE;
/*!40000 ALTER TABLE `website_settings` DISABLE KEYS */;
INSERT INTO `website_settings` VALUES ('bank_transfer_details','',0,'2026-11-02 12:09:14'),('bank_transfer_enabled','0',0,'2026-11-02 12:09:14'),('checkout_throttle_enabled','1',0,'2026-11-02 11:31:20'),('checkout_throttle_max','5',0,'2026-11-02 11:31:20'),('checkout_throttle_window','3600',0,'2026-11-02 11:31:20'),('cod_enabled','1',0,'2026-11-02 12:02:37'),('collection_enabled','0',0,'2026-11-02 10:32:10'),('coupon_throttle_enabled','1',0,'2026-11-02 11:31:20'),('currency_code','GBP',0,'2026-10-30 15:44:33'),('currency_symbol','£',0,'2026-10-30 15:44:33'),('default_delivery_fee','5',0,'2026-10-30 15:44:33'),('express_delivery_enabled','0',0,'2026-11-02 10:32:10'),('free_delivery_threshold','20',0,'2026-10-30 15:44:33'),('google_analytics_id','',0,'2026-11-04 06:52:05'),('google_maps_api_key','',0,'2026-11-04 06:52:05'),('google_site_verification','',0,'2026-11-04 06:52:05'),('guest_lookup_enabled','1',0,'2026-11-02 10:32:10'),('login_throttle_enabled','1',0,'2026-11-02 11:31:20'),('login_throttle_max','',0,'2026-11-04 06:52:14'),('login_throttle_window','',0,'2026-11-04 06:52:14'),('loyalty_earn_ratio','5',0,'2026-11-02 10:32:10'),('loyalty_enabled','1',0,'2026-11-02 10:32:10'),('loyalty_min_redeem','500',0,'2026-11-02 10:32:10'),('loyalty_redeem_value','100',0,'2026-11-02 10:32:10'),('mail_enabled','0',0,'2026-10-31 11:39:58'),('mail_from_address','noreply@elroifoods.example',0,'2026-10-31 11:39:58'),('mail_from_name','Elroi Foods',0,'2026-10-31 11:39:58'),('mollie_api_key','',1,'2026-11-02 12:09:14'),('mollie_enabled','0',0,'2026-11-02 12:02:37'),('mollie_profile_id','',0,'2026-11-02 12:09:14'),('paypal_client_id','AR6A4uBqsCNJ34zu5KQrTglbi5u8WcFn5CuV4UbQsflRP4iq_gOmoP-9xNVUwtP880dZ4odP-DP2TSe3',0,'2026-11-02 12:12:20'),('paypal_enabled','1',0,'2026-11-02 12:12:37'),('paypal_sandbox','1',0,'2026-11-02 12:09:14'),('paypal_secret','EDdnCRxAGHBflIre_fb3Sis7TWaiQhFZZxORUn2-tbc-40z3SPOCsSdvIm6WQ9riHScZYq8S_ouOlgKI',1,'2026-11-02 12:12:30'),('product_og_image','',0,'2026-11-02 10:07:40'),('recently_viewed_enabled','1',0,'2026-11-02 10:32:10'),('referral_enabled','1',0,'2026-11-02 10:32:10'),('referral_referred_reward','5.00',0,'2026-11-02 10:32:10'),('referral_referrer_reward','10.00',0,'2026-11-02 10:32:10'),('register_throttle_enabled','1',0,'2026-11-02 11:31:20'),('review_throttle_enabled','1',0,'2026-11-02 11:31:20'),('reviews_auto_approve_verified','1',0,'2026-11-02 10:32:10'),('scheduled_delivery_enabled','1',0,'2026-11-02 10:32:10'),('share_channels','copy,whatsapp,facebook,x,email',0,'2026-11-02 10:07:40'),('share_enabled','1',0,'2026-11-02 10:07:40'),('site_name','Elroi Foods',0,'2026-10-30 14:51:34'),('site_tagline','African & International',0,'2026-10-30 14:51:34'),('site_url','http://localhost:5173',0,'2026-11-02 10:07:40'),('smtp_encryption','tls',0,'2026-11-02 10:07:40'),('smtp_host','smtp.mailtrap.io',0,'2026-11-02 10:07:40'),('smtp_password','',1,'2026-11-02 10:07:40'),('smtp_port','587',0,'2026-11-02 10:07:40'),('smtp_username','',0,'2026-11-02 10:07:40'),('social_facebook','',0,'2026-11-04 06:51:53'),('social_instagram','',0,'2026-11-04 06:51:53'),('social_linkedin','',0,'2026-11-04 06:51:53'),('social_tiktok','',0,'2026-11-04 06:51:53'),('social_twitter','',0,'2026-11-04 06:51:53'),('social_youtube','',0,'2026-11-04 06:51:53'),('square_access_token','',1,'2026-11-02 12:09:14'),('square_application_id','',0,'2026-11-02 12:09:14'),('square_enabled','0',0,'2026-11-02 12:02:37'),('square_environment','sandbox',0,'2026-11-02 12:09:14'),('square_location_id','',0,'2026-11-02 12:09:14'),('stripe_enabled','1',0,'2026-11-02 12:05:47'),('stripe_publishable_key','',0,'2026-11-02 12:02:37'),('stripe_secret_key','',1,'2026-11-02 12:09:14'),('stripe_webhook_secret','',1,'2026-11-02 12:09:14'),('support_email','support@elroifoods.example',0,'2026-10-30 14:51:34'),('whatsapp_number','',0,'2026-10-30 14:51:34');
/*!40000 ALTER TABLE `website_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wishlist_items`
--

DROP TABLE IF EXISTS `wishlist_items`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wishlist_items` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `wishlist_id` bigint(20) unsigned NOT NULL,
  `product_id` bigint(20) unsigned NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_wli` (`wishlist_id`,`product_id`),
  KEY `wli_fk_p` (`product_id`),
  CONSTRAINT `wli_fk_p` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `wli_fk_wl` FOREIGN KEY (`wishlist_id`) REFERENCES `wishlists` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wishlist_items`
--

LOCK TABLES `wishlist_items` WRITE;
/*!40000 ALTER TABLE `wishlist_items` DISABLE KEYS */;
INSERT INTO `wishlist_items` VALUES (1,3,17,'2026-10-31 12:12:58');
/*!40000 ALTER TABLE `wishlist_items` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wishlists`
--

DROP TABLE IF EXISTS `wishlists`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wishlists` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `wish_token` char(64) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_wl_user` (`user_id`),
  UNIQUE KEY `uq_wl_token` (`wish_token`),
  CONSTRAINT `wl_fk_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wishlists`
--

LOCK TABLES `wishlists` WRITE;
/*!40000 ALTER TABLE `wishlists` DISABLE KEYS */;
INSERT INTO `wishlists` VALUES (1,NULL,'f42a729ae92002ca62308dadf831dd79d8a20b62b80a4750b862324890f28c6b','2026-10-31 12:09:45'),(2,NULL,'2db531ba7b4247f438c7cb3f4c4f8f8553478af87f2d8976111a8b1fba350a50','2026-10-31 12:09:46'),(3,1,NULL,'2026-10-31 12:12:47'),(4,NULL,'ca9048c1e8e755072e0d98baade42fb0618243e54aa252d271a7a84226f07e7f','2026-10-31 12:59:50'),(5,NULL,'b1dd2b8bd8c38c567cdaef296d549a1ac931c76c5918cc5e1b8b2edca94e55ee','2026-10-31 20:44:57'),(6,NULL,'b81e2947fa24a0440356fac3be14c94f59c69a79a4a81dcc2e4d1c332e25d33d','2026-10-31 20:44:57');
/*!40000 ALTER TABLE `wishlists` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-11-04  6:53:20
