-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Versión del servidor:         8.4.3 - MySQL Community Server - GPL
-- SO del servidor:              Win64
-- HeidiSQL Versión:             12.8.0.6908
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!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 */;


-- Volcando estructura de base de datos para suite_saas_modas_integral
CREATE DATABASE IF NOT EXISTS `quidocom_moda` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `quidocom_moda`;

-- Volcando estructura para tabla suite_saas_modas_integral.appointments
CREATE TABLE IF NOT EXISTS `appointments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `customer_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scheduled_at` datetime NOT NULL,
  `duration_min` smallint unsigned NOT NULL DEFAULT '30',
  `status` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'scheduled',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `appointments_company_id_foreign` (`company_id`),
  KEY `appointments_customer_id_foreign` (`customer_id`),
  KEY `appointments_user_id_foreign` (`user_id`),
  CONSTRAINT `appointments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `appointments_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `appointments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.appointments: ~3 rows (aproximadamente)
DELETE FROM `appointments`;
INSERT INTO `appointments` (`id`, `company_id`, `customer_id`, `user_id`, `title`, `scheduled_at`, `duration_min`, `status`, `note`, `created_at`, `updated_at`) VALUES
	(4, 1, 17, NULL, 'Prueba de vestido de gala', '2026-07-24 16:00:00', 45, 'scheduled', NULL, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(5, 1, 15, NULL, 'Prueba de vestido de gala', '2026-07-25 16:00:00', 45, 'scheduled', NULL, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(6, 1, 12, NULL, 'Prueba de vestido de gala', '2026-07-27 16:00:00', 45, 'scheduled', NULL, '2026-07-23 14:18:24', '2026-07-23 14:18:24');

-- Volcando estructura para tabla suite_saas_modas_integral.attributes
CREATE TABLE IF NOT EXISTS `attributes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `extra` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attributes_company_id_foreign` (`company_id`),
  CONSTRAINT `attributes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.attributes: ~0 rows (aproximadamente)
DELETE FROM `attributes`;

-- Volcando estructura para tabla suite_saas_modas_integral.brands
CREATE TABLE IF NOT EXISTS `brands` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `brands_company_id_foreign` (`company_id`),
  CONSTRAINT `brands_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.brands: ~3 rows (aproximadamente)
DELETE FROM `brands`;
INSERT INTO `brands` (`id`, `company_id`, `name`, `active`, `created_at`, `updated_at`) VALUES
	(4, 1, 'Elegance', 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(5, 1, 'Urbana', 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(6, 1, 'Clásica', 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22');

-- Volcando estructura para tabla suite_saas_modas_integral.business_types
CREATE TABLE IF NOT EXISTS `business_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `accent_color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#e91e63',
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `modules` json DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `business_types_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.business_types: ~7 rows (aproximadamente)
DELETE FROM `business_types`;
INSERT INTO `business_types` (`id`, `slug`, `name`, `icon`, `accent_color`, `description`, `modules`, `active`, `created_at`, `updated_at`) VALUES
	(1, 'prendas', 'Tienda de Prendas de Vestir', 'shirt', '#e91e63', 'Ropa casual y formal, tallas y colores.', '["dashboard", "pos", "sales", "returns", "products", "categories", "inventory", "purchases", "suppliers", "transfers", "customers", "loyalty", "promotions", "cash", "expenses", "reports", "users", "settings", "variants", "collections"]', 1, '2026-07-23 14:18:13', '2026-07-23 14:18:13'),
	(2, 'calzado', 'Tienda de Calzados', 'footprints', '#ff5722', 'Calzado con numeración y modelos.', '["dashboard", "pos", "sales", "returns", "products", "categories", "inventory", "purchases", "suppliers", "transfers", "customers", "loyalty", "promotions", "cash", "expenses", "reports", "users", "settings", "shoe_sizes", "variants"]', 1, '2026-07-23 14:18:13', '2026-07-23 14:18:13'),
	(3, 'accesorios', 'Tienda de Accesorios', 'watch', '#9c27b0', 'Carteras, cinturones, gorros y más.', '["dashboard", "pos", "sales", "returns", "products", "categories", "inventory", "purchases", "suppliers", "transfers", "customers", "loyalty", "promotions", "cash", "expenses", "reports", "users", "settings", "variants"]', 1, '2026-07-23 14:18:13', '2026-07-23 14:18:13'),
	(4, 'boutique', 'Boutique de Ropas', 'gem', '#d81b60', 'Boutique premium con citas y colecciones.', '["dashboard", "pos", "sales", "returns", "products", "categories", "inventory", "purchases", "suppliers", "transfers", "customers", "loyalty", "promotions", "cash", "expenses", "reports", "users", "settings", "variants", "collections", "appointments"]', 1, '2026-07-23 14:18:13', '2026-07-23 14:18:13'),
	(5, 'joyeria', 'Tienda de Joyería', 'diamond', '#c9a227', 'Joyas de alto valor, metales y certificados.', '["dashboard", "pos", "sales", "returns", "products", "categories", "inventory", "purchases", "suppliers", "transfers", "customers", "loyalty", "promotions", "cash", "expenses", "reports", "users", "settings", "materials", "certificates", "repairs", "insurance"]', 1, '2026-07-23 14:18:13', '2026-07-23 14:18:13'),
	(6, 'bisuteria', 'Tienda de Bisutería', 'sparkles', '#00bcd4', 'Bisutería y accesorios de fantasía.', '["dashboard", "pos", "sales", "returns", "products", "categories", "inventory", "purchases", "suppliers", "transfers", "customers", "loyalty", "promotions", "cash", "expenses", "reports", "users", "settings", "materials", "variants"]', 1, '2026-07-23 14:18:13', '2026-07-23 14:18:13'),
	(7, 'deportiva', 'Tienda de Ropas Deportivas', 'activity', '#43a047', 'Indumentaria y calzado deportivo.', '["dashboard", "pos", "sales", "returns", "products", "categories", "inventory", "purchases", "suppliers", "transfers", "customers", "loyalty", "promotions", "cash", "expenses", "reports", "users", "settings", "variants", "collections", "shoe_sizes"]', 1, '2026-07-23 14:18:13', '2026-07-23 14:18:13');

-- Volcando estructura para tabla suite_saas_modas_integral.cash_movements
CREATE TABLE IF NOT EXISTS `cash_movements` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cash_session_id` bigint unsigned NOT NULL,
  `company_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `concept` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cash_movements_cash_session_id_foreign` (`cash_session_id`),
  KEY `cash_movements_company_id_foreign` (`company_id`),
  KEY `cash_movements_user_id_foreign` (`user_id`),
  CONSTRAINT `cash_movements_cash_session_id_foreign` FOREIGN KEY (`cash_session_id`) REFERENCES `cash_sessions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `cash_movements_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `cash_movements_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.cash_movements: ~0 rows (aproximadamente)
DELETE FROM `cash_movements`;

-- Volcando estructura para tabla suite_saas_modas_integral.cash_sessions
CREATE TABLE IF NOT EXISTS `cash_sessions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `opening_amount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `cash_sales` decimal(12,2) NOT NULL DEFAULT '0.00',
  `incomes` decimal(12,2) NOT NULL DEFAULT '0.00',
  `expenses` decimal(12,2) NOT NULL DEFAULT '0.00',
  `expected_amount` decimal(12,2) DEFAULT NULL,
  `closing_amount` decimal(12,2) DEFAULT NULL,
  `difference` decimal(12,2) DEFAULT NULL,
  `status` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `opened_at` timestamp NULL DEFAULT NULL,
  `closed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cash_sessions_company_id_foreign` (`company_id`),
  KEY `cash_sessions_user_id_foreign` (`user_id`),
  CONSTRAINT `cash_sessions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `cash_sessions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.cash_sessions: ~0 rows (aproximadamente)
DELETE FROM `cash_sessions`;

-- Volcando estructura para tabla suite_saas_modas_integral.categories
CREATE TABLE IF NOT EXISTS `categories` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `categories_company_id_foreign` (`company_id`),
  CONSTRAINT `categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.categories: ~6 rows (aproximadamente)
DELETE FROM `categories`;
INSERT INTO `categories` (`id`, `company_id`, `name`, `description`, `active`, `created_at`, `updated_at`) VALUES
	(6, 2, 'Anillos', NULL, 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(7, 1, 'Vestidos', NULL, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(8, 1, 'Blusas', NULL, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(9, 1, 'Pantalones', NULL, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(10, 1, 'Abrigos', NULL, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(11, 1, 'Accesorios', NULL, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22');

-- Volcando estructura para tabla suite_saas_modas_integral.certificates
CREATE TABLE IF NOT EXISTS `certificates` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `customer_id` bigint unsigned DEFAULT NULL,
  `product_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'certificate',
  `item_description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `material` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weight` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `appraisal_value` decimal(12,2) DEFAULT NULL,
  `issued_at` date DEFAULT NULL,
  `expires_at` date DEFAULT NULL,
  `terms` text COLLATE utf8mb4_unicode_ci,
  `status` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `certificates_company_id_foreign` (`company_id`),
  KEY `certificates_customer_id_foreign` (`customer_id`),
  KEY `certificates_product_id_foreign` (`product_id`),
  KEY `certificates_user_id_foreign` (`user_id`),
  CONSTRAINT `certificates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `certificates_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `certificates_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL,
  CONSTRAINT `certificates_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.certificates: ~2 rows (aproximadamente)
DELETE FROM `certificates`;
INSERT INTO `certificates` (`id`, `company_id`, `customer_id`, `product_id`, `user_id`, `number`, `type`, `item_description`, `material`, `weight`, `appraisal_value`, `issued_at`, `expires_at`, `terms`, `status`, `created_at`, `updated_at`) VALUES
	(1, 2, 9, NULL, 3, 'CERT-000001', 'certificate', 'Anillo de compromiso oro blanco 18k con diamante 0.5ct', 'Oro blanco 18k', '4.2 g / 0.5 ct', 3200.00, '2026-07-18', NULL, 'Se certifica la autenticidad del material y la piedra según análisis gemológico.', 'active', '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(2, 2, 11, NULL, 3, 'GAR-000002', 'warranty', 'Pulsera oro rosa 18k', 'Oro rosa 18k', '8.1 g', NULL, '2026-07-21', '2027-07-23', 'Garantía de 12 meses por defectos de fabricación.', 'active', '2026-07-23 14:18:24', '2026-07-23 14:18:24');

-- Volcando estructura para tabla suite_saas_modas_integral.collections
CREATE TABLE IF NOT EXISTS `collections` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `season` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` year DEFAULT NULL,
  `starts_at` date DEFAULT NULL,
  `ends_at` date DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `collections_company_id_foreign` (`company_id`),
  CONSTRAINT `collections_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.collections: ~1 rows (aproximadamente)
DELETE FROM `collections`;
INSERT INTO `collections` (`id`, `company_id`, `name`, `season`, `year`, `starts_at`, `ends_at`, `description`, `active`, `created_at`, `updated_at`) VALUES
	(2, 1, 'Primavera-Verano', 'Primavera-Verano', '2026', NULL, NULL, NULL, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22');

-- Volcando estructura para tabla suite_saas_modas_integral.companies
CREATE TABLE IF NOT EXISTS `companies` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `business_type_id` bigint unsigned NOT NULL,
  `plan_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `legal_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `receipt_footer` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `loyalty_earn_rate` decimal(6,2) NOT NULL DEFAULT '1.00',
  `low_stock_alert` int unsigned NOT NULL DEFAULT '5',
  `monthly_goal` decimal(12,2) DEFAULT NULL,
  `subscription_ends_at` date DEFAULT NULL,
  `modules` json DEFAULT NULL,
  `currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PEN',
  `currency_symbol` varchar(8) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `brand_color` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `timezone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'America/Lima',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `companies_business_type_id_foreign` (`business_type_id`),
  KEY `companies_plan_id_foreign` (`plan_id`),
  CONSTRAINT `companies_business_type_id_foreign` FOREIGN KEY (`business_type_id`) REFERENCES `business_types` (`id`),
  CONSTRAINT `companies_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.companies: ~2 rows (aproximadamente)
DELETE FROM `companies`;
INSERT INTO `companies` (`id`, `business_type_id`, `plan_id`, `name`, `legal_name`, `tax_id`, `email`, `phone`, `address`, `city`, `logo_path`, `receipt_footer`, `loyalty_earn_rate`, `low_stock_alert`, `monthly_goal`, `subscription_ends_at`, `modules`, `currency`, `currency_symbol`, `brand_color`, `timezone`, `active`, `created_at`, `updated_at`) VALUES
	(1, 4, 3, 'Boutique Elegance Demo', 'Elegance Fashion S.A.C.', '20601234567', 'demo@modasuite.test', '+51 999 888 777', 'Av. La Moda 123, Lima', NULL, NULL, NULL, 1.00, 5, NULL, NULL, NULL, 'PEN', NULL, NULL, 'America/Lima', 1, '2026-07-23 14:18:13', '2026-07-24 04:04:32'),
	(2, 5, NULL, 'Joyería Aurora Demo', 'Aurora Joyas SAC', '20609876543', 'joyeria@modasuite.test', '+51 987 654 321', 'Jr. Las Joyas 456, Lima', NULL, NULL, NULL, 1.00, 5, NULL, NULL, NULL, 'PEN', NULL, NULL, 'America/Lima', 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24');

-- Volcando estructura para tabla suite_saas_modas_integral.customers
CREATE TABLE IF NOT EXISTS `customers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `doc_type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `doc_number` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `points_balance` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `customers_company_id_foreign` (`company_id`),
  CONSTRAINT `customers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.customers: ~11 rows (aproximadamente)
DELETE FROM `customers`;
INSERT INTO `customers` (`id`, `company_id`, `name`, `doc_type`, `doc_number`, `email`, `phone`, `address`, `active`, `points_balance`, `created_at`, `updated_at`) VALUES
	(9, 2, 'Jorge Medina', 'DNI', '76509933', NULL, NULL, NULL, 1, 0, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(10, 2, 'Elena Ruiz', 'DNI', '74849840', NULL, NULL, NULL, 1, 0, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(11, 2, 'Ricardo Flores', 'DNI', '70534360', NULL, NULL, NULL, 1, 0, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(12, 1, 'María Fernández', 'DNI', '42579695', NULL, '973281597', NULL, 1, 2664, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(13, 1, 'Lucía Rojas', 'DNI', '52982321', NULL, '961801835', NULL, 1, 2085, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(14, 1, 'Carla Núñez', 'DNI', '76216064', NULL, '989603747', NULL, 1, 2273, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(15, 1, 'Ana Torres', 'DNI', '62758240', NULL, '930835407', NULL, 1, 1904, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(16, 1, 'Sofía Díaz', 'DNI', '59276187', NULL, '990214611', NULL, 1, 1956, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(17, 1, 'Valeria Cruz', 'DNI', '73644553', NULL, '995015132', NULL, 1, 2724, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(18, 1, 'Daniela Paz', 'DNI', '53592638', NULL, '961468244', NULL, 1, 1446, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(19, 1, 'Paula Vega', 'DNI', '42918970', NULL, '946006180', NULL, 1, 3993, '2026-07-23 14:18:22', '2026-07-23 14:18:24');

-- Volcando estructura para tabla suite_saas_modas_integral.expenses
CREATE TABLE IF NOT EXISTS `expenses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `category` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'General',
  `amount` decimal(12,2) NOT NULL,
  `spent_on` date NOT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expenses_company_id_foreign` (`company_id`),
  KEY `expenses_user_id_foreign` (`user_id`),
  CONSTRAINT `expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.expenses: ~0 rows (aproximadamente)
DELETE FROM `expenses`;

-- Volcando estructura para tabla suite_saas_modas_integral.insurance_policies
CREATE TABLE IF NOT EXISTS `insurance_policies` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `customer_id` bigint unsigned DEFAULT NULL,
  `product_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `policy_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insurer` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `item_description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `material` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insured_value` decimal(12,2) NOT NULL DEFAULT '0.00',
  `premium` decimal(12,2) DEFAULT NULL,
  `starts_at` date DEFAULT NULL,
  `ends_at` date DEFAULT NULL,
  `status` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `insurance_policies_company_id_foreign` (`company_id`),
  KEY `insurance_policies_customer_id_foreign` (`customer_id`),
  KEY `insurance_policies_product_id_foreign` (`product_id`),
  KEY `insurance_policies_user_id_foreign` (`user_id`),
  CONSTRAINT `insurance_policies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `insurance_policies_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `insurance_policies_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL,
  CONSTRAINT `insurance_policies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.insurance_policies: ~0 rows (aproximadamente)
DELETE FROM `insurance_policies`;
INSERT INTO `insurance_policies` (`id`, `company_id`, `customer_id`, `product_id`, `user_id`, `number`, `policy_number`, `insurer`, `item_description`, `material`, `insured_value`, `premium`, `starts_at`, `ends_at`, `status`, `note`, `created_at`, `updated_at`) VALUES
	(1, 2, 9, NULL, 3, 'SEG-000001', 'POL-88213', 'Rimac Seguros', 'Collar de diamantes 2.5 ct', 'Oro 18k, diamantes', 18500.00, 320.00, '2026-06-23', '2027-06-23', 'active', NULL, '2026-07-23 14:18:24', '2026-07-23 14:18:24');

-- Volcando estructura para tabla suite_saas_modas_integral.loyalty_transactions
CREATE TABLE IF NOT EXISTS `loyalty_transactions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `customer_id` bigint unsigned NOT NULL,
  `sale_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `type` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL,
  `points` int NOT NULL,
  `balance_after` int NOT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loyalty_transactions_company_id_foreign` (`company_id`),
  KEY `loyalty_transactions_customer_id_foreign` (`customer_id`),
  KEY `loyalty_transactions_sale_id_foreign` (`sale_id`),
  KEY `loyalty_transactions_user_id_foreign` (`user_id`),
  CONSTRAINT `loyalty_transactions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loyalty_transactions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `loyalty_transactions_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE SET NULL,
  CONSTRAINT `loyalty_transactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=91 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.loyalty_transactions: ~45 rows (aproximadamente)
DELETE FROM `loyalty_transactions`;
INSERT INTO `loyalty_transactions` (`id`, `company_id`, `customer_id`, `sale_id`, `user_id`, `type`, `points`, `balance_after`, `note`, `created_at`, `updated_at`) VALUES
	(46, 1, 19, 68, NULL, 'earn', 759, 759, 'Puntos por venta V-000001', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(47, 1, 14, 72, NULL, 'earn', 259, 259, 'Puntos por venta V-000005', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(48, 1, 12, 73, NULL, 'earn', 519, 519, 'Puntos por venta V-000006', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(49, 1, 18, 74, NULL, 'earn', 59, 59, 'Puntos por venta V-000007', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(50, 1, 15, 75, NULL, 'earn', 179, 179, 'Puntos por venta V-000008', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(51, 1, 14, 76, NULL, 'earn', 259, 518, 'Puntos por venta V-000009', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(52, 1, 19, 78, NULL, 'earn', 499, 1258, 'Puntos por venta V-000011', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(53, 1, 15, 79, NULL, 'earn', 499, 678, 'Puntos por venta V-000012', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(54, 1, 14, 80, NULL, 'earn', 329, 847, 'Puntos por venta V-000013', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(55, 1, 14, 81, NULL, 'earn', 129, 976, 'Puntos por venta V-000014', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(56, 1, 14, 82, NULL, 'earn', 79, 1055, 'Puntos por venta V-000015', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(57, 1, 16, 83, NULL, 'earn', 519, 519, 'Puntos por venta V-000016', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(58, 1, 17, 86, NULL, 'earn', 529, 529, 'Puntos por venta V-000019', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(59, 1, 15, 87, NULL, 'earn', 119, 797, 'Puntos por venta V-000020', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(60, 1, 19, 88, NULL, 'earn', 379, 1637, 'Puntos por venta V-000021', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(61, 1, 17, 89, NULL, 'earn', 309, 838, 'Puntos por venta V-000022', '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(62, 1, 17, 91, NULL, 'earn', 299, 1137, 'Puntos por venta V-000024', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(63, 1, 13, 92, NULL, 'earn', 269, 269, 'Puntos por venta V-000025', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(64, 1, 14, 95, NULL, 'earn', 419, 1474, 'Puntos por venta V-000028', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(65, 1, 17, 96, NULL, 'earn', 799, 1936, 'Puntos por venta V-000029', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(66, 1, 16, 98, NULL, 'earn', 479, 998, 'Puntos por venta V-000031', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(67, 1, 12, 100, NULL, 'earn', 359, 878, 'Puntos por venta V-000033', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(68, 1, 19, 102, NULL, 'earn', 499, 2136, 'Puntos por venta V-000035', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(69, 1, 12, 103, NULL, 'earn', 379, 1257, 'Puntos por venta V-000036', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(70, 1, 16, 104, NULL, 'earn', 529, 1527, 'Puntos por venta V-000037', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(71, 1, 18, 106, NULL, 'earn', 159, 218, 'Puntos por venta V-000039', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(72, 1, 13, 108, NULL, 'earn', 259, 528, 'Puntos por venta V-000041', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(73, 1, 15, 109, NULL, 'earn', 239, 1036, 'Puntos por venta V-000042', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(74, 1, 13, 112, NULL, 'earn', 279, 807, 'Puntos por venta V-000045', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(75, 1, 13, 115, NULL, 'earn', 839, 1646, 'Puntos por venta V-000048', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(76, 1, 17, 116, NULL, 'earn', 419, 2355, 'Puntos por venta V-000049', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(77, 1, 16, 117, NULL, 'earn', 429, 1956, 'Puntos por venta V-000050', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(78, 1, 12, 118, NULL, 'earn', 499, 1756, 'Puntos por venta V-000051', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(79, 1, 15, 119, NULL, 'earn', 239, 1275, 'Puntos por venta V-000052', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(80, 1, 13, 121, NULL, 'earn', 439, 2085, 'Puntos por venta V-000054', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(81, 1, 12, 123, NULL, 'earn', 189, 1945, 'Puntos por venta V-000056', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(82, 1, 19, 124, NULL, 'earn', 719, 2855, 'Puntos por venta V-000057', '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(83, 1, 18, 126, NULL, 'earn', 629, 847, 'Puntos por venta V-000059', '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(84, 1, 17, 127, NULL, 'earn', 369, 2724, 'Puntos por venta V-000060', '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(85, 1, 12, 128, NULL, 'earn', 719, 2664, 'Puntos por venta V-000061', '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(86, 1, 19, 129, NULL, 'earn', 519, 3374, 'Puntos por venta V-000062', '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(87, 1, 19, 130, NULL, 'earn', 619, 3993, 'Puntos por venta V-000063', '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(88, 1, 14, 131, NULL, 'earn', 799, 2273, 'Puntos por venta V-000064', '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(89, 1, 15, 132, NULL, 'earn', 629, 1904, 'Puntos por venta V-000065', '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(90, 1, 18, 134, NULL, 'earn', 599, 1446, 'Puntos por venta V-000067', '2026-07-23 14:18:24', '2026-07-23 14:18:24');

-- Volcando estructura para tabla suite_saas_modas_integral.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.migrations: ~17 rows (aproximadamente)
DELETE FROM `migrations`;
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
	(1, '2026_01_01_000001_create_business_types_table', 1),
	(2, '2026_01_01_000002_create_companies_table', 1),
	(3, '2026_01_01_000003_create_users_table', 1),
	(4, '2026_01_02_000001_create_catalog_tables', 1),
	(5, '2026_01_03_000001_create_sales_tables', 1),
	(6, '2026_01_04_000001_create_cash_tables', 1),
	(7, '2026_01_05_000001_create_purchases_tables', 1),
	(8, '2026_01_06_000001_create_promotions_table', 1),
	(9, '2026_01_07_000001_create_returns_tables', 1),
	(10, '2026_01_08_000001_create_loyalty_tables', 1),
	(11, '2026_01_09_000001_create_collections_table', 1),
	(12, '2026_01_10_000001_create_appointments_table', 1),
	(13, '2026_01_11_000001_create_repair_orders_table', 1),
	(14, '2026_01_12_000001_create_certificates_table', 1),
	(15, '2026_01_13_000001_create_insurance_policies_table', 1),
	(16, '2026_01_14_000001_add_settings_to_companies_table', 2),
	(17, '2026_01_15_000001_create_plans_table', 3),
	(18, '2026_01_16_000001_create_stores_and_transfers_tables', 4),
	(19, '2026_01_17_000001_add_subscription_to_companies_table', 4),
	(20, '2026_01_18_000001_saas_plan_modules_and_subscriptions', 5),
	(21, '2026_01_19_000001_create_attributes_and_expenses_tables', 6);

-- Volcando estructura para tabla suite_saas_modas_integral.password_reset_tokens
CREATE TABLE IF NOT EXISTS `password_reset_tokens` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.password_reset_tokens: ~0 rows (aproximadamente)
DELETE FROM `password_reset_tokens`;

-- Volcando estructura para tabla suite_saas_modas_integral.plans
CREATE TABLE IF NOT EXISTS `plans` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `interval` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'mensual',
  `max_users` int unsigned DEFAULT NULL,
  `max_products` int unsigned DEFAULT NULL,
  `features` json DEFAULT NULL,
  `modules` json DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `plans_slug_unique` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.plans: ~4 rows (aproximadamente)
DELETE FROM `plans`;
INSERT INTO `plans` (`id`, `name`, `description`, `slug`, `price`, `interval`, `max_users`, `max_products`, `features`, `modules`, `active`, `created_at`, `updated_at`) VALUES
	(1, 'Free', NULL, 'free', 0.00, 'mensual', 2, 30, '["1 tienda", "Módulos básicos", "Soporte por correo"]', NULL, 1, '2026-07-23 14:40:05', '2026-07-23 14:40:05'),
	(2, 'Pro', 'Suma promociones, fidelización, compras y reportes.', 'pro', 99.00, 'mensual', 10, 2000, '["Todos los módulos operativos", "Reportes y exportación", "Promociones y fidelización", "Soporte prioritario"]', '["dashboard", "pos", "sales", "returns", "products", "categories", "inventory", "purchases", "suppliers", "transfers", "customers", "loyalty", "promotions", "cash", "expenses", "reports", "users", "settings"]', 1, '2026-07-23 14:40:05', '2026-07-24 04:04:32'),
	(3, 'Premium', 'Todo incluido, multi-tienda y módulos por rubro. Usuarios ilimitados.', 'premium', 149.00, 'mensual', NULL, NULL, '["Usuarios ilimitados", "Productos ilimitados", "Multi-tienda y traslados", "Módulos por rubro", "Soporte dedicado"]', '["dashboard", "pos", "sales", "returns", "appointments", "repairs", "products", "variants", "shoe_sizes", "materials", "collections", "certificates", "categories", "inventory", "purchases", "suppliers", "transfers", "customers", "loyalty", "promotions", "cash", "expenses", "insurance", "reports", "users", "settings"]', 1, '2026-07-23 14:40:05', '2026-07-24 04:04:32'),
	(4, 'Básico', 'Ideal para empezar: ventas, caja e inventario.', 'basico', 49.00, 'mensual', 3, 300, '["1 tienda", "Ventas y POS", "Inventario", "Soporte por correo"]', '["dashboard", "pos", "sales", "returns", "products", "categories", "inventory", "customers", "cash", "reports", "users", "settings"]', 1, '2026-07-24 04:04:32', '2026-07-24 04:04:32');

-- Volcando estructura para tabla suite_saas_modas_integral.products
CREATE TABLE IF NOT EXISTS `products` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `category_id` bigint unsigned DEFAULT NULL,
  `brand_id` bigint unsigned DEFAULT NULL,
  `collection_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `unit` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'UND',
  `cost` decimal(12,2) NOT NULL DEFAULT '0.00',
  `price` decimal(12,2) NOT NULL DEFAULT '0.00',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `products_company_id_foreign` (`company_id`),
  KEY `products_category_id_foreign` (`category_id`),
  KEY `products_brand_id_foreign` (`brand_id`),
  KEY `products_collection_id_foreign` (`collection_id`),
  CONSTRAINT `products_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE SET NULL,
  CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL,
  CONSTRAINT `products_collection_id_foreign` FOREIGN KEY (`collection_id`) REFERENCES `collections` (`id`) ON DELETE SET NULL,
  CONSTRAINT `products_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.products: ~14 rows (aproximadamente)
DELETE FROM `products`;
INSERT INTO `products` (`id`, `company_id`, `category_id`, `brand_id`, `collection_id`, `name`, `sku`, `description`, `unit`, `cost`, `price`, `active`, `created_at`, `updated_at`) VALUES
	(11, 2, 6, NULL, NULL, 'Anillo Oro 18k con Diamante', 'J0001', NULL, 'UND', 1734.00, 2890.00, 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(12, 2, 6, NULL, NULL, 'Aretes Oro Blanco', 'J0002', NULL, 'UND', 750.00, 1250.00, 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(13, 2, 6, NULL, NULL, 'Collar Plata 925', 'J0003', NULL, 'UND', 288.00, 480.00, 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(14, 2, 6, NULL, NULL, 'Pulsera Oro Rosa', 'J0004', NULL, 'UND', 1008.00, 1680.00, 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(15, 1, 7, 4, 2, 'Vestido Satinado Noche', 'P0001', NULL, 'UND', 95.00, 189.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(16, 1, 7, 5, 2, 'Vestido Floral Casual', 'P0002', NULL, 'UND', 62.00, 129.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(17, 1, 8, 6, 2, 'Blusa Seda Marfil', 'P0003', NULL, 'UND', 45.00, 89.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(18, 1, 8, 4, 2, 'Blusa Manga Larga', 'P0004', NULL, 'UND', 40.00, 79.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(19, 1, 9, 5, 2, 'Pantalón Palazzo', 'P0005', NULL, 'UND', 60.00, 119.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(20, 1, 9, 6, 2, 'Jean Slim Tiro Alto', 'P0006', NULL, 'UND', 70.00, 139.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(21, 1, 10, 4, 2, 'Abrigo Lana Largo', 'P0007', NULL, 'UND', 140.00, 259.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(22, 1, 10, 5, 2, 'Blazer Entallado', 'P0008', NULL, 'UND', 90.00, 179.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(23, 1, 11, 6, 2, 'Cartera Cuero Premium', 'P0009', NULL, 'UND', 110.00, 219.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(24, 1, 11, 4, 2, 'Cinturón Cuero', 'P0010', NULL, 'UND', 22.00, 59.90, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22');

-- Volcando estructura para tabla suite_saas_modas_integral.product_variants
CREATE TABLE IF NOT EXISTS `product_variants` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `product_id` bigint unsigned NOT NULL,
  `sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `size` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `barcode` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cost` decimal(12,2) NOT NULL DEFAULT '0.00',
  `price` decimal(12,2) NOT NULL DEFAULT '0.00',
  `stock` int NOT NULL DEFAULT '0',
  `min_stock` int NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `product_variants_product_id_foreign` (`product_id`),
  CONSTRAINT `product_variants_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.product_variants: ~30 rows (aproximadamente)
DELETE FROM `product_variants`;
INSERT INTO `product_variants` (`id`, `product_id`, `sku`, `size`, `color`, `barcode`, `cost`, `price`, `stock`, `min_stock`, `active`, `created_at`, `updated_at`) VALUES
	(27, 11, 'J0001', NULL, NULL, NULL, 1734.00, 2890.00, 6, 2, 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(28, 12, 'J0002', NULL, NULL, NULL, 750.00, 1250.00, 10, 2, 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(29, 13, 'J0003', NULL, NULL, NULL, 288.00, 480.00, 9, 2, 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(30, 14, 'J0004', NULL, NULL, NULL, 1008.00, 1680.00, 4, 2, 1, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(31, 15, 'P0001-S', 'S', 'Negro', NULL, 95.00, 189.90, 19, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(32, 15, 'P0001-M', 'M', 'Negro', NULL, 95.00, 189.90, 32, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(33, 15, 'P0001-L', 'L', 'Blanco', NULL, 95.00, 189.90, 28, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(34, 16, 'P0002-S', 'S', 'Blanco', NULL, 62.00, 129.90, 28, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(35, 16, 'P0002-M', 'M', 'Blanco', NULL, 62.00, 129.90, 22, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(36, 16, 'P0002-L', 'L', 'Rojo', NULL, 62.00, 129.90, 6, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(37, 17, 'P0003-S', 'S', 'Rojo', NULL, 45.00, 89.90, 18, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(38, 17, 'P0003-M', 'M', 'Rojo', NULL, 45.00, 89.90, 7, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(39, 17, 'P0003-L', 'L', 'Azul', NULL, 45.00, 89.90, 18, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(40, 18, 'P0004-S', 'S', 'Azul', NULL, 40.00, 79.90, 31, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(41, 18, 'P0004-M', 'M', 'Azul', NULL, 40.00, 79.90, 16, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(42, 18, 'P0004-L', 'L', 'Negro', NULL, 40.00, 79.90, 32, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(43, 19, 'P0005-S', 'S', 'Negro', NULL, 60.00, 119.90, 27, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(44, 19, 'P0005-M', 'M', 'Negro', NULL, 60.00, 119.90, 17, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(45, 19, 'P0005-L', 'L', 'Blanco', NULL, 60.00, 119.90, 17, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(46, 20, 'P0006-S', 'S', 'Blanco', NULL, 70.00, 139.90, 38, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(47, 20, 'P0006-M', 'M', 'Blanco', NULL, 70.00, 139.90, 8, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(48, 20, 'P0006-L', 'L', 'Rojo', NULL, 70.00, 139.90, 13, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(49, 21, 'P0007-S', 'S', 'Rojo', NULL, 140.00, 259.90, 30, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(50, 21, 'P0007-M', 'M', 'Rojo', NULL, 140.00, 259.90, 12, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(51, 21, 'P0007-L', 'L', 'Azul', NULL, 140.00, 259.90, 25, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(52, 22, 'P0008-S', 'S', 'Azul', NULL, 90.00, 179.90, 17, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(53, 22, 'P0008-M', 'M', 'Azul', NULL, 90.00, 179.90, 32, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(54, 22, 'P0008-L', 'L', 'Negro', NULL, 90.00, 179.90, 12, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24'),
	(55, 23, 'P0009', NULL, NULL, NULL, 110.00, 219.90, 38, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:23'),
	(56, 24, 'P0010', NULL, NULL, NULL, 22.00, 59.90, 32, 5, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:24');

-- Volcando estructura para tabla suite_saas_modas_integral.promotions
CREATE TABLE IF NOT EXISTS `promotions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'percent',
  `value` decimal(12,2) NOT NULL DEFAULT '0.00',
  `scope` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'all',
  `category_id` bigint unsigned DEFAULT NULL,
  `product_id` bigint unsigned DEFAULT NULL,
  `starts_at` date DEFAULT NULL,
  `ends_at` date DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `promotions_company_id_foreign` (`company_id`),
  KEY `promotions_category_id_foreign` (`category_id`),
  KEY `promotions_product_id_foreign` (`product_id`),
  CONSTRAINT `promotions_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL,
  CONSTRAINT `promotions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `promotions_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.promotions: ~0 rows (aproximadamente)
DELETE FROM `promotions`;

-- Volcando estructura para tabla suite_saas_modas_integral.purchases
CREATE TABLE IF NOT EXISTS `purchases` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `supplier_id` bigint unsigned DEFAULT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subtotal` decimal(12,2) NOT NULL DEFAULT '0.00',
  `discount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `total` decimal(12,2) NOT NULL DEFAULT '0.00',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'received',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchases_company_id_foreign` (`company_id`),
  KEY `purchases_user_id_foreign` (`user_id`),
  KEY `purchases_supplier_id_foreign` (`supplier_id`),
  CONSTRAINT `purchases_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchases_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `purchases_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.purchases: ~2 rows (aproximadamente)
DELETE FROM `purchases`;
INSERT INTO `purchases` (`id`, `company_id`, `user_id`, `supplier_id`, `number`, `document`, `subtotal`, `discount`, `total`, `status`, `note`, `created_at`, `updated_at`) VALUES
	(3, 1, NULL, 2, 'C-000001', 'F001-7772', 0.00, 0.00, 0.00, 'received', NULL, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(4, 1, NULL, 2, 'C-000002', 'F001-4904', 0.00, 0.00, 0.00, 'received', NULL, '2026-07-23 14:18:22', '2026-07-23 14:18:22');

-- Volcando estructura para tabla suite_saas_modas_integral.purchase_items
CREATE TABLE IF NOT EXISTS `purchase_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_id` bigint unsigned NOT NULL,
  `product_variant_id` bigint unsigned DEFAULT NULL,
  `product_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `variant_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` int NOT NULL,
  `unit_cost` decimal(12,2) NOT NULL,
  `line_total` decimal(12,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_items_purchase_id_foreign` (`purchase_id`),
  KEY `purchase_items_product_variant_id_foreign` (`product_variant_id`),
  CONSTRAINT `purchase_items_product_variant_id_foreign` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE SET NULL,
  CONSTRAINT `purchase_items_purchase_id_foreign` FOREIGN KEY (`purchase_id`) REFERENCES `purchases` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.purchase_items: ~0 rows (aproximadamente)
DELETE FROM `purchase_items`;

-- Volcando estructura para tabla suite_saas_modas_integral.repair_orders
CREATE TABLE IF NOT EXISTS `repair_orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `customer_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `item_description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `material` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `estimated_cost` decimal(12,2) NOT NULL DEFAULT '0.00',
  `deposit` decimal(12,2) NOT NULL DEFAULT '0.00',
  `status` varchar(14) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'received',
  `received_at` date DEFAULT NULL,
  `promised_at` date DEFAULT NULL,
  `delivered_at` date DEFAULT NULL,
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `repair_orders_company_id_foreign` (`company_id`),
  KEY `repair_orders_customer_id_foreign` (`customer_id`),
  KEY `repair_orders_user_id_foreign` (`user_id`),
  CONSTRAINT `repair_orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `repair_orders_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `repair_orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.repair_orders: ~3 rows (aproximadamente)
DELETE FROM `repair_orders`;
INSERT INTO `repair_orders` (`id`, `company_id`, `customer_id`, `user_id`, `number`, `item_description`, `material`, `estimated_cost`, `deposit`, `status`, `received_at`, `promised_at`, `delivered_at`, `note`, `created_at`, `updated_at`) VALUES
	(1, 2, 9, 3, 'R-000001', 'Cambio de talla anillo oro 18k', 'Oro 18k', 120.00, 60.00, 'in_progress', '2026-07-22', '2026-07-26', NULL, NULL, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(2, 2, 11, 3, 'R-000002', 'Pulido y baño collar plata', 'Plata 925', 80.00, 0.00, 'ready', '2026-07-16', '2026-07-26', NULL, NULL, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(3, 2, 10, 3, 'R-000003', 'Reemplazo de broche pulsera', 'Oro rosa', 150.00, 50.00, 'received', '2026-07-15', '2026-07-31', NULL, NULL, '2026-07-23 14:18:24', '2026-07-23 14:18:24');

-- Volcando estructura para tabla suite_saas_modas_integral.sales
CREATE TABLE IF NOT EXISTS `sales` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `customer_id` bigint unsigned DEFAULT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subtotal` decimal(12,2) NOT NULL DEFAULT '0.00',
  `discount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `tax` decimal(12,2) NOT NULL DEFAULT '0.00',
  `total` decimal(12,2) NOT NULL DEFAULT '0.00',
  `payment_method` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'efectivo',
  `paid` decimal(12,2) NOT NULL DEFAULT '0.00',
  `change` decimal(12,2) NOT NULL DEFAULT '0.00',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'completed',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sales_company_id_foreign` (`company_id`),
  KEY `sales_user_id_foreign` (`user_id`),
  KEY `sales_customer_id_foreign` (`customer_id`),
  CONSTRAINT `sales_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sales_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `sales_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=135 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.sales: ~67 rows (aproximadamente)
DELETE FROM `sales`;
INSERT INTO `sales` (`id`, `company_id`, `user_id`, `customer_id`, `number`, `subtotal`, `discount`, `tax`, `total`, `payment_method`, `paid`, `change`, `status`, `note`, `created_at`, `updated_at`) VALUES
	(68, 1, NULL, 19, 'V-000001', 759.60, 0.00, 0.00, 759.60, 'yape_plin', 759.60, 0.00, 'completed', NULL, '2026-06-24 00:37:00', '2026-06-24 00:37:00'),
	(69, 1, NULL, NULL, 'V-000002', 619.60, 0.00, 0.00, 619.60, 'yape_plin', 619.60, 0.00, 'completed', NULL, '2026-06-23 15:50:00', '2026-06-23 15:50:00'),
	(70, 1, NULL, NULL, 'V-000003', 519.80, 0.00, 0.00, 519.80, 'yape_plin', 519.80, 0.00, 'completed', NULL, '2026-06-23 21:50:00', '2026-06-23 21:50:00'),
	(71, 1, NULL, NULL, 'V-000004', 449.70, 0.00, 0.00, 449.70, 'yape_plin', 449.70, 0.00, 'completed', NULL, '2026-06-24 18:02:00', '2026-06-24 18:02:00'),
	(72, 1, NULL, 14, 'V-000005', 259.90, 0.00, 0.00, 259.90, 'efectivo', 259.90, 0.00, 'completed', NULL, '2026-06-24 22:46:00', '2026-06-24 22:46:00'),
	(73, 1, NULL, 12, 'V-000006', 519.80, 0.00, 0.00, 519.80, 'transferencia', 519.80, 0.00, 'completed', NULL, '2026-06-24 22:22:00', '2026-06-24 22:22:00'),
	(74, 1, NULL, 18, 'V-000007', 59.90, 0.00, 0.00, 59.90, 'tarjeta', 59.90, 0.00, 'completed', NULL, '2026-06-25 16:08:00', '2026-06-25 16:08:00'),
	(75, 1, NULL, 15, 'V-000008', 179.80, 0.00, 0.00, 179.80, 'efectivo', 179.80, 0.00, 'completed', NULL, '2026-06-25 20:58:00', '2026-06-25 20:58:00'),
	(76, 1, NULL, 14, 'V-000009', 259.90, 0.00, 0.00, 259.90, 'efectivo', 259.90, 0.00, 'completed', NULL, '2026-06-25 20:13:00', '2026-06-25 20:13:00'),
	(77, 1, NULL, NULL, 'V-000010', 509.50, 0.00, 0.00, 509.50, 'transferencia', 509.50, 0.00, 'completed', NULL, '2026-06-26 18:55:00', '2026-06-26 18:55:00'),
	(78, 1, NULL, 19, 'V-000011', 499.60, 0.00, 0.00, 499.60, 'transferencia', 499.60, 0.00, 'completed', NULL, '2026-06-26 18:59:00', '2026-06-26 18:59:00'),
	(79, 1, NULL, 15, 'V-000012', 499.60, 0.00, 0.00, 499.60, 'tarjeta', 499.60, 0.00, 'completed', NULL, '2026-06-28 00:49:00', '2026-06-28 00:49:00'),
	(80, 1, NULL, 14, 'V-000013', 329.80, 0.00, 0.00, 329.80, 'transferencia', 329.80, 0.00, 'completed', NULL, '2026-06-28 16:46:00', '2026-06-28 16:46:00'),
	(81, 1, NULL, 14, 'V-000014', 129.90, 0.00, 0.00, 129.90, 'efectivo', 129.90, 0.00, 'completed', NULL, '2026-06-28 22:30:00', '2026-06-28 22:30:00'),
	(82, 1, NULL, 14, 'V-000015', 79.90, 0.00, 0.00, 79.90, 'efectivo', 79.90, 0.00, 'completed', NULL, '2026-06-29 16:39:00', '2026-06-29 16:39:00'),
	(83, 1, NULL, 16, 'V-000016', 519.80, 0.00, 0.00, 519.80, 'transferencia', 519.80, 0.00, 'completed', NULL, '2026-06-29 23:44:00', '2026-06-29 23:44:00'),
	(84, 1, NULL, NULL, 'V-000017', 139.90, 0.00, 0.00, 139.90, 'efectivo', 139.90, 0.00, 'completed', NULL, '2026-06-30 21:42:00', '2026-06-30 21:42:00'),
	(85, 1, NULL, NULL, 'V-000018', 1039.40, 0.00, 0.00, 1039.40, 'yape_plin', 1039.40, 0.00, 'completed', NULL, '2026-06-30 19:11:00', '2026-06-30 19:11:00'),
	(86, 1, NULL, 17, 'V-000019', 529.70, 0.00, 0.00, 529.70, 'efectivo', 529.70, 0.00, 'completed', NULL, '2026-06-30 20:28:00', '2026-06-30 20:28:00'),
	(87, 1, NULL, 15, 'V-000020', 119.90, 0.00, 0.00, 119.90, 'tarjeta', 119.90, 0.00, 'completed', NULL, '2026-07-01 16:12:00', '2026-07-01 16:12:00'),
	(88, 1, NULL, 19, 'V-000021', 379.70, 0.00, 0.00, 379.70, 'yape_plin', 379.70, 0.00, 'completed', NULL, '2026-07-01 19:28:00', '2026-07-01 19:28:00'),
	(89, 1, NULL, 17, 'V-000022', 309.70, 0.00, 0.00, 309.70, 'efectivo', 309.70, 0.00, 'completed', NULL, '2026-07-01 20:32:00', '2026-07-01 20:32:00'),
	(90, 1, NULL, NULL, 'V-000023', 279.80, 0.00, 0.00, 279.80, 'yape_plin', 279.80, 0.00, 'completed', NULL, '2026-07-02 19:01:00', '2026-07-02 19:01:00'),
	(91, 1, NULL, 17, 'V-000024', 299.70, 0.00, 0.00, 299.70, 'efectivo', 299.70, 0.00, 'completed', NULL, '2026-07-04 00:27:00', '2026-07-04 00:27:00'),
	(92, 1, NULL, 13, 'V-000025', 269.80, 0.00, 0.00, 269.80, 'transferencia', 269.80, 0.00, 'completed', NULL, '2026-07-04 17:40:00', '2026-07-04 17:40:00'),
	(93, 1, NULL, NULL, 'V-000026', 89.90, 0.00, 0.00, 89.90, 'transferencia', 89.90, 0.00, 'completed', NULL, '2026-07-04 21:11:00', '2026-07-04 21:11:00'),
	(94, 1, NULL, NULL, 'V-000027', 299.70, 0.00, 0.00, 299.70, 'efectivo', 299.70, 0.00, 'completed', NULL, '2026-07-04 15:31:00', '2026-07-04 15:31:00'),
	(95, 1, NULL, 14, 'V-000028', 419.60, 0.00, 0.00, 419.60, 'tarjeta', 419.60, 0.00, 'completed', NULL, '2026-07-05 19:23:00', '2026-07-05 19:23:00'),
	(96, 1, NULL, 17, 'V-000029', 799.40, 0.00, 0.00, 799.40, 'yape_plin', 799.40, 0.00, 'completed', NULL, '2026-07-05 20:14:00', '2026-07-05 20:14:00'),
	(97, 1, NULL, NULL, 'V-000030', 269.80, 0.00, 0.00, 269.80, 'efectivo', 269.80, 0.00, 'completed', NULL, '2026-07-05 18:06:00', '2026-07-05 18:06:00'),
	(98, 1, NULL, 16, 'V-000031', 479.70, 0.00, 0.00, 479.70, 'efectivo', 479.70, 0.00, 'completed', NULL, '2026-07-07 01:26:00', '2026-07-07 01:26:00'),
	(99, 1, NULL, NULL, 'V-000032', 119.80, 0.00, 0.00, 119.80, 'tarjeta', 119.80, 0.00, 'completed', NULL, '2026-07-06 18:27:00', '2026-07-06 18:27:00'),
	(100, 1, NULL, 12, 'V-000033', 359.80, 0.00, 0.00, 359.80, 'tarjeta', 359.80, 0.00, 'completed', NULL, '2026-07-07 18:48:00', '2026-07-07 18:48:00'),
	(101, 1, NULL, NULL, 'V-000034', 239.80, 0.00, 0.00, 239.80, 'tarjeta', 239.80, 0.00, 'completed', NULL, '2026-07-07 18:17:00', '2026-07-07 18:17:00'),
	(102, 1, NULL, 19, 'V-000035', 499.70, 0.00, 0.00, 499.70, 'yape_plin', 499.70, 0.00, 'completed', NULL, '2026-07-08 17:33:00', '2026-07-08 17:33:00'),
	(103, 1, NULL, 12, 'V-000036', 379.80, 0.00, 0.00, 379.80, 'yape_plin', 379.80, 0.00, 'completed', NULL, '2026-07-08 18:06:00', '2026-07-08 18:06:00'),
	(104, 1, NULL, 16, 'V-000037', 529.60, 0.00, 0.00, 529.60, 'yape_plin', 529.60, 0.00, 'completed', NULL, '2026-07-08 18:50:00', '2026-07-08 18:50:00'),
	(105, 1, NULL, NULL, 'V-000038', 119.90, 0.00, 0.00, 119.90, 'yape_plin', 119.90, 0.00, 'completed', NULL, '2026-07-09 16:52:00', '2026-07-09 16:52:00'),
	(106, 1, NULL, 18, 'V-000039', 159.80, 0.00, 0.00, 159.80, 'transferencia', 159.80, 0.00, 'completed', NULL, '2026-07-09 18:24:00', '2026-07-09 18:24:00'),
	(107, 1, NULL, NULL, 'V-000040', 279.80, 0.00, 0.00, 279.80, 'efectivo', 279.80, 0.00, 'completed', NULL, '2026-07-09 22:00:00', '2026-07-09 22:00:00'),
	(108, 1, NULL, 13, 'V-000041', 259.90, 0.00, 0.00, 259.90, 'tarjeta', 259.90, 0.00, 'completed', NULL, '2026-07-11 00:56:00', '2026-07-11 00:56:00'),
	(109, 1, NULL, 15, 'V-000042', 239.80, 0.00, 0.00, 239.80, 'yape_plin', 239.80, 0.00, 'completed', NULL, '2026-07-10 23:35:00', '2026-07-10 23:35:00'),
	(110, 1, NULL, NULL, 'V-000043', 479.70, 0.00, 0.00, 479.70, 'efectivo', 479.70, 0.00, 'completed', NULL, '2026-07-11 23:14:00', '2026-07-11 23:14:00'),
	(111, 1, NULL, NULL, 'V-000044', 759.50, 0.00, 0.00, 759.50, 'tarjeta', 759.50, 0.00, 'completed', NULL, '2026-07-11 16:23:00', '2026-07-11 16:23:00'),
	(112, 1, NULL, 13, 'V-000045', 279.80, 0.00, 0.00, 279.80, 'transferencia', 279.80, 0.00, 'completed', NULL, '2026-07-12 17:39:00', '2026-07-12 17:39:00'),
	(113, 1, NULL, NULL, 'V-000046', 249.80, 0.00, 0.00, 249.80, 'efectivo', 249.80, 0.00, 'completed', NULL, '2026-07-12 23:58:00', '2026-07-12 23:58:00'),
	(114, 1, NULL, NULL, 'V-000047', 539.60, 0.00, 0.00, 539.60, 'transferencia', 539.60, 0.00, 'completed', NULL, '2026-07-13 22:55:00', '2026-07-13 22:55:00'),
	(115, 1, NULL, 13, 'V-000048', 839.60, 0.00, 0.00, 839.60, 'transferencia', 839.60, 0.00, 'completed', NULL, '2026-07-13 19:53:00', '2026-07-13 19:53:00'),
	(116, 1, NULL, 17, 'V-000049', 419.60, 0.00, 0.00, 419.60, 'tarjeta', 419.60, 0.00, 'completed', NULL, '2026-07-13 18:18:00', '2026-07-13 18:18:00'),
	(117, 1, NULL, 16, 'V-000050', 429.60, 0.00, 0.00, 429.60, 'tarjeta', 429.60, 0.00, 'completed', NULL, '2026-07-14 19:17:00', '2026-07-14 19:17:00'),
	(118, 1, NULL, 12, 'V-000051', 499.60, 0.00, 0.00, 499.60, 'transferencia', 499.60, 0.00, 'completed', NULL, '2026-07-14 21:15:00', '2026-07-14 21:15:00'),
	(119, 1, NULL, 15, 'V-000052', 239.80, 0.00, 0.00, 239.80, 'tarjeta', 239.80, 0.00, 'completed', NULL, '2026-07-16 00:34:00', '2026-07-16 00:34:00'),
	(120, 1, NULL, NULL, 'V-000053', 139.90, 0.00, 0.00, 139.90, 'tarjeta', 139.90, 0.00, 'completed', NULL, '2026-07-15 22:47:00', '2026-07-15 22:47:00'),
	(121, 1, NULL, 13, 'V-000054', 439.70, 0.00, 0.00, 439.70, 'tarjeta', 439.70, 0.00, 'completed', NULL, '2026-07-16 22:16:00', '2026-07-16 22:16:00'),
	(122, 1, NULL, NULL, 'V-000055', 559.60, 0.00, 0.00, 559.60, 'tarjeta', 559.60, 0.00, 'completed', NULL, '2026-07-16 20:16:00', '2026-07-16 20:16:00'),
	(123, 1, NULL, 12, 'V-000056', 189.90, 0.00, 0.00, 189.90, 'efectivo', 189.90, 0.00, 'completed', NULL, '2026-07-18 01:03:00', '2026-07-18 01:03:00'),
	(124, 1, NULL, 19, 'V-000057', 719.40, 0.00, 0.00, 719.40, 'yape_plin', 719.40, 0.00, 'completed', NULL, '2026-07-18 16:14:00', '2026-07-18 16:14:00'),
	(125, 1, NULL, NULL, 'V-000058', 279.80, 0.00, 0.00, 279.80, 'efectivo', 279.80, 0.00, 'completed', NULL, '2026-07-19 20:17:00', '2026-07-19 20:17:00'),
	(126, 1, NULL, 18, 'V-000059', 629.50, 0.00, 0.00, 629.50, 'yape_plin', 629.50, 0.00, 'completed', NULL, '2026-07-19 18:24:00', '2026-07-19 18:24:00'),
	(127, 1, NULL, 17, 'V-000060', 369.70, 0.00, 0.00, 369.70, 'yape_plin', 369.70, 0.00, 'completed', NULL, '2026-07-20 21:48:00', '2026-07-20 21:48:00'),
	(128, 1, NULL, 12, 'V-000061', 719.50, 0.00, 0.00, 719.50, 'transferencia', 719.50, 0.00, 'completed', NULL, '2026-07-20 16:16:00', '2026-07-20 16:16:00'),
	(129, 1, NULL, 19, 'V-000062', 519.80, 0.00, 0.00, 519.80, 'tarjeta', 519.80, 0.00, 'completed', NULL, '2026-07-20 21:23:00', '2026-07-20 21:23:00'),
	(130, 1, NULL, 19, 'V-000063', 619.50, 0.00, 0.00, 619.50, 'efectivo', 619.50, 0.00, 'completed', NULL, '2026-07-22 01:51:00', '2026-07-22 01:51:00'),
	(131, 1, NULL, 14, 'V-000064', 799.50, 0.00, 0.00, 799.50, 'transferencia', 799.50, 0.00, 'completed', NULL, '2026-07-22 16:51:00', '2026-07-22 16:51:00'),
	(132, 1, NULL, 15, 'V-000065', 629.60, 0.00, 0.00, 629.60, 'transferencia', 629.60, 0.00, 'completed', NULL, '2026-07-23 00:02:00', '2026-07-23 00:02:00'),
	(133, 1, NULL, NULL, 'V-000066', 449.70, 0.00, 0.00, 449.70, 'transferencia', 449.70, 0.00, 'completed', NULL, '2026-07-23 17:01:00', '2026-07-23 17:01:00'),
	(134, 1, NULL, 18, 'V-000067', 599.70, 0.00, 0.00, 599.70, 'yape_plin', 599.70, 0.00, 'completed', NULL, '2026-07-23 15:21:00', '2026-07-23 15:21:00');

-- Volcando estructura para tabla suite_saas_modas_integral.sale_items
CREATE TABLE IF NOT EXISTS `sale_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sale_id` bigint unsigned NOT NULL,
  `product_variant_id` bigint unsigned DEFAULT NULL,
  `product_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `variant_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` int NOT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `discount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `line_total` decimal(12,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_items_sale_id_foreign` (`sale_id`),
  KEY `sale_items_product_variant_id_foreign` (`product_variant_id`),
  CONSTRAINT `sale_items_product_variant_id_foreign` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE SET NULL,
  CONSTRAINT `sale_items_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=249 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.sale_items: ~124 rows (aproximadamente)
DELETE FROM `sale_items`;
INSERT INTO `sale_items` (`id`, `sale_id`, `product_variant_id`, `product_name`, `variant_label`, `sku`, `quantity`, `unit_price`, `discount`, `line_total`, `created_at`, `updated_at`) VALUES
	(125, 68, 44, 'Pantalón Palazzo', 'M / Negro', 'P0005-M', 2, 119.90, 0.00, 239.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(126, 68, 50, 'Abrigo Lana Largo', 'M / Rojo', 'P0007-M', 2, 259.90, 0.00, 519.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(127, 69, 42, 'Blusa Manga Larga', 'L / Negro', 'P0004-L', 1, 79.90, 0.00, 79.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(128, 69, 52, 'Blazer Entallado', 'S / Azul', 'P0008-S', 1, 179.90, 0.00, 179.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(129, 69, 53, 'Blazer Entallado', 'M / Azul', 'P0008-M', 2, 179.90, 0.00, 359.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(130, 70, 51, 'Abrigo Lana Largo', 'L / Azul', 'P0007-L', 2, 259.90, 0.00, 519.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(131, 71, 37, 'Blusa Seda Marfil', 'S / Rojo', 'P0003-S', 1, 89.90, 0.00, 89.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(132, 71, 54, 'Blazer Entallado', 'L / Negro', 'P0008-L', 2, 179.90, 0.00, 359.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(133, 72, 49, 'Abrigo Lana Largo', 'S / Rojo', 'P0007-S', 1, 259.90, 0.00, 259.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(134, 73, 50, 'Abrigo Lana Largo', 'M / Rojo', 'P0007-M', 2, 259.90, 0.00, 519.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(135, 74, 56, 'Cinturón Cuero', 'Único', 'P0010', 1, 59.90, 0.00, 59.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(136, 75, 38, 'Blusa Seda Marfil', 'M / Rojo', 'P0003-M', 2, 89.90, 0.00, 179.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(137, 76, 49, 'Abrigo Lana Largo', 'S / Rojo', 'P0007-S', 1, 259.90, 0.00, 259.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(138, 77, 32, 'Vestido Satinado Noche', 'M / Negro', 'P0001-M', 1, 189.90, 0.00, 189.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(139, 77, 40, 'Blusa Manga Larga', 'S / Azul', 'P0004-S', 2, 79.90, 0.00, 159.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(140, 77, 41, 'Blusa Manga Larga', 'M / Azul', 'P0004-M', 2, 79.90, 0.00, 159.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(141, 78, 34, 'Vestido Floral Casual', 'S / Blanco', 'P0002-S', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(142, 78, 44, 'Pantalón Palazzo', 'M / Negro', 'P0005-M', 2, 119.90, 0.00, 239.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(143, 79, 35, 'Vestido Floral Casual', 'M / Blanco', 'P0002-M', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(144, 79, 43, 'Pantalón Palazzo', 'S / Negro', 'P0005-S', 2, 119.90, 0.00, 239.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(145, 80, 33, 'Vestido Satinado Noche', 'L / Blanco', 'P0001-L', 1, 189.90, 0.00, 189.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(146, 80, 46, 'Jean Slim Tiro Alto', 'S / Blanco', 'P0006-S', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(147, 81, 35, 'Vestido Floral Casual', 'M / Blanco', 'P0002-M', 1, 129.90, 0.00, 129.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(148, 82, 42, 'Blusa Manga Larga', 'L / Negro', 'P0004-L', 1, 79.90, 0.00, 79.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(149, 83, 50, 'Abrigo Lana Largo', 'M / Rojo', 'P0007-M', 2, 259.90, 0.00, 519.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(150, 84, 47, 'Jean Slim Tiro Alto', 'M / Blanco', 'P0006-M', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(151, 85, 35, 'Vestido Floral Casual', 'M / Blanco', 'P0002-M', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(152, 85, 36, 'Vestido Floral Casual', 'L / Rojo', 'P0002-L', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(153, 85, 50, 'Abrigo Lana Largo', 'M / Rojo', 'P0007-M', 2, 259.90, 0.00, 519.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(154, 86, 36, 'Vestido Floral Casual', 'L / Rojo', 'P0002-L', 1, 129.90, 0.00, 129.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(155, 86, 48, 'Jean Slim Tiro Alto', 'L / Rojo', 'P0006-L', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(156, 86, 49, 'Abrigo Lana Largo', 'S / Rojo', 'P0007-S', 1, 259.90, 0.00, 259.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(157, 87, 43, 'Pantalón Palazzo', 'S / Negro', 'P0005-S', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(158, 88, 35, 'Vestido Floral Casual', 'M / Blanco', 'P0002-M', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(159, 88, 45, 'Pantalón Palazzo', 'L / Blanco', 'P0005-L', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(160, 89, 34, 'Vestido Floral Casual', 'S / Blanco', 'P0002-S', 1, 129.90, 0.00, 129.90, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(161, 89, 39, 'Blusa Seda Marfil', 'L / Azul', 'P0003-L', 2, 89.90, 0.00, 179.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(162, 90, 47, 'Jean Slim Tiro Alto', 'M / Blanco', 'P0006-M', 2, 139.90, 0.00, 279.80, '2026-07-23 14:18:22', '2026-07-23 14:18:22'),
	(163, 91, 37, 'Blusa Seda Marfil', 'S / Rojo', 'P0003-S', 2, 89.90, 0.00, 179.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(164, 91, 45, 'Pantalón Palazzo', 'L / Blanco', 'P0005-L', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(165, 92, 36, 'Vestido Floral Casual', 'L / Rojo', 'P0002-L', 1, 129.90, 0.00, 129.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(166, 92, 48, 'Jean Slim Tiro Alto', 'L / Rojo', 'P0006-L', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(167, 93, 39, 'Blusa Seda Marfil', 'L / Azul', 'P0003-L', 1, 89.90, 0.00, 89.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(168, 94, 42, 'Blusa Manga Larga', 'L / Negro', 'P0004-L', 2, 79.90, 0.00, 159.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(169, 94, 47, 'Jean Slim Tiro Alto', 'M / Blanco', 'P0006-M', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(170, 95, 38, 'Blusa Seda Marfil', 'M / Rojo', 'P0003-M', 2, 89.90, 0.00, 179.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(171, 95, 43, 'Pantalón Palazzo', 'S / Negro', 'P0005-S', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(172, 95, 45, 'Pantalón Palazzo', 'L / Blanco', 'P0005-L', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(173, 96, 34, 'Vestido Floral Casual', 'S / Blanco', 'P0002-S', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(174, 96, 36, 'Vestido Floral Casual', 'L / Rojo', 'P0002-L', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(175, 96, 46, 'Jean Slim Tiro Alto', 'S / Blanco', 'P0006-S', 2, 139.90, 0.00, 279.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(176, 97, 32, 'Vestido Satinado Noche', 'M / Negro', 'P0001-M', 1, 189.90, 0.00, 189.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(177, 97, 41, 'Blusa Manga Larga', 'M / Azul', 'P0004-M', 1, 79.90, 0.00, 79.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(178, 98, 44, 'Pantalón Palazzo', 'M / Negro', 'P0005-M', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(179, 98, 52, 'Blazer Entallado', 'S / Azul', 'P0008-S', 2, 179.90, 0.00, 359.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(180, 99, 56, 'Cinturón Cuero', 'Único', 'P0010', 2, 59.90, 0.00, 119.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(181, 100, 54, 'Blazer Entallado', 'L / Negro', 'P0008-L', 2, 179.90, 0.00, 359.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(182, 101, 45, 'Pantalón Palazzo', 'L / Blanco', 'P0005-L', 2, 119.90, 0.00, 239.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(183, 102, 32, 'Vestido Satinado Noche', 'M / Negro', 'P0001-M', 2, 189.90, 0.00, 379.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(184, 102, 44, 'Pantalón Palazzo', 'M / Negro', 'P0005-M', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(185, 103, 33, 'Vestido Satinado Noche', 'L / Blanco', 'P0001-L', 2, 189.90, 0.00, 379.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(186, 104, 33, 'Vestido Satinado Noche', 'L / Blanco', 'P0001-L', 1, 189.90, 0.00, 189.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(187, 104, 48, 'Jean Slim Tiro Alto', 'L / Rojo', 'P0006-L', 2, 139.90, 0.00, 279.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(188, 104, 56, 'Cinturón Cuero', 'Único', 'P0010', 1, 59.90, 0.00, 59.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(189, 105, 43, 'Pantalón Palazzo', 'S / Negro', 'P0005-S', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(190, 106, 42, 'Blusa Manga Larga', 'L / Negro', 'P0004-L', 2, 79.90, 0.00, 159.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(191, 107, 48, 'Jean Slim Tiro Alto', 'L / Rojo', 'P0006-L', 2, 139.90, 0.00, 279.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(192, 108, 51, 'Abrigo Lana Largo', 'L / Azul', 'P0007-L', 1, 259.90, 0.00, 259.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(193, 109, 45, 'Pantalón Palazzo', 'L / Blanco', 'P0005-L', 2, 119.90, 0.00, 239.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(194, 110, 43, 'Pantalón Palazzo', 'S / Negro', 'P0005-S', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(195, 110, 53, 'Blazer Entallado', 'M / Azul', 'P0008-M', 2, 179.90, 0.00, 359.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(196, 111, 34, 'Vestido Floral Casual', 'S / Blanco', 'P0002-S', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(197, 111, 47, 'Jean Slim Tiro Alto', 'M / Blanco', 'P0006-M', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(198, 111, 53, 'Blazer Entallado', 'M / Azul', 'P0008-M', 2, 179.90, 0.00, 359.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(199, 112, 33, 'Vestido Satinado Noche', 'L / Blanco', 'P0001-L', 1, 189.90, 0.00, 189.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(200, 112, 37, 'Blusa Seda Marfil', 'S / Rojo', 'P0003-S', 1, 89.90, 0.00, 89.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(201, 113, 36, 'Vestido Floral Casual', 'L / Rojo', 'P0002-L', 1, 129.90, 0.00, 129.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(202, 113, 44, 'Pantalón Palazzo', 'M / Negro', 'P0005-M', 1, 119.90, 0.00, 119.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(203, 114, 33, 'Vestido Satinado Noche', 'L / Blanco', 'P0001-L', 2, 189.90, 0.00, 379.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(204, 114, 42, 'Blusa Manga Larga', 'L / Negro', 'P0004-L', 2, 79.90, 0.00, 159.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(205, 115, 47, 'Jean Slim Tiro Alto', 'M / Blanco', 'P0006-M', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(206, 115, 50, 'Abrigo Lana Largo', 'M / Rojo', 'P0007-M', 1, 259.90, 0.00, 259.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(207, 115, 55, 'Cartera Cuero Premium', 'Único', 'P0009', 2, 219.90, 0.00, 439.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(208, 116, 38, 'Blusa Seda Marfil', 'M / Rojo', 'P0003-M', 2, 89.90, 0.00, 179.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(209, 116, 44, 'Pantalón Palazzo', 'M / Negro', 'P0005-M', 2, 119.90, 0.00, 239.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(210, 117, 34, 'Vestido Floral Casual', 'S / Blanco', 'P0002-S', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(211, 117, 39, 'Blusa Seda Marfil', 'L / Azul', 'P0003-L', 1, 89.90, 0.00, 89.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(212, 117, 41, 'Blusa Manga Larga', 'M / Azul', 'P0004-M', 1, 79.90, 0.00, 79.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(213, 118, 32, 'Vestido Satinado Noche', 'M / Negro', 'P0001-M', 2, 189.90, 0.00, 379.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(214, 118, 56, 'Cinturón Cuero', 'Único', 'P0010', 2, 59.90, 0.00, 119.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(215, 119, 43, 'Pantalón Palazzo', 'S / Negro', 'P0005-S', 2, 119.90, 0.00, 239.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(216, 120, 48, 'Jean Slim Tiro Alto', 'L / Rojo', 'P0006-L', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(217, 121, 39, 'Blusa Seda Marfil', 'L / Azul', 'P0003-L', 2, 89.90, 0.00, 179.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(218, 121, 50, 'Abrigo Lana Largo', 'M / Rojo', 'P0007-M', 1, 259.90, 0.00, 259.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(219, 122, 31, 'Vestido Satinado Noche', 'S / Negro', 'P0001-S', 1, 189.90, 0.00, 189.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(220, 122, 39, 'Blusa Seda Marfil', 'L / Azul', 'P0003-L', 1, 89.90, 0.00, 89.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(221, 122, 48, 'Jean Slim Tiro Alto', 'L / Rojo', 'P0006-L', 2, 139.90, 0.00, 279.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(222, 123, 33, 'Vestido Satinado Noche', 'L / Blanco', 'P0001-L', 1, 189.90, 0.00, 189.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(223, 124, 31, 'Vestido Satinado Noche', 'S / Negro', 'P0001-S', 2, 189.90, 0.00, 379.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(224, 124, 39, 'Blusa Seda Marfil', 'L / Azul', 'P0003-L', 2, 89.90, 0.00, 179.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(225, 124, 41, 'Blusa Manga Larga', 'M / Azul', 'P0004-M', 2, 79.90, 0.00, 159.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(226, 125, 46, 'Jean Slim Tiro Alto', 'S / Blanco', 'P0006-S', 2, 139.90, 0.00, 279.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(227, 126, 31, 'Vestido Satinado Noche', 'S / Negro', 'P0001-S', 2, 189.90, 0.00, 379.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(228, 126, 38, 'Blusa Seda Marfil', 'M / Rojo', 'P0003-M', 1, 89.90, 0.00, 89.90, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(229, 126, 41, 'Blusa Manga Larga', 'M / Azul', 'P0004-M', 2, 79.90, 0.00, 159.80, '2026-07-23 14:18:23', '2026-07-23 14:18:23'),
	(230, 127, 32, 'Vestido Satinado Noche', 'M / Negro', 'P0001-M', 1, 189.90, 0.00, 189.90, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(231, 127, 38, 'Blusa Seda Marfil', 'M / Rojo', 'P0003-M', 2, 89.90, 0.00, 179.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(232, 128, 31, 'Vestido Satinado Noche', 'S / Negro', 'P0001-S', 2, 189.90, 0.00, 379.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(233, 128, 34, 'Vestido Floral Casual', 'S / Blanco', 'P0002-S', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(234, 128, 41, 'Blusa Manga Larga', 'M / Azul', 'P0004-M', 1, 79.90, 0.00, 79.90, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(235, 129, 51, 'Abrigo Lana Largo', 'L / Azul', 'P0007-L', 2, 259.90, 0.00, 519.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(236, 130, 48, 'Jean Slim Tiro Alto', 'L / Rojo', 'P0006-L', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(237, 130, 54, 'Blazer Entallado', 'L / Negro', 'P0008-L', 2, 179.90, 0.00, 359.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(238, 130, 56, 'Cinturón Cuero', 'Único', 'P0010', 2, 59.90, 0.00, 119.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(239, 131, 33, 'Vestido Satinado Noche', 'L / Blanco', 'P0001-L', 2, 189.90, 0.00, 379.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(240, 131, 47, 'Jean Slim Tiro Alto', 'M / Blanco', 'P0006-M', 2, 139.90, 0.00, 279.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(241, 131, 48, 'Jean Slim Tiro Alto', 'L / Rojo', 'P0006-L', 1, 139.90, 0.00, 139.90, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(242, 132, 35, 'Vestido Floral Casual', 'M / Blanco', 'P0002-M', 1, 129.90, 0.00, 129.90, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(243, 132, 44, 'Pantalón Palazzo', 'M / Negro', 'P0005-M', 2, 119.90, 0.00, 239.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(244, 132, 50, 'Abrigo Lana Largo', 'M / Rojo', 'P0007-M', 1, 259.90, 0.00, 259.90, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(245, 133, 33, 'Vestido Satinado Noche', 'L / Blanco', 'P0001-L', 1, 189.90, 0.00, 189.90, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(246, 133, 36, 'Vestido Floral Casual', 'L / Rojo', 'P0002-L', 2, 129.90, 0.00, 259.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(247, 134, 41, 'Blusa Manga Larga', 'M / Azul', 'P0004-M', 1, 79.90, 0.00, 79.90, '2026-07-23 14:18:24', '2026-07-23 14:18:24'),
	(248, 134, 51, 'Abrigo Lana Largo', 'L / Azul', 'P0007-L', 2, 259.90, 0.00, 519.80, '2026-07-23 14:18:24', '2026-07-23 14:18:24');

-- Volcando estructura para tabla suite_saas_modas_integral.sale_returns
CREATE TABLE IF NOT EXISTS `sale_returns` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `sale_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total` decimal(12,2) NOT NULL DEFAULT '0.00',
  `reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'completed',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_returns_company_id_foreign` (`company_id`),
  KEY `sale_returns_sale_id_foreign` (`sale_id`),
  KEY `sale_returns_user_id_foreign` (`user_id`),
  CONSTRAINT `sale_returns_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sale_returns_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sale_returns_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.sale_returns: ~0 rows (aproximadamente)
DELETE FROM `sale_returns`;

-- Volcando estructura para tabla suite_saas_modas_integral.sale_return_items
CREATE TABLE IF NOT EXISTS `sale_return_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sale_return_id` bigint unsigned NOT NULL,
  `sale_item_id` bigint unsigned DEFAULT NULL,
  `product_variant_id` bigint unsigned DEFAULT NULL,
  `product_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `variant_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` int NOT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `line_total` decimal(12,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_return_items_sale_return_id_foreign` (`sale_return_id`),
  KEY `sale_return_items_sale_item_id_foreign` (`sale_item_id`),
  KEY `sale_return_items_product_variant_id_foreign` (`product_variant_id`),
  CONSTRAINT `sale_return_items_product_variant_id_foreign` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE SET NULL,
  CONSTRAINT `sale_return_items_sale_item_id_foreign` FOREIGN KEY (`sale_item_id`) REFERENCES `sale_items` (`id`) ON DELETE SET NULL,
  CONSTRAINT `sale_return_items_sale_return_id_foreign` FOREIGN KEY (`sale_return_id`) REFERENCES `sale_returns` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.sale_return_items: ~0 rows (aproximadamente)
DELETE FROM `sale_return_items`;

-- Volcando estructura para tabla suite_saas_modas_integral.stock_movements
CREATE TABLE IF NOT EXISTS `stock_movements` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `product_variant_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `type` enum('in','out','adjust') COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` int NOT NULL,
  `balance_after` int NOT NULL,
  `reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stock_movements_company_id_foreign` (`company_id`),
  KEY `stock_movements_product_variant_id_foreign` (`product_variant_id`),
  KEY `stock_movements_user_id_foreign` (`user_id`),
  CONSTRAINT `stock_movements_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `stock_movements_product_variant_id_foreign` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `stock_movements_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=249 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.stock_movements: ~124 rows (aproximadamente)
DELETE FROM `stock_movements`;
INSERT INTO `stock_movements` (`id`, `company_id`, `product_variant_id`, `user_id`, `type`, `quantity`, `balance_after`, `reason`, `created_at`, `updated_at`) VALUES
	(125, 1, 44, NULL, 'out', -2, 26, 'Venta V-000001', '2026-06-24 00:37:00', '2026-06-24 00:37:00'),
	(126, 1, 50, NULL, 'out', -2, 21, 'Venta V-000001', '2026-06-24 00:37:00', '2026-06-24 00:37:00'),
	(127, 1, 42, NULL, 'out', -1, 39, 'Venta V-000002', '2026-06-23 15:50:00', '2026-06-23 15:50:00'),
	(128, 1, 52, NULL, 'out', -1, 19, 'Venta V-000002', '2026-06-23 15:50:00', '2026-06-23 15:50:00'),
	(129, 1, 53, NULL, 'out', -2, 36, 'Venta V-000002', '2026-06-23 15:50:00', '2026-06-23 15:50:00'),
	(130, 1, 51, NULL, 'out', -2, 30, 'Venta V-000003', '2026-06-23 21:50:00', '2026-06-23 21:50:00'),
	(131, 1, 37, NULL, 'out', -1, 21, 'Venta V-000004', '2026-06-24 18:02:00', '2026-06-24 18:02:00'),
	(132, 1, 54, NULL, 'out', -2, 16, 'Venta V-000004', '2026-06-24 18:02:00', '2026-06-24 18:02:00'),
	(133, 1, 49, NULL, 'out', -1, 32, 'Venta V-000005', '2026-06-24 22:46:00', '2026-06-24 22:46:00'),
	(134, 1, 50, NULL, 'out', -2, 19, 'Venta V-000006', '2026-06-24 22:22:00', '2026-06-24 22:22:00'),
	(135, 1, 56, NULL, 'out', -1, 39, 'Venta V-000007', '2026-06-25 16:08:00', '2026-06-25 16:08:00'),
	(136, 1, 38, NULL, 'out', -2, 14, 'Venta V-000008', '2026-06-25 20:58:00', '2026-06-25 20:58:00'),
	(137, 1, 49, NULL, 'out', -1, 31, 'Venta V-000009', '2026-06-25 20:13:00', '2026-06-25 20:13:00'),
	(138, 1, 32, NULL, 'out', -1, 38, 'Venta V-000010', '2026-06-26 18:55:00', '2026-06-26 18:55:00'),
	(139, 1, 40, NULL, 'out', -2, 31, 'Venta V-000010', '2026-06-26 18:55:00', '2026-06-26 18:55:00'),
	(140, 1, 41, NULL, 'out', -2, 24, 'Venta V-000010', '2026-06-26 18:55:00', '2026-06-26 18:55:00'),
	(141, 1, 34, NULL, 'out', -2, 37, 'Venta V-000011', '2026-06-26 18:59:00', '2026-06-26 18:59:00'),
	(142, 1, 44, NULL, 'out', -2, 24, 'Venta V-000011', '2026-06-26 18:59:00', '2026-06-26 18:59:00'),
	(143, 1, 35, NULL, 'out', -2, 28, 'Venta V-000012', '2026-06-28 00:49:00', '2026-06-28 00:49:00'),
	(144, 1, 43, NULL, 'out', -2, 33, 'Venta V-000012', '2026-06-28 00:49:00', '2026-06-28 00:49:00'),
	(145, 1, 33, NULL, 'out', -1, 38, 'Venta V-000013', '2026-06-28 16:46:00', '2026-06-28 16:46:00'),
	(146, 1, 46, NULL, 'out', -1, 42, 'Venta V-000013', '2026-06-28 16:46:00', '2026-06-28 16:46:00'),
	(147, 1, 35, NULL, 'out', -1, 27, 'Venta V-000014', '2026-06-28 22:30:00', '2026-06-28 22:30:00'),
	(148, 1, 42, NULL, 'out', -1, 38, 'Venta V-000015', '2026-06-29 16:39:00', '2026-06-29 16:39:00'),
	(149, 1, 50, NULL, 'out', -2, 17, 'Venta V-000016', '2026-06-29 23:44:00', '2026-06-29 23:44:00'),
	(150, 1, 47, NULL, 'out', -1, 15, 'Venta V-000017', '2026-06-30 21:42:00', '2026-06-30 21:42:00'),
	(151, 1, 35, NULL, 'out', -2, 25, 'Venta V-000018', '2026-06-30 19:11:00', '2026-06-30 19:11:00'),
	(152, 1, 36, NULL, 'out', -2, 13, 'Venta V-000018', '2026-06-30 19:11:00', '2026-06-30 19:11:00'),
	(153, 1, 50, NULL, 'out', -2, 15, 'Venta V-000018', '2026-06-30 19:11:00', '2026-06-30 19:11:00'),
	(154, 1, 36, NULL, 'out', -1, 12, 'Venta V-000019', '2026-06-30 20:28:00', '2026-06-30 20:28:00'),
	(155, 1, 48, NULL, 'out', -1, 23, 'Venta V-000019', '2026-06-30 20:28:00', '2026-06-30 20:28:00'),
	(156, 1, 49, NULL, 'out', -1, 30, 'Venta V-000019', '2026-06-30 20:28:00', '2026-06-30 20:28:00'),
	(157, 1, 43, NULL, 'out', -1, 32, 'Venta V-000020', '2026-07-01 16:12:00', '2026-07-01 16:12:00'),
	(158, 1, 35, NULL, 'out', -2, 23, 'Venta V-000021', '2026-07-01 19:28:00', '2026-07-01 19:28:00'),
	(159, 1, 45, NULL, 'out', -1, 23, 'Venta V-000021', '2026-07-01 19:28:00', '2026-07-01 19:28:00'),
	(160, 1, 34, NULL, 'out', -1, 36, 'Venta V-000022', '2026-07-01 20:32:00', '2026-07-01 20:32:00'),
	(161, 1, 39, NULL, 'out', -2, 25, 'Venta V-000022', '2026-07-01 20:32:00', '2026-07-01 20:32:00'),
	(162, 1, 47, NULL, 'out', -2, 13, 'Venta V-000023', '2026-07-02 19:01:00', '2026-07-02 19:01:00'),
	(163, 1, 37, NULL, 'out', -2, 19, 'Venta V-000024', '2026-07-04 00:27:00', '2026-07-04 00:27:00'),
	(164, 1, 45, NULL, 'out', -1, 22, 'Venta V-000024', '2026-07-04 00:27:00', '2026-07-04 00:27:00'),
	(165, 1, 36, NULL, 'out', -1, 11, 'Venta V-000025', '2026-07-04 17:40:00', '2026-07-04 17:40:00'),
	(166, 1, 48, NULL, 'out', -1, 22, 'Venta V-000025', '2026-07-04 17:40:00', '2026-07-04 17:40:00'),
	(167, 1, 39, NULL, 'out', -1, 24, 'Venta V-000026', '2026-07-04 21:11:00', '2026-07-04 21:11:00'),
	(168, 1, 42, NULL, 'out', -2, 36, 'Venta V-000027', '2026-07-04 15:31:00', '2026-07-04 15:31:00'),
	(169, 1, 47, NULL, 'out', -1, 12, 'Venta V-000027', '2026-07-04 15:31:00', '2026-07-04 15:31:00'),
	(170, 1, 38, NULL, 'out', -2, 12, 'Venta V-000028', '2026-07-05 19:23:00', '2026-07-05 19:23:00'),
	(171, 1, 43, NULL, 'out', -1, 31, 'Venta V-000028', '2026-07-05 19:23:00', '2026-07-05 19:23:00'),
	(172, 1, 45, NULL, 'out', -1, 21, 'Venta V-000028', '2026-07-05 19:23:00', '2026-07-05 19:23:00'),
	(173, 1, 34, NULL, 'out', -2, 34, 'Venta V-000029', '2026-07-05 20:14:00', '2026-07-05 20:14:00'),
	(174, 1, 36, NULL, 'out', -2, 9, 'Venta V-000029', '2026-07-05 20:14:00', '2026-07-05 20:14:00'),
	(175, 1, 46, NULL, 'out', -2, 40, 'Venta V-000029', '2026-07-05 20:14:00', '2026-07-05 20:14:00'),
	(176, 1, 32, NULL, 'out', -1, 37, 'Venta V-000030', '2026-07-05 18:06:00', '2026-07-05 18:06:00'),
	(177, 1, 41, NULL, 'out', -1, 23, 'Venta V-000030', '2026-07-05 18:06:00', '2026-07-05 18:06:00'),
	(178, 1, 44, NULL, 'out', -1, 23, 'Venta V-000031', '2026-07-07 01:26:00', '2026-07-07 01:26:00'),
	(179, 1, 52, NULL, 'out', -2, 17, 'Venta V-000031', '2026-07-07 01:26:00', '2026-07-07 01:26:00'),
	(180, 1, 56, NULL, 'out', -2, 37, 'Venta V-000032', '2026-07-06 18:27:00', '2026-07-06 18:27:00'),
	(181, 1, 54, NULL, 'out', -2, 14, 'Venta V-000033', '2026-07-07 18:48:00', '2026-07-07 18:48:00'),
	(182, 1, 45, NULL, 'out', -2, 19, 'Venta V-000034', '2026-07-07 18:17:00', '2026-07-07 18:17:00'),
	(183, 1, 32, NULL, 'out', -2, 35, 'Venta V-000035', '2026-07-08 17:33:00', '2026-07-08 17:33:00'),
	(184, 1, 44, NULL, 'out', -1, 22, 'Venta V-000035', '2026-07-08 17:33:00', '2026-07-08 17:33:00'),
	(185, 1, 33, NULL, 'out', -2, 36, 'Venta V-000036', '2026-07-08 18:06:00', '2026-07-08 18:06:00'),
	(186, 1, 33, NULL, 'out', -1, 35, 'Venta V-000037', '2026-07-08 18:50:00', '2026-07-08 18:50:00'),
	(187, 1, 48, NULL, 'out', -2, 20, 'Venta V-000037', '2026-07-08 18:50:00', '2026-07-08 18:50:00'),
	(188, 1, 56, NULL, 'out', -1, 36, 'Venta V-000037', '2026-07-08 18:50:00', '2026-07-08 18:50:00'),
	(189, 1, 43, NULL, 'out', -1, 30, 'Venta V-000038', '2026-07-09 16:52:00', '2026-07-09 16:52:00'),
	(190, 1, 42, NULL, 'out', -2, 34, 'Venta V-000039', '2026-07-09 18:24:00', '2026-07-09 18:24:00'),
	(191, 1, 48, NULL, 'out', -2, 18, 'Venta V-000040', '2026-07-09 22:00:00', '2026-07-09 22:00:00'),
	(192, 1, 51, NULL, 'out', -1, 29, 'Venta V-000041', '2026-07-11 00:56:00', '2026-07-11 00:56:00'),
	(193, 1, 45, NULL, 'out', -2, 17, 'Venta V-000042', '2026-07-10 23:35:00', '2026-07-10 23:35:00'),
	(194, 1, 43, NULL, 'out', -1, 29, 'Venta V-000043', '2026-07-11 23:14:00', '2026-07-11 23:14:00'),
	(195, 1, 53, NULL, 'out', -2, 34, 'Venta V-000043', '2026-07-11 23:14:00', '2026-07-11 23:14:00'),
	(196, 1, 34, NULL, 'out', -2, 32, 'Venta V-000044', '2026-07-11 16:23:00', '2026-07-11 16:23:00'),
	(197, 1, 47, NULL, 'out', -1, 11, 'Venta V-000044', '2026-07-11 16:23:00', '2026-07-11 16:23:00'),
	(198, 1, 53, NULL, 'out', -2, 32, 'Venta V-000044', '2026-07-11 16:23:00', '2026-07-11 16:23:00'),
	(199, 1, 33, NULL, 'out', -1, 34, 'Venta V-000045', '2026-07-12 17:39:00', '2026-07-12 17:39:00'),
	(200, 1, 37, NULL, 'out', -1, 18, 'Venta V-000045', '2026-07-12 17:39:00', '2026-07-12 17:39:00'),
	(201, 1, 36, NULL, 'out', -1, 8, 'Venta V-000046', '2026-07-12 23:58:00', '2026-07-12 23:58:00'),
	(202, 1, 44, NULL, 'out', -1, 21, 'Venta V-000046', '2026-07-12 23:58:00', '2026-07-12 23:58:00'),
	(203, 1, 33, NULL, 'out', -2, 32, 'Venta V-000047', '2026-07-13 22:55:00', '2026-07-13 22:55:00'),
	(204, 1, 42, NULL, 'out', -2, 32, 'Venta V-000047', '2026-07-13 22:55:00', '2026-07-13 22:55:00'),
	(205, 1, 47, NULL, 'out', -1, 10, 'Venta V-000048', '2026-07-13 19:53:00', '2026-07-13 19:53:00'),
	(206, 1, 50, NULL, 'out', -1, 14, 'Venta V-000048', '2026-07-13 19:53:00', '2026-07-13 19:53:00'),
	(207, 1, 55, NULL, 'out', -2, 38, 'Venta V-000048', '2026-07-13 19:53:00', '2026-07-13 19:53:00'),
	(208, 1, 38, NULL, 'out', -2, 10, 'Venta V-000049', '2026-07-13 18:18:00', '2026-07-13 18:18:00'),
	(209, 1, 44, NULL, 'out', -2, 19, 'Venta V-000049', '2026-07-13 18:18:00', '2026-07-13 18:18:00'),
	(210, 1, 34, NULL, 'out', -2, 30, 'Venta V-000050', '2026-07-14 19:17:00', '2026-07-14 19:17:00'),
	(211, 1, 39, NULL, 'out', -1, 23, 'Venta V-000050', '2026-07-14 19:17:00', '2026-07-14 19:17:00'),
	(212, 1, 41, NULL, 'out', -1, 22, 'Venta V-000050', '2026-07-14 19:17:00', '2026-07-14 19:17:00'),
	(213, 1, 32, NULL, 'out', -2, 33, 'Venta V-000051', '2026-07-14 21:15:00', '2026-07-14 21:15:00'),
	(214, 1, 56, NULL, 'out', -2, 34, 'Venta V-000051', '2026-07-14 21:15:00', '2026-07-14 21:15:00'),
	(215, 1, 43, NULL, 'out', -2, 27, 'Venta V-000052', '2026-07-16 00:34:00', '2026-07-16 00:34:00'),
	(216, 1, 48, NULL, 'out', -1, 17, 'Venta V-000053', '2026-07-15 22:47:00', '2026-07-15 22:47:00'),
	(217, 1, 39, NULL, 'out', -2, 21, 'Venta V-000054', '2026-07-16 22:16:00', '2026-07-16 22:16:00'),
	(218, 1, 50, NULL, 'out', -1, 13, 'Venta V-000054', '2026-07-16 22:16:00', '2026-07-16 22:16:00'),
	(219, 1, 31, NULL, 'out', -1, 25, 'Venta V-000055', '2026-07-16 20:16:00', '2026-07-16 20:16:00'),
	(220, 1, 39, NULL, 'out', -1, 20, 'Venta V-000055', '2026-07-16 20:16:00', '2026-07-16 20:16:00'),
	(221, 1, 48, NULL, 'out', -2, 15, 'Venta V-000055', '2026-07-16 20:16:00', '2026-07-16 20:16:00'),
	(222, 1, 33, NULL, 'out', -1, 31, 'Venta V-000056', '2026-07-18 01:03:00', '2026-07-18 01:03:00'),
	(223, 1, 31, NULL, 'out', -2, 23, 'Venta V-000057', '2026-07-18 16:14:00', '2026-07-18 16:14:00'),
	(224, 1, 39, NULL, 'out', -2, 18, 'Venta V-000057', '2026-07-18 16:14:00', '2026-07-18 16:14:00'),
	(225, 1, 41, NULL, 'out', -2, 20, 'Venta V-000057', '2026-07-18 16:14:00', '2026-07-18 16:14:00'),
	(226, 1, 46, NULL, 'out', -2, 38, 'Venta V-000058', '2026-07-19 20:17:00', '2026-07-19 20:17:00'),
	(227, 1, 31, NULL, 'out', -2, 21, 'Venta V-000059', '2026-07-19 18:24:00', '2026-07-19 18:24:00'),
	(228, 1, 38, NULL, 'out', -1, 9, 'Venta V-000059', '2026-07-19 18:24:00', '2026-07-19 18:24:00'),
	(229, 1, 41, NULL, 'out', -2, 18, 'Venta V-000059', '2026-07-19 18:24:00', '2026-07-19 18:24:00'),
	(230, 1, 32, NULL, 'out', -1, 32, 'Venta V-000060', '2026-07-20 21:48:00', '2026-07-20 21:48:00'),
	(231, 1, 38, NULL, 'out', -2, 7, 'Venta V-000060', '2026-07-20 21:48:00', '2026-07-20 21:48:00'),
	(232, 1, 31, NULL, 'out', -2, 19, 'Venta V-000061', '2026-07-20 16:16:00', '2026-07-20 16:16:00'),
	(233, 1, 34, NULL, 'out', -2, 28, 'Venta V-000061', '2026-07-20 16:16:00', '2026-07-20 16:16:00'),
	(234, 1, 41, NULL, 'out', -1, 17, 'Venta V-000061', '2026-07-20 16:16:00', '2026-07-20 16:16:00'),
	(235, 1, 51, NULL, 'out', -2, 27, 'Venta V-000062', '2026-07-20 21:23:00', '2026-07-20 21:23:00'),
	(236, 1, 48, NULL, 'out', -1, 14, 'Venta V-000063', '2026-07-22 01:51:00', '2026-07-22 01:51:00'),
	(237, 1, 54, NULL, 'out', -2, 12, 'Venta V-000063', '2026-07-22 01:51:00', '2026-07-22 01:51:00'),
	(238, 1, 56, NULL, 'out', -2, 32, 'Venta V-000063', '2026-07-22 01:51:00', '2026-07-22 01:51:00'),
	(239, 1, 33, NULL, 'out', -2, 29, 'Venta V-000064', '2026-07-22 16:51:00', '2026-07-22 16:51:00'),
	(240, 1, 47, NULL, 'out', -2, 8, 'Venta V-000064', '2026-07-22 16:51:00', '2026-07-22 16:51:00'),
	(241, 1, 48, NULL, 'out', -1, 13, 'Venta V-000064', '2026-07-22 16:51:00', '2026-07-22 16:51:00'),
	(242, 1, 35, NULL, 'out', -1, 22, 'Venta V-000065', '2026-07-23 00:02:00', '2026-07-23 00:02:00'),
	(243, 1, 44, NULL, 'out', -2, 17, 'Venta V-000065', '2026-07-23 00:02:00', '2026-07-23 00:02:00'),
	(244, 1, 50, NULL, 'out', -1, 12, 'Venta V-000065', '2026-07-23 00:02:00', '2026-07-23 00:02:00'),
	(245, 1, 33, NULL, 'out', -1, 28, 'Venta V-000066', '2026-07-23 17:01:00', '2026-07-23 17:01:00'),
	(246, 1, 36, NULL, 'out', -2, 6, 'Venta V-000066', '2026-07-23 17:01:00', '2026-07-23 17:01:00'),
	(247, 1, 41, NULL, 'out', -1, 16, 'Venta V-000067', '2026-07-23 15:21:00', '2026-07-23 15:21:00'),
	(248, 1, 51, NULL, 'out', -2, 25, 'Venta V-000067', '2026-07-23 15:21:00', '2026-07-23 15:21:00');

-- Volcando estructura para tabla suite_saas_modas_integral.stores
CREATE TABLE IF NOT EXISTS `stores` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_main` tinyint(1) NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `stores_company_id_foreign` (`company_id`),
  CONSTRAINT `stores_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.stores: ~0 rows (aproximadamente)
DELETE FROM `stores`;

-- Volcando estructura para tabla suite_saas_modas_integral.store_stocks
CREATE TABLE IF NOT EXISTS `store_stocks` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `store_id` bigint unsigned NOT NULL,
  `product_variant_id` bigint unsigned NOT NULL,
  `stock` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `store_stocks_store_id_product_variant_id_unique` (`store_id`,`product_variant_id`),
  KEY `store_stocks_product_variant_id_foreign` (`product_variant_id`),
  CONSTRAINT `store_stocks_product_variant_id_foreign` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE CASCADE,
  CONSTRAINT `store_stocks_store_id_foreign` FOREIGN KEY (`store_id`) REFERENCES `stores` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.store_stocks: ~0 rows (aproximadamente)
DELETE FROM `store_stocks`;

-- Volcando estructura para tabla suite_saas_modas_integral.subscriptions
CREATE TABLE IF NOT EXISTS `subscriptions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `plan_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `plan_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `unit_price` decimal(12,2) NOT NULL DEFAULT '0.00',
  `duration` int unsigned NOT NULL DEFAULT '1',
  `unit` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'mes',
  `discount` decimal(12,2) NOT NULL DEFAULT '0.00',
  `discount_type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'amount',
  `total` decimal(12,2) NOT NULL DEFAULT '0.00',
  `starts_at` date NOT NULL,
  `ends_at` date NOT NULL,
  `method` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'manual',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `subscriptions_company_id_foreign` (`company_id`),
  KEY `subscriptions_plan_id_foreign` (`plan_id`),
  KEY `subscriptions_user_id_foreign` (`user_id`),
  CONSTRAINT `subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `subscriptions_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `plans` (`id`) ON DELETE SET NULL,
  CONSTRAINT `subscriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.subscriptions: ~0 rows (aproximadamente)
DELETE FROM `subscriptions`;

-- Volcando estructura para tabla suite_saas_modas_integral.suppliers
CREATE TABLE IF NOT EXISTS `suppliers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tax_id` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `suppliers_company_id_foreign` (`company_id`),
  CONSTRAINT `suppliers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.suppliers: ~1 rows (aproximadamente)
DELETE FROM `suppliers`;
INSERT INTO `suppliers` (`id`, `company_id`, `name`, `tax_id`, `contact`, `email`, `phone`, `address`, `active`, `created_at`, `updated_at`) VALUES
	(2, 1, 'Textiles del Sur SAC', '20504030201', NULL, NULL, NULL, NULL, 1, '2026-07-23 14:18:22', '2026-07-23 14:18:22');

-- Volcando estructura para tabla suite_saas_modas_integral.transfers
CREATE TABLE IF NOT EXISTS `transfers` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `from_store_id` bigint unsigned NOT NULL,
  `to_store_id` bigint unsigned NOT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'completed',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transfers_company_id_foreign` (`company_id`),
  KEY `transfers_user_id_foreign` (`user_id`),
  KEY `transfers_from_store_id_foreign` (`from_store_id`),
  KEY `transfers_to_store_id_foreign` (`to_store_id`),
  CONSTRAINT `transfers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transfers_from_store_id_foreign` FOREIGN KEY (`from_store_id`) REFERENCES `stores` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transfers_to_store_id_foreign` FOREIGN KEY (`to_store_id`) REFERENCES `stores` (`id`) ON DELETE CASCADE,
  CONSTRAINT `transfers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.transfers: ~0 rows (aproximadamente)
DELETE FROM `transfers`;

-- Volcando estructura para tabla suite_saas_modas_integral.transfer_items
CREATE TABLE IF NOT EXISTS `transfer_items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `transfer_id` bigint unsigned NOT NULL,
  `product_variant_id` bigint unsigned DEFAULT NULL,
  `product_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `variant_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transfer_items_transfer_id_foreign` (`transfer_id`),
  KEY `transfer_items_product_variant_id_foreign` (`product_variant_id`),
  CONSTRAINT `transfer_items_product_variant_id_foreign` FOREIGN KEY (`product_variant_id`) REFERENCES `product_variants` (`id`) ON DELETE SET NULL,
  CONSTRAINT `transfer_items_transfer_id_foreign` FOREIGN KEY (`transfer_id`) REFERENCES `transfers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.transfer_items: ~0 rows (aproximadamente)
DELETE FROM `transfer_items`;

-- Volcando estructura para tabla suite_saas_modas_integral.users
CREATE TABLE IF NOT EXISTS `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `company_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `role` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'admin',
  `avatar_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  KEY `users_company_id_foreign` (`company_id`),
  CONSTRAINT `users_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla suite_saas_modas_integral.users: ~3 rows (aproximadamente)
DELETE FROM `users`;
INSERT INTO `users` (`id`, `company_id`, `name`, `email`, `email_verified_at`, `password`, `role`, `avatar_path`, `active`, `remember_token`, `created_at`, `updated_at`) VALUES
	(1, NULL, 'Super Admin', 'superadmin@modasuite.test', NULL, '$2y$12$XoPjAORU3d4cAqBZ6ez0zOAjIMKtrj3.va/VqTYg7B73xbdDYVsvC', 'superadmin', NULL, 1, NULL, '2026-07-23 14:18:14', '2026-07-27 05:54:47'),
	(2, 1, 'Jessica Doe', 'admin@modasuite.test', NULL, '$2y$12$davQBy.s53rlLL5FMkpgKOvps76jglHNxKS0UX8aYAeYq63Fjv2pW', 'admin', NULL, 1, NULL, '2026-07-23 14:18:14', '2026-07-27 05:54:28'),
	(3, 2, 'Rocío Salazar', 'joyeria.admin@modasuite.test', NULL, '$2y$12$Q8sg6qyojVgXTiBsA80B0ucgE2mJ26nf/lQYl.KFdTtf1a.qN3/uG', 'admin', NULL, 1, NULL, '2026-07-23 14:18:24', '2026-07-23 14:18:24');

/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
