--
-- Host: localhost    Database: pizzaria_pro
-- ------------------------------------------------------


--
-- Table structure for table `cash_movements`
--

CREATE TABLE `cash_movements` (
  `id` int NOT NULL AUTO_INCREMENT,
  `cash_register_id` int DEFAULT NULL,
  `user_name` varchar(50) DEFAULT NULL,
  `type` varchar(10) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `description` text,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `cash_register_id` (`cash_register_id`),
  CONSTRAINT `cash_movements_ibfk_1` FOREIGN KEY (`cash_register_id`) REFERENCES `cash_register` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `cash_movements`
--

INSERT INTO `cash_movements` VALUES (1,3,'admin','in',1000.00,'GOJETA','2026-01-24 11:08:33'),(2,3,'admin','out',2000.00,'FECHAMENTO CAIXA','2026-01-24 11:09:21'),(3,5,'admin','out',100.00,'admin','2026-01-24 22:48:34'),(4,5,'admin','in',100.00,'admin','2026-01-24 22:48:47');

--
-- Table structure for table `cash_register`
--

CREATE TABLE `cash_register` (
  `id` int NOT NULL AUTO_INCREMENT,
  `opened_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `closed_at` timestamp NULL DEFAULT NULL,
  `start_money` decimal(10,2) DEFAULT '0.00',
  `total_sales` decimal(10,2) DEFAULT '0.00',
  `status` varchar(10) DEFAULT 'open',
  `opened_by_user` varchar(50) DEFAULT NULL,
  `closed_by_user` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `cash_register`
--

INSERT INTO `cash_register` VALUES (1,'2026-01-24 10:33:06','2026-01-24 10:35:55',100.00,0.00,'closed',NULL,NULL),(2,'2026-01-24 10:36:06','2026-01-24 10:53:30',100.00,0.00,'closed',NULL,NULL),(3,'2026-01-24 11:06:12','2026-01-24 11:09:29',2000.00,1000.00,'closed','admin','admin'),(4,'2026-01-24 11:16:35','2026-01-24 18:39:52',1000.00,1000.00,'closed','admin','admin'),(5,'2026-01-24 18:54:05','2026-01-24 22:49:12',100.00,0.00,'closed','admin','admin'),(6,'2026-01-24 22:49:21',NULL,491.00,0.00,'open','admin',NULL);

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

CREATE TABLE `categories` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `categories` VALUES (1,'Pizzas Salgadas'),(2,'Pizzas Doces'),(3,'Bebidas'),(4,'hambuguer'),(5,'bebidas');

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

CREATE TABLE `coupons` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(20) DEFAULT NULL,
  `discount_percent` int DEFAULT NULL,
  `active` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `coupons` VALUES (2,'PIZZA10',5,1),(4,'PIZZA100',10,1),(5,'PIZZA101',2,1);

--
-- Table structure for table `ingredients`
--

CREATE TABLE `ingredients` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `quantity` decimal(10,3) DEFAULT '0.000',
  `unit` varchar(20) DEFAULT 'kg',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `ingredients`
--

INSERT INTO `ingredients` VALUES (1,'Mussarela',5.000,'kg'),(2,'salame',7.000,'kg'),(3,'Mussarela',2.000,'un');

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

CREATE TABLE `orders` (
  `id` int NOT NULL AUTO_INCREMENT,
  `customer_name` varchar(100) DEFAULT NULL,
  `total` decimal(10,2) DEFAULT NULL,
  `status` varchar(20) DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `items` text,
  `address` text,
  `payment_method` varchar(50) DEFAULT NULL,
  `cart_json` json DEFAULT NULL,
  `driver_id` int DEFAULT NULL,
  `discount` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `orders` VALUES (1,'Cliente Site',204.50,'completed','2026-01-24 10:14:03','1x gfdgfd | 1x Chocolate com Morango | 1x Portuguesa | 1x Portuguesa | 1x Pepperoni | ','rua paraiba 257 cidade sao  jorge','Pix',NULL,NULL,0.00),(2,'Cliente Site',124.70,'completed','2026-01-24 10:34:39','1x gfdgfd | 1x Chocolate com Morango | 1x Portuguesa | ','rua paraiba 257','Pix',NULL,NULL,0.00),(3,'Cliente Site',84.80,'completed','2026-01-24 10:40:27','1x gfdgfd | 1x gfdgfd | ','rua paraiba 257 cidade sao  jorge','Pix',NULL,NULL,0.00),(4,'Cliente Site',84.80,'completed','2026-01-24 10:50:31','1x gfdgfd | 1x Chocolate com Morango | ','RUA PARAIBA 257 CIDADE SAO  JORGE','Dinheiro',NULL,NULL,0.00),(5,'Cliente Site',164.60,'completed','2026-01-24 11:07:15','1x gfdgfd | 1x Chocolate com Morango | 1x Portuguesa | 1x Pepperoni | ','RUA PAREIBA 257 CIDADE SAO  JORGE','Pix','[{\"q\": 1, \"id\": 6, \"obs\": \"\", \"c_id\": 2, \"name\": \"gfdgfd\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742df01984f.jpg\", \"category_id\": 2, \"description\": \"hgfhfghf\"}, {\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"category_id\": 1, \"description\": \"fsdfsdfs\"}, {\"q\": 1, \"id\": 2, \"obs\": \"\", \"c_id\": 1, \"name\": \"Pepperoni\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/6974204855856.jpg\", \"category_id\": 1, \"description\": \"Molho de tomate, mozzarella, pepperoni crocante e orégano\"}]',NULL,0.00),(6,'Cliente Site',214.50,'completed','2026-01-24 11:13:54','1x Chocolate com Morango | 1x Portuguesa | 1x Chocolate com Morango | 1x Portuguesa | 1x Pepperoni | 1x Produto Teste | ','RUA PARIABA 257 CIDADE SAO  JORGE','Pix','[{\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"category_id\": 1, \"description\": \"fsdfsdfs\"}, {\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 3, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/697420b82d368.jpg\", \"category_id\": 1, \"description\": \"Molho de tomate, presunto, ovos, cebola, azeitonas e mozzarella\"}, {\"q\": 1, \"id\": 2, \"obs\": \"\", \"c_id\": 1, \"name\": \"Pepperoni\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/6974204855856.jpg\", \"category_id\": 1, \"description\": \"Molho de tomate, mozzarella, pepperoni crocante e orégano\"}, {\"q\": 1, \"id\": 1, \"obs\": \"\", \"c_id\": 1, \"name\": \"Produto Teste\", \"price\": \"10.00\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69741fb5bc578.jpg\", \"category_id\": 1, \"description\": \"Se você vê isso, o banco está ok\"}]',NULL,0.00),(7,'Cliente Site',164.60,'completed','2026-01-24 11:15:11','1x gfdgfd | 1x Chocolate com Morango | 1x Chocolate com Morango | 1x Portuguesa | ','RUA PARAIBA 257 CIDADE SAO JORGE','Pix','[{\"q\": 1, \"id\": 6, \"obs\": \"\", \"c_id\": 2, \"name\": \"gfdgfd\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742df01984f.jpg\", \"category_id\": 2, \"description\": \"hgfhfghf\"}, {\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"category_id\": 1, \"description\": \"fsdfsdfs\"}]',NULL,0.00),(8,'Cliente Site',164.60,'completed','2026-01-24 13:12:15','1x gfdgfd | 1x Chocolate com Morango | 1x Portuguesa | 1x Portuguesa | ','rua paraiba  257 cidade sao  jorge','Pix','[{\"q\": 1, \"id\": 6, \"obs\": \"\", \"c_id\": 2, \"name\": \"gfdgfd\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742df01984f.jpg\", \"category_id\": 2, \"description\": \"hgfhfghf\"}, {\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"category_id\": 1, \"description\": \"fsdfsdfs\"}, {\"q\": 1, \"id\": 3, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/697420b82d368.jpg\", \"category_id\": 1, \"description\": \"Molho de tomate, presunto, ovos, cebola, azeitonas e mozzarella\"}]',NULL,0.00),(9,'Cliente Site',124.70,'completed','2026-01-24 13:26:04','1x gfdgfd | 1x Chocolate com Morango | 1x Portuguesa | ','rua paraiba  257 cidade sao  jorge santo andre','Pix','[{\"q\": 1, \"id\": 6, \"obs\": \"\", \"c_id\": 2, \"name\": \"gfdgfd\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742df01984f.jpg\", \"category_id\": 2, \"description\": \"hgfhfghf\"}, {\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"category_id\": 1, \"description\": \"fsdfsdfs\"}]',NULL,0.00),(10,'Cliente Site',164.60,'completed','2026-01-24 13:29:55','1x gfdgfd | 1x Chocolate com Morango | 1x Portuguesa | 1x Chocolate com Morango | ','RUA PARAIBA  257 CIDADE SAO  JORGE SANTO ANDRE','Pix','[{\"q\": 1, \"id\": 6, \"obs\": \"\", \"c_id\": 2, \"name\": \"gfdgfd\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742df01984f.jpg\", \"category_id\": 2, \"description\": \"hgfhfghf\"}, {\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"category_id\": 1, \"description\": \"fsdfsdfs\"}, {\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}]',NULL,0.00),(11,'Cliente Site',124.70,'completed','2026-01-24 15:30:31','1x gfdgfd | 1x Chocolate com Morango | 1x Pepperoni | ','Rua Paraíba 257 cidade são Jorge santo andre','Pix','[{\"q\": 1, \"id\": 6, \"obs\": \"\", \"c_id\": 2, \"name\": \"gfdgfd\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742df01984f.jpg\", \"category_id\": 2, \"description\": \"hgfhfghf\"}, {\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 2, \"obs\": \"\", \"c_id\": 1, \"name\": \"Pepperoni\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/6974204855856.jpg\", \"category_id\": 1, \"description\": \"Molho de tomate, mozzarella, pepperoni crocante e orégano\"}]',NULL,0.00),(12,'ALEXANDRE SANTORO',84.80,'completed','2026-01-24 19:12:07','1x Portuguesa (SEM CEBOLA) | 1x Portuguesa (NAO QUERO OVO) | ','RUA PARAIBA  257 CIDADE SAO  JORGE SANTO ANDRE','Pix','[{\"q\": 1, \"id\": 3, \"obs\": \"SEM CEBOLA\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/697420b82d368.jpg\", \"category_id\": 1, \"description\": \"Molho de tomate, presunto, ovos, cebola, azeitonas e mozzarella\"}, {\"q\": 1, \"id\": 5, \"obs\": \"NAO QUERO OVO\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"category_id\": 1, \"description\": \"fsdfsdfs\"}]',NULL,0.00),(13,'Alexandre santoro',124.70,'completed','2026-01-24 20:13:08','1x Chocolate com Morango | 1x Portuguesa | 1x Portuguesa | ','Av Mário de Andrade 203 apto 03 condomínio Maracanã ','Pix','[{\"q\": 1, \"id\": 4, \"obs\": \"\", \"c_id\": 1, \"name\": \"Chocolate com Morango\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742176c4edc.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"Chocolate ao leite, morangos frescos e chocolate branco\"}, {\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"fsdfsdfs\"}, {\"q\": 1, \"id\": 3, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/697420b82d368.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"Molho de tomate, presunto, ovos, cebola, azeitonas e mozzarella\"}]',3,0.00),(14,'ALEXANDRE SANTORO',84.80,'completed','2026-01-24 20:49:33','1x gfdgfd | 1x Portuguesa | ','rua pariaba  257','Pix','[{\"q\": 1, \"id\": 6, \"obs\": \"\", \"c_id\": 2, \"name\": \"gfdgfd\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 1, \"image_url\": \"uploads/69742df01984f.jpg\", \"allow_half\": 1, \"category_id\": 2, \"description\": \"hgfhfghf\"}, {\"q\": 1, \"id\": 3, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": \"39.90\", \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/697420b82d368.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"Molho de tomate, presunto, ovos, cebola, azeitonas e mozzarella\"}]',5,0.00),(15,'ALEXANDRE SANTORO',76.32,'completed','2026-01-24 21:43:24','1x Portuguesa | 1x Portuguesa | ','av  mario de andrade 203 condominio maracana santoro andre','Cartão','[{\"q\": 1, \"id\": 3, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": 39.9, \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/697420b82d368.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"Molho de tomate, presunto, ovos, cebola, azeitonas e mozzarella\"}, {\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": 39.9, \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"fsdfsdfs\"}]',5,8.48),(16,'ALEXANDRE SANTORO',76.32,'completed','2026-01-24 22:01:20','1x Portuguesa (sem cebola) | 1x Portuguesa | ','av  mario de andrade 203 condominio maracana santoro andre','Cartão','[{\"q\": 1, \"id\": 5, \"obs\": \"sem cebola\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": 39.9, \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"fsdfsdfs\"}, {\"q\": 1, \"id\": 3, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": 39.9, \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/697420b82d368.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"Molho de tomate, presunto, ovos, cebola, azeitonas e mozzarella\"}]',5,8.48),(17,'daiane',44.90,'completed','2026-01-24 22:08:11','1x Portuguesa | ','sergio buarque 493','Pix','[{\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": 39.9, \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"fsdfsdfs\"}]',5,0.00),(18,'ALEXANDRE SANTORO',112.23,'completed','2026-01-24 23:22:13','1x gfdgfd | 1x Portuguesa | 1x Portuguesa | ','rua  paraiba 257 cidade sao  jorgr','Pix','[{\"q\": 1, \"id\": 6, \"obs\": \"\", \"c_id\": 1, \"name\": \"gfdgfd\", \"price\": 39.9, \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69755338cda50.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"hgfhfghf\"}, {\"q\": 1, \"id\": 7, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": 39.9, \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/6975533245eb0.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"\"}, {\"q\": 1, \"id\": 5, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": 39.9, \"active\": 1, \"is_promo\": 0, \"image_url\": \"uploads/69742c400157c.jpg\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"fsdfsdfs\"}]',5,12.47),(19,'ALEXANDRE SANTORO',124.70,'completed','2026-01-24 23:30:16','3x Portuguesa | ','rua paraiba  257','Pix','[{\"q\": 3, \"id\": 7, \"obs\": \"\", \"c_id\": 1, \"name\": \"Portuguesa\", \"price\": 39.9, \"active\": 1, \"is_promo\": 0, \"image_url\": \"\", \"allow_half\": 1, \"category_id\": 1, \"description\": \"\"}]',5,0.00);

--
-- Table structure for table `product_ingredients`
--

CREATE TABLE `product_ingredients` (
  `product_id` int DEFAULT NULL,
  `ingredient_id` int DEFAULT NULL,
  `quantity` decimal(10,3) DEFAULT NULL,
  KEY `product_id` (`product_id`),
  KEY `ingredient_id` (`ingredient_id`),
  CONSTRAINT `product_ingredients_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  CONSTRAINT `product_ingredients_ibfk_2` FOREIGN KEY (`ingredient_id`) REFERENCES `ingredients` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `product_ingredients`
--

INSERT INTO `product_ingredients` VALUES (3,1,0.200),(4,1,200.000),(7,2,1.000);

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

CREATE TABLE `products` (
  `id` int NOT NULL AUTO_INCREMENT,
  `category_id` int DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `description` text,
  `price` decimal(10,2) DEFAULT NULL,
  `image_url` text,
  `is_promo` tinyint(1) DEFAULT '0',
  `active` tinyint(1) DEFAULT '1',
  `allow_half` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `category_id` (`category_id`),
  CONSTRAINT `products_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `products` VALUES (1,1,'Produto Teste','Se você vê isso, o banco está ok',10.00,'uploads/69755095ed5b9.jpg',0,1,1),(2,NULL,'Pepperoni','Molho de tomate, mozzarella, pepperoni crocante e orégano',39.90,'uploads/69754e9969ea5.jpg',0,1,1),(3,NULL,'Portuguesa','Molho de tomate, presunto, ovos, cebola, azeitonas e mozzarella',39.90,'uploads/69754ea3c2969.jpg',0,1,1),(4,2,'Chocolate com Morango','Chocolate ao leite, morangos frescos e chocolate branco',39.90,'uploads/69755356555c6.jpg',0,1,1),(5,1,'Portuguesa','fsdfsdfs',39.90,'uploads/69742c400157c.jpg',0,1,1),(6,1,'gfdgfd','hgfhfghf',39.90,'uploads/69755338cda50.jpg',0,1,1),(7,1,'Portuguesa','',39.90,'',0,1,1);

--
-- Table structure for table `stock_items`
--

CREATE TABLE `stock_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `unit` varchar(10) DEFAULT 'un',
  `quantity` decimal(10,3) DEFAULT '0.000',
  `min_quantity` decimal(10,3) DEFAULT '5.000',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `stock_items`
--

INSERT INTO `stock_items` VALUES (1,'Mussarela','g',30.000,10.000),(2,'caixa de pizza','un',100.000,10.000);

--
-- Table structure for table `store_config`
--

CREATE TABLE `store_config` (
  `id` int NOT NULL DEFAULT '1',
  `store_name` varchar(100) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `delivery_fee` decimal(10,2) DEFAULT NULL,
  `min_order` decimal(10,2) DEFAULT NULL,
  `address` text,
  `is_open` tinyint(1) DEFAULT '1',
  `time_open` varchar(5) DEFAULT '18:00',
  `time_close` varchar(5) DEFAULT '23:00',
  `accept_pix` tinyint(1) DEFAULT '1',
  `accept_card` tinyint(1) DEFAULT '1',
  `accept_cash` tinyint(1) DEFAULT '1',
  `email` varchar(100) DEFAULT NULL,
  `auto_accept` tinyint(1) DEFAULT '0',
  `printer_width` int DEFAULT '80',
  `logo_url` varchar(255) DEFAULT NULL,
  `theme_color` varchar(20) DEFAULT '#DC2626',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `store_config`
--

INSERT INTO `store_config` VALUES (1,'DonLorenzo','5511979577190',5.00,30.00,'av mario de andre n 203, apto 03, santo andre, sao apulo, 09131200, BR',1,'18:00','23:00',1,1,1,'',1,80,'uploads/logo_1769289580.jpg','#dc2626');


