-- MySQL dump 10.13  Distrib 5.7.41, for Linux (x86_64)
--
-- Host: localhost    Database: marketplacebe
-- ------------------------------------------------------
-- Server version	5.7.41

/*!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 utf8 */;
/*!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 `orders`
--

DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orders` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_number` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `billing_address_id` int(10) unsigned NOT NULL,
  `shipping_address_id` int(10) unsigned NOT NULL,
  `shipping_charge` double(8,2) NOT NULL DEFAULT '0.00',
  `store_id` int(10) unsigned NOT NULL,
  `order_status` int(11) NOT NULL DEFAULT '0' COMMENT '0=>new,1=>processed,2=>ready to pick,3=>dispatched,4=>delivered,5=>cancelled,6=>return-initiated,7=>returned',
  `payment_status` int(11) NOT NULL DEFAULT '0' COMMENT '0=>pending, 1=>payment-initiated, 2=>paid, 3=>payment-cancelled',
  `payment_method` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `courier_shipping_id` bigint(20) unsigned DEFAULT NULL,
  `tracking_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `courier_id` int(10) unsigned DEFAULT NULL,
  `currency_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vat_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sub_total_inc_tax` double(8,2) NOT NULL,
  `sub_total_exc_tax` double(8,2) NOT NULL,
  `sub_total_discount_inc_tax` double(8,2) NOT NULL,
  `sub_total_discount_exc_tax` double(8,2) NOT NULL,
  `order_tax` double(8,2) NOT NULL,
  `order_discount` double(8,2) NOT NULL,
  `order_total_amount` double(8,2) NOT NULL,
  `order_by` int(10) unsigned NOT NULL,
  `total_item` int(11) NOT NULL,
  `seen_status` int(11) NOT NULL DEFAULT '0' COMMENT '0=>unseen, 1=>seen',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `orders_billing_address_id_foreign` (`billing_address_id`),
  KEY `orders_shipping_address_id_foreign` (`shipping_address_id`),
  KEY `orders_store_id_foreign` (`store_id`),
  KEY `orders_order_by_foreign` (`order_by`),
  KEY `orders_courier_id_foreign` (`courier_id`),
  CONSTRAINT `orders_billing_address_id_foreign` FOREIGN KEY (`billing_address_id`) REFERENCES `customer_address` (`id`) ON DELETE CASCADE,
  CONSTRAINT `orders_courier_id_foreign` FOREIGN KEY (`courier_id`) REFERENCES `couriers` (`id`),
  CONSTRAINT `orders_order_by_foreign` FOREIGN KEY (`order_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `orders_shipping_address_id_foreign` FOREIGN KEY (`shipping_address_id`) REFERENCES `customer_address` (`id`) ON DELETE CASCADE,
  CONSTRAINT `orders_store_id_foreign` FOREIGN KEY (`store_id`) REFERENCES `entrepreneur` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=22 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 (9,'16865597242','1686559727',1,1,447.00,3,4,0,'cashondelivery',3156,'95D717AA2452425',1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,13443.00,2,2,1,'2023-06-12 08:48:44','2023-06-13 08:17:24'),(10,'16865650902','1686565093',1,1,297.00,3,4,0,'cashondelivery',3155,'284B4C5866AF4FB',1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,13243.00,2,1,1,'2023-06-12 10:18:10','2023-06-12 10:21:26'),(11,'168674098810','1686741000',6,6,99.00,12,1,0,'cashondelivery',NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,1000.00,10,1,1,'2023-06-14 11:09:48','2023-06-15 05:57:18'),(12,'168674344931','1686743461',7,7,99.00,12,0,1,NULL,NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,500.00,31,1,1,'2023-06-14 11:50:49','2023-06-15 05:53:21'),(13,'168674371731','1686743720',7,7,1043.00,3,0,0,'cashondelivery',NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,26486.00,31,1,0,'2023-06-14 11:55:17','2023-06-14 11:55:21'),(14,'168674378731','1686743790',7,7,447.00,3,0,0,'cashondelivery',NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,13243.00,31,1,0,'2023-06-14 11:56:27','2023-06-14 11:57:50'),(15,'168680673231','1686806744',8,8,2376.00,12,1,0,'cashondelivery',NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,85000.00,31,4,1,'2023-06-15 05:25:32','2023-06-18 03:26:37'),(16,'168680673231','1686806735',8,8,447.00,3,0,0,'cashondelivery',NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,13243.00,31,1,0,'2023-06-15 05:25:32','2023-06-15 05:25:35'),(17,'168680917432','1686809177',9,9,447.00,3,0,0,'cashondelivery',NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,13243.00,32,1,1,'2023-06-15 06:06:14','2023-06-15 06:06:57'),(18,'168681589132','1686815894',9,9,447.00,3,0,1,NULL,NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,13243.00,32,1,0,'2023-06-15 07:58:11','2023-06-15 07:58:11'),(19,'168682102233','1686821034',10,10,99.00,12,1,0,'cashondelivery',NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,500.00,33,1,1,'2023-06-15 09:23:42','2023-06-15 09:28:54'),(20,'168707848732','1687078490',9,9,447.00,3,2,2,'cashondelivery',3168,'C992F67897D24F6',1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,9270.10,32,1,1,'2023-06-18 08:54:47','2023-06-18 11:53:44'),(21,'168707927432','1687079286',9,9,99.00,12,0,1,NULL,NULL,NULL,1,NULL,NULL,0.00,0.00,0.00,0.00,0.00,0.00,200.00,32,1,0,'2023-06-18 09:07:54','2023-06-18 09:07:54');
/*!40000 ALTER TABLE `orders` 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 2023-06-18 17:38:53
