-- --------------------------------------------------------
-- 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 saas_taller_automotriz
CREATE DATABASE IF NOT EXISTS `saas_taller_automotriz` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `saas_taller_automotriz`;

-- Volcando estructura para tabla saas_taller_automotriz.citas
CREATE TABLE IF NOT EXISTS `citas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cliente_id` bigint unsigned DEFAULT NULL,
  `vehiculo_id` bigint unsigned DEFAULT NULL,
  `mecanico_id` bigint unsigned DEFAULT NULL,
  `titulo` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fecha_hora` datetime NOT NULL,
  `duracion_min` int NOT NULL DEFAULT '60',
  `motivo` text COLLATE utf8mb4_unicode_ci,
  `estado` enum('pendiente','confirmada','atendida','cancelada') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pendiente',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `citas_cliente_id_foreign` (`cliente_id`),
  KEY `citas_vehiculo_id_foreign` (`vehiculo_id`),
  KEY `citas_mecanico_id_foreign` (`mecanico_id`),
  CONSTRAINT `citas_cliente_id_foreign` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`) ON DELETE SET NULL,
  CONSTRAINT `citas_mecanico_id_foreign` FOREIGN KEY (`mecanico_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `citas_vehiculo_id_foreign` FOREIGN KEY (`vehiculo_id`) REFERENCES `vehiculos` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.citas: ~8 rows (aproximadamente)
DELETE FROM `citas`;
INSERT INTO `citas` (`id`, `cliente_id`, `vehiculo_id`, `mecanico_id`, `titulo`, `fecha_hora`, `duracion_min`, `motivo`, `estado`, `created_at`, `updated_at`) VALUES
	(1, 2, 2, 5, 'Mantenimiento preventivo', '2026-07-07 15:00:43', 60, 'Cliente solicita revisión general.', 'confirmada', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(2, 2, 2, 3, 'Mantenimiento preventivo', '2026-07-05 12:00:43', 60, 'Cliente solicita revisión general.', 'confirmada', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(3, 3, 3, 4, 'Mantenimiento preventivo', '2026-07-04 13:00:43', 60, 'Cliente solicita revisión general.', 'confirmada', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(4, 3, 3, 4, 'Mantenimiento preventivo', '2026-07-12 10:00:43', 60, 'Cliente solicita revisión general.', 'pendiente', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(5, 5, 5, 2, 'Mantenimiento preventivo', '2026-07-12 15:00:43', 60, 'Cliente solicita revisión general.', 'confirmada', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(6, 4, 4, 5, 'Mantenimiento preventivo', '2026-07-06 17:00:43', 60, 'Cliente solicita revisión general.', 'pendiente', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(7, 3, 3, 2, 'Mantenimiento preventivo', '2026-07-06 11:00:43', 60, 'Cliente solicita revisión general.', 'pendiente', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(8, 5, 5, 5, 'Mantenimiento preventivo', '2026-07-07 11:00:43', 60, 'Cliente solicita revisión general.', 'pendiente', '2026-07-04 02:52:43', '2026-07-04 02:52:43');

-- Volcando estructura para tabla saas_taller_automotriz.clientes
CREATE TABLE IF NOT EXISTS `clientes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tipo_documento` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'DNI',
  `documento` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nombre` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `apellidos` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `razon_social` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ciudad` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tipo` enum('persona','empresa') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'persona',
  `observaciones` text COLLATE utf8mb4_unicode_ci,
  `activo` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.clientes: ~6 rows (aproximadamente)
DELETE FROM `clientes`;
INSERT INTO `clientes` (`id`, `tipo_documento`, `documento`, `nombre`, `apellidos`, `razon_social`, `telefono`, `email`, `direccion`, `ciudad`, `tipo`, `observaciones`, `activo`, `created_at`, `updated_at`) VALUES
	(1, 'DNI', '45678912', 'Juan', 'Pérez Gómez', NULL, '987654321', 'juan.perez@gmail.com', NULL, 'Lima', 'persona', NULL, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(2, 'DNI', '41236547', 'María', 'López Vargas', NULL, '912345678', 'maria.lopez@gmail.com', NULL, 'Lima', 'persona', NULL, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(3, 'DNI', '40012345', 'Pedro', 'Sánchez Ruiz', NULL, '998877665', 'pedro.sanchez@gmail.com', NULL, 'Lima', 'persona', NULL, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(4, 'DNI', '44556677', 'Ana', 'Flores Díaz', NULL, '955443322', 'ana.flores@gmail.com', NULL, 'Lima', 'persona', NULL, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(5, 'DNI', '43219876', 'Roberto', 'Castro León', NULL, '966554433', 'roberto.castro@gmail.com', NULL, 'Lima', 'persona', NULL, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(6, 'RUC', '20601234567', 'Transportes El Rápido', NULL, 'Transportes El Rápido S.A.C.', '014441122', 'flota@elrapido.com', NULL, 'Lima', 'empresa', NULL, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43');

-- Volcando estructura para tabla saas_taller_automotriz.compras
CREATE TABLE IF NOT EXISTS `compras` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `numero` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `proveedor_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `fecha` date NOT NULL,
  `tipo_documento` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'factura',
  `documento_ref` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subtotal` decimal(12,2) NOT NULL DEFAULT '0.00',
  `impuesto` decimal(12,2) NOT NULL DEFAULT '0.00',
  `total` decimal(12,2) NOT NULL DEFAULT '0.00',
  `estado` enum('registrada','anulada') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'registrada',
  `observaciones` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `compras_numero_unique` (`numero`),
  KEY `compras_proveedor_id_foreign` (`proveedor_id`),
  KEY `compras_user_id_foreign` (`user_id`),
  CONSTRAINT `compras_proveedor_id_foreign` FOREIGN KEY (`proveedor_id`) REFERENCES `proveedores` (`id`) ON DELETE CASCADE,
  CONSTRAINT `compras_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.compras: ~12 rows (aproximadamente)
DELETE FROM `compras`;
INSERT INTO `compras` (`id`, `numero`, `proveedor_id`, `user_id`, `fecha`, `tipo_documento`, `documento_ref`, `subtotal`, `impuesto`, `total`, `estado`, `observaciones`, `created_at`, `updated_at`) VALUES
	(1, 'CMP-0001', 2, 1, '2026-02-15', 'factura', 'F129-6875', 3128.00, 563.04, 3691.04, 'registrada', NULL, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(2, 'CMP-0002', 3, 1, '2026-04-29', 'factura', 'F111-9564', 4885.00, 879.30, 5764.30, 'registrada', NULL, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(3, 'CMP-0003', 1, 1, '2026-05-13', 'factura', 'F485-8104', 823.00, 148.14, 971.14, 'registrada', NULL, '2026-07-04 10:29:18', '2026-07-04 10:29:19'),
	(4, 'CMP-0004', 2, 1, '2026-01-23', 'factura', 'F271-6224', 5435.00, 978.30, 6413.30, 'registrada', NULL, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(5, 'CMP-0005', 2, 1, '2026-04-29', 'factura', 'F278-3288', 2219.00, 399.42, 2618.42, 'registrada', NULL, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(6, 'CMP-0006', 2, 1, '2026-06-17', 'factura', 'F567-4765', 2650.00, 477.00, 3127.00, 'registrada', NULL, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(7, 'CMP-0007', 2, 1, '2026-02-25', 'factura', 'F923-2656', 2787.00, 501.66, 3288.66, 'registrada', NULL, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(8, 'CMP-0008', 1, 1, '2026-03-31', 'factura', 'F192-7476', 4740.00, 853.20, 5593.20, 'registrada', NULL, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(9, 'CMP-0009', 3, 1, '2026-04-23', 'factura', 'F132-6657', 4170.00, 750.60, 4920.60, 'registrada', NULL, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(10, 'CMP-0010', 1, 1, '2026-06-03', 'factura', 'F914-5285', 1365.00, 245.70, 1610.70, 'registrada', NULL, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(11, 'CMP-0011', 2, 1, '2026-03-12', 'factura', 'F989-3839', 1949.00, 350.82, 2299.82, 'registrada', NULL, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(12, 'CMP-0012', 3, 1, '2026-05-13', 'factura', 'F145-3757', 780.00, 140.40, 920.40, 'registrada', NULL, '2026-07-04 10:29:19', '2026-07-04 10:29:19');

-- Volcando estructura para tabla saas_taller_automotriz.compra_detalle
CREATE TABLE IF NOT EXISTS `compra_detalle` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `compra_id` bigint unsigned NOT NULL,
  `repuesto_id` bigint unsigned DEFAULT NULL,
  `descripcion` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cantidad` int NOT NULL DEFAULT '1',
  `precio` decimal(12,2) NOT NULL DEFAULT '0.00',
  `subtotal` decimal(12,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `compra_detalle_compra_id_foreign` (`compra_id`),
  KEY `compra_detalle_repuesto_id_foreign` (`repuesto_id`),
  CONSTRAINT `compra_detalle_compra_id_foreign` FOREIGN KEY (`compra_id`) REFERENCES `compras` (`id`) ON DELETE CASCADE,
  CONSTRAINT `compra_detalle_repuesto_id_foreign` FOREIGN KEY (`repuesto_id`) REFERENCES `repuestos` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.compra_detalle: ~36 rows (aproximadamente)
DELETE FROM `compra_detalle`;
INSERT INTO `compra_detalle` (`id`, `compra_id`, `repuesto_id`, `descripcion`, `cantidad`, `precio`, `subtotal`, `created_at`, `updated_at`) VALUES
	(1, 1, 4, 'Batería 12V 70Ah', 13, 180.00, 2340.00, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(2, 1, 5, 'Bujías (juego x4)', 17, 40.00, 680.00, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(3, 1, 6, 'Filtro de aire', 6, 18.00, 108.00, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(4, 2, 4, 'Batería 12V 70Ah', 17, 180.00, 3060.00, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(5, 2, 5, 'Bujías (juego x4)', 18, 40.00, 720.00, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(6, 2, 7, 'Correa de distribución', 13, 85.00, 1105.00, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(7, 3, 1, 'Filtro de aceite', 5, 15.00, 75.00, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(8, 3, 2, 'Aceite 15W-40 (1L)', 9, 22.00, 198.00, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(9, 3, 3, 'Pastillas de freno delanteras', 10, 55.00, 550.00, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(10, 4, 4, 'Batería 12V 70Ah', 20, 180.00, 3600.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(11, 4, 5, 'Bujías (juego x4)', 14, 40.00, 560.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(12, 4, 7, 'Correa de distribución', 15, 85.00, 1275.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(13, 5, 5, 'Bujías (juego x4)', 20, 40.00, 800.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(14, 5, 6, 'Filtro de aire', 8, 18.00, 144.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(15, 5, 7, 'Correa de distribución', 15, 85.00, 1275.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(16, 6, 3, 'Pastillas de freno delanteras', 10, 55.00, 550.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(17, 6, 5, 'Bujías (juego x4)', 10, 40.00, 400.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(18, 6, 7, 'Correa de distribución', 20, 85.00, 1700.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(19, 7, 3, 'Pastillas de freno delanteras', 15, 55.00, 825.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(20, 7, 4, 'Batería 12V 70Ah', 10, 180.00, 1800.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(21, 7, 6, 'Filtro de aire', 9, 18.00, 162.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(22, 8, 3, 'Pastillas de freno delanteras', 20, 55.00, 1100.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(23, 8, 4, 'Batería 12V 70Ah', 18, 180.00, 3240.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(24, 8, 5, 'Bujías (juego x4)', 10, 40.00, 400.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(25, 9, 1, 'Filtro de aceite', 13, 15.00, 195.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(26, 9, 4, 'Batería 12V 70Ah', 15, 180.00, 2700.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(27, 9, 7, 'Correa de distribución', 15, 85.00, 1275.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(28, 10, 1, 'Filtro de aceite', 13, 15.00, 195.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(29, 10, 5, 'Bujías (juego x4)', 8, 40.00, 320.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(30, 10, 7, 'Correa de distribución', 10, 85.00, 850.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(31, 11, 2, 'Aceite 15W-40 (1L)', 7, 22.00, 154.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(32, 11, 3, 'Pastillas de freno delanteras', 13, 55.00, 715.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(33, 11, 4, 'Batería 12V 70Ah', 6, 180.00, 1080.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(34, 12, 1, 'Filtro de aceite', 18, 15.00, 270.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(35, 12, 2, 'Aceite 15W-40 (1L)', 15, 22.00, 330.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(36, 12, 6, 'Filtro de aire', 10, 18.00, 180.00, '2026-07-04 10:29:19', '2026-07-04 10:29:19');

-- Volcando estructura para tabla saas_taller_automotriz.comprobantes
CREATE TABLE IF NOT EXISTS `comprobantes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tipo` enum('boleta','factura') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'boleta',
  `serie` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'B001',
  `numero` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `orden_id` bigint unsigned DEFAULT NULL,
  `cliente_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `fecha` date NOT NULL,
  `subtotal` decimal(12,2) NOT NULL DEFAULT '0.00',
  `igv` decimal(12,2) NOT NULL DEFAULT '0.00',
  `total` decimal(12,2) NOT NULL DEFAULT '0.00',
  `metodo_pago` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `estado` enum('emitido','anulado') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'emitido',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `comprobantes_orden_id_foreign` (`orden_id`),
  KEY `comprobantes_cliente_id_foreign` (`cliente_id`),
  KEY `comprobantes_user_id_foreign` (`user_id`),
  CONSTRAINT `comprobantes_cliente_id_foreign` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`) ON DELETE SET NULL,
  CONSTRAINT `comprobantes_orden_id_foreign` FOREIGN KEY (`orden_id`) REFERENCES `ordenes` (`id`) ON DELETE SET NULL,
  CONSTRAINT `comprobantes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.comprobantes: ~13 rows (aproximadamente)
DELETE FROM `comprobantes`;
INSERT INTO `comprobantes` (`id`, `tipo`, `serie`, `numero`, `orden_id`, `cliente_id`, `user_id`, `fecha`, `subtotal`, `igv`, `total`, `metodo_pago`, `estado`, `created_at`, `updated_at`) VALUES
	(1, 'boleta', 'B001', '1', 1, 1, 1, '2026-07-05', 900.00, 162.00, 1062.00, 'efectivo', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(2, 'factura', 'F001', '1', 2, 6, 1, '2026-06-29', 540.00, 97.20, 637.20, 'efectivo', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(3, 'boleta', 'B001', '2', 3, 5, 1, '2026-06-30', 600.00, 108.00, 708.00, 'yape', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(4, 'factura', 'F001', '2', 5, 4, 1, '2026-06-20', 586.00, 105.48, 691.48, 'tarjeta', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(5, 'boleta', 'B001', '3', 7, 4, 1, '2026-06-21', 435.00, 78.30, 513.30, 'efectivo', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(6, 'factura', 'F001', '3', 9, 3, 1, '2026-06-09', 112.00, 20.16, 132.16, 'yape', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(7, 'factura', 'F001', '4', 10, 5, 1, '2026-06-16', 250.00, 45.00, 295.00, 'yape', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(8, 'factura', 'F001', '5', 11, 3, 1, '2026-06-29', 804.00, 144.72, 948.72, 'yape', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(9, 'boleta', 'B001', '4', 13, 1, 1, '2026-06-22', 370.00, 66.60, 436.60, 'transferencia', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(10, 'factura', 'F001', '6', 14, 1, 1, '2026-06-09', 180.00, 32.40, 212.40, 'efectivo', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(11, 'factura', 'F001', '7', 15, 6, 1, '2026-06-12', 455.00, 81.90, 536.90, 'tarjeta', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(12, 'boleta', 'B001', '5', 16, 4, 1, '2026-06-25', 380.00, 68.40, 448.40, 'yape', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(13, 'boleta', 'B001', '6', 17, 4, 1, '2026-06-25', 280.00, 50.40, 330.40, 'efectivo', 'emitido', '2026-07-04 10:29:18', '2026-07-04 10:29:18');

-- Volcando estructura para tabla saas_taller_automotriz.configuraciones
CREATE TABLE IF NOT EXISTS `configuraciones` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `empresa` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'AutoTaller Pro',
  `ruc` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `moneda` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'S/',
  `igv` decimal(5,2) NOT NULL DEFAULT '18.00',
  `serie_boleta` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'B001',
  `serie_factura` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'F001',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.configuraciones: ~1 rows (aproximadamente)
DELETE FROM `configuraciones`;
INSERT INTO `configuraciones` (`id`, `empresa`, `ruc`, `direccion`, `telefono`, `email`, `moneda`, `igv`, `serie_boleta`, `serie_factura`, `created_at`, `updated_at`) VALUES
	(1, 'AutoTaller Pro', '20601234567', 'Av. Principal 123, Lima', '01 456 7890', 'contacto@autotallerpro.com', 'S/', 18.00, 'B001', 'F001', '2026-07-04 03:55:54', '2026-07-04 03:55:54');

-- Volcando estructura para tabla saas_taller_automotriz.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.migrations: ~17 rows (aproximadamente)
DELETE FROM `migrations`;
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
	(1, '0001_01_01_000000_create_users_table', 1),
	(2, '2026_01_01_000001_create_clientes_table', 1),
	(3, '2026_01_01_000002_create_vehiculos_table', 1),
	(4, '2026_01_01_000003_create_proveedores_table', 1),
	(5, '2026_01_01_000004_create_servicios_table', 1),
	(6, '2026_01_01_000005_create_repuestos_table', 1),
	(7, '2026_01_01_000006_create_ordenes_table', 1),
	(8, '2026_01_01_000007_create_orden_servicio_table', 1),
	(9, '2026_01_01_000008_create_orden_repuesto_table', 1),
	(10, '2026_01_01_000009_create_citas_table', 1),
	(11, '2026_01_02_000001_create_compras_table', 2),
	(12, '2026_01_02_000002_create_comprobantes_table', 2),
	(13, '2026_01_02_000003_create_movimientos_caja_table', 2),
	(14, '2026_01_02_000004_create_configuraciones_table', 2),
	(15, '2026_01_03_000001_create_planes_table', 3),
	(16, '2026_01_03_000002_create_talleres_table', 3),
	(17, '2026_01_03_000003_create_pagos_suscripcion_table', 3);

-- Volcando estructura para tabla saas_taller_automotriz.movimientos_caja
CREATE TABLE IF NOT EXISTS `movimientos_caja` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tipo` enum('ingreso','egreso') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'ingreso',
  `concepto` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `monto` decimal(12,2) NOT NULL DEFAULT '0.00',
  `fecha` date NOT NULL,
  `metodo_pago` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'efectivo',
  `orden_id` bigint unsigned DEFAULT NULL,
  `comprobante_id` bigint unsigned DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `movimientos_caja_orden_id_foreign` (`orden_id`),
  KEY `movimientos_caja_comprobante_id_foreign` (`comprobante_id`),
  KEY `movimientos_caja_user_id_foreign` (`user_id`),
  CONSTRAINT `movimientos_caja_comprobante_id_foreign` FOREIGN KEY (`comprobante_id`) REFERENCES `comprobantes` (`id`) ON DELETE SET NULL,
  CONSTRAINT `movimientos_caja_orden_id_foreign` FOREIGN KEY (`orden_id`) REFERENCES `ordenes` (`id`) ON DELETE SET NULL,
  CONSTRAINT `movimientos_caja_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.movimientos_caja: ~30 rows (aproximadamente)
DELETE FROM `movimientos_caja`;
INSERT INTO `movimientos_caja` (`id`, `tipo`, `concepto`, `monto`, `fecha`, `metodo_pago`, `orden_id`, `comprobante_id`, `user_id`, `created_at`, `updated_at`) VALUES
	(1, 'ingreso', 'Venta B001-000001 · Orden OT-0001', 1062.00, '2026-07-05', 'efectivo', 1, 1, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(2, 'ingreso', 'Venta F001-000001 · Orden OT-0002', 637.20, '2026-06-29', 'efectivo', 2, 2, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(3, 'ingreso', 'Venta B001-000002 · Orden OT-0003', 708.00, '2026-06-30', 'yape', 3, 3, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(4, 'ingreso', 'Venta F001-000002 · Orden OT-0005', 691.48, '2026-06-20', 'tarjeta', 5, 4, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(5, 'ingreso', 'Venta B001-000003 · Orden OT-0007', 513.30, '2026-06-21', 'efectivo', 7, 5, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(6, 'ingreso', 'Venta F001-000003 · Orden OT-0009', 132.16, '2026-06-09', 'yape', 9, 6, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(7, 'ingreso', 'Venta F001-000004 · Orden OT-0010', 295.00, '2026-06-16', 'yape', 10, 7, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(8, 'ingreso', 'Venta F001-000005 · Orden OT-0011', 948.72, '2026-06-29', 'yape', 11, 8, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(9, 'ingreso', 'Venta B001-000004 · Orden OT-0013', 436.60, '2026-06-22', 'transferencia', 13, 9, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(10, 'ingreso', 'Venta F001-000006 · Orden OT-0014', 212.40, '2026-06-09', 'efectivo', 14, 10, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(11, 'ingreso', 'Venta F001-000007 · Orden OT-0015', 536.90, '2026-06-12', 'tarjeta', 15, 11, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(12, 'ingreso', 'Venta B001-000005 · Orden OT-0016', 448.40, '2026-06-25', 'yape', 16, 12, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(13, 'ingreso', 'Venta B001-000006 · Orden OT-0017', 330.40, '2026-06-25', 'efectivo', 17, 13, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(14, 'egreso', 'Compra CMP-0001 · AutoPartes del Perú', 3691.04, '2026-02-15', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(15, 'egreso', 'Compra CMP-0002 · Lubricantes Premium', 5764.30, '2026-04-29', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:18', '2026-07-04 10:29:18'),
	(16, 'egreso', 'Compra CMP-0003 · Repuestos San Martín', 971.14, '2026-05-13', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(17, 'egreso', 'Compra CMP-0004 · AutoPartes del Perú', 6413.30, '2026-01-23', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(18, 'egreso', 'Compra CMP-0005 · AutoPartes del Perú', 2618.42, '2026-04-29', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(19, 'egreso', 'Compra CMP-0006 · AutoPartes del Perú', 3127.00, '2026-06-17', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(20, 'egreso', 'Compra CMP-0007 · AutoPartes del Perú', 3288.66, '2026-02-25', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(21, 'egreso', 'Compra CMP-0008 · Repuestos San Martín', 5593.20, '2026-03-31', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(22, 'egreso', 'Compra CMP-0009 · Lubricantes Premium', 4920.60, '2026-04-23', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(23, 'egreso', 'Compra CMP-0010 · Repuestos San Martín', 1610.70, '2026-06-03', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(24, 'egreso', 'Compra CMP-0011 · AutoPartes del Perú', 2299.82, '2026-03-12', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(25, 'egreso', 'Compra CMP-0012 · Lubricantes Premium', 920.40, '2026-05-13', 'transferencia', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(26, 'egreso', 'Pago de alquiler del local', 1500.00, '2026-05-27', 'efectivo', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(27, 'egreso', 'Servicios (luz, agua, internet)', 480.00, '2026-06-05', 'efectivo', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(28, 'egreso', 'Compra de insumos de limpieza', 120.00, '2026-06-27', 'efectivo', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(29, 'egreso', 'Pago de planilla', 4200.00, '2026-06-21', 'efectivo', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19'),
	(30, 'egreso', 'Mantenimiento de herramientas', 260.00, '2026-06-22', 'efectivo', NULL, NULL, 1, '2026-07-04 10:29:19', '2026-07-04 10:29:19');

-- Volcando estructura para tabla saas_taller_automotriz.ordenes
CREATE TABLE IF NOT EXISTS `ordenes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `numero` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cliente_id` bigint unsigned NOT NULL,
  `vehiculo_id` bigint unsigned NOT NULL,
  `mecanico_id` bigint unsigned DEFAULT NULL,
  `fecha_ingreso` date NOT NULL,
  `fecha_entrega` date DEFAULT NULL,
  `kilometraje` int DEFAULT NULL,
  `diagnostico` text COLLATE utf8mb4_unicode_ci,
  `observaciones` text COLLATE utf8mb4_unicode_ci,
  `estado` enum('recepcion','diagnostico','en_proceso','esperando_repuestos','terminado','entregado','anulado') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'recepcion',
  `prioridad` enum('baja','media','alta') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'media',
  `subtotal` decimal(10,2) NOT NULL DEFAULT '0.00',
  `descuento` decimal(10,2) NOT NULL DEFAULT '0.00',
  `impuesto` decimal(10,2) NOT NULL DEFAULT '0.00',
  `total` decimal(10,2) NOT NULL DEFAULT '0.00',
  `estado_pago` enum('pendiente','parcial','pagado') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pendiente',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ordenes_numero_unique` (`numero`),
  KEY `ordenes_cliente_id_foreign` (`cliente_id`),
  KEY `ordenes_vehiculo_id_foreign` (`vehiculo_id`),
  KEY `ordenes_mecanico_id_foreign` (`mecanico_id`),
  CONSTRAINT `ordenes_cliente_id_foreign` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ordenes_mecanico_id_foreign` FOREIGN KEY (`mecanico_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `ordenes_vehiculo_id_foreign` FOREIGN KEY (`vehiculo_id`) REFERENCES `vehiculos` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.ordenes: ~18 rows (aproximadamente)
DELETE FROM `ordenes`;
INSERT INTO `ordenes` (`id`, `numero`, `cliente_id`, `vehiculo_id`, `mecanico_id`, `fecha_ingreso`, `fecha_entrega`, `kilometraje`, `diagnostico`, `observaciones`, `estado`, `prioridad`, `subtotal`, `descuento`, `impuesto`, `total`, `estado_pago`, `created_at`, `updated_at`) VALUES
	(1, 'OT-0001', 1, 1, 2, '2026-07-02', '2026-07-05', 59128, 'Revisión general y mantenimiento preventivo.', NULL, 'terminado', 'alta', 900.00, 0.00, 162.00, 1062.00, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(2, 'OT-0002', 6, 6, 2, '2026-06-29', NULL, 106070, 'Revisión general y mantenimiento preventivo.', NULL, 'esperando_repuestos', 'baja', 540.00, 0.00, 97.20, 637.20, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(3, 'OT-0003', 5, 5, 4, '2026-06-30', NULL, 115235, 'Revisión general y mantenimiento preventivo.', NULL, 'esperando_repuestos', 'alta', 600.00, 0.00, 108.00, 708.00, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(4, 'OT-0004', 4, 4, 5, '2026-06-15', '2026-06-16', 53878, 'Revisión general y mantenimiento preventivo.', NULL, 'entregado', 'baja', 420.00, 0.00, 75.60, 495.60, 'pagado', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(5, 'OT-0005', 4, 4, 5, '2026-06-18', '2026-06-21', 81879, 'Revisión general y mantenimiento preventivo.', NULL, 'terminado', 'alta', 586.00, 0.00, 105.48, 691.48, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(6, 'OT-0006', 1, 1, 4, '2026-06-17', NULL, 37268, 'Revisión general y mantenimiento preventivo.', NULL, 'recepcion', 'media', 668.00, 0.00, 120.24, 788.24, 'pendiente', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(7, 'OT-0007', 4, 4, 2, '2026-06-18', NULL, 107530, 'Revisión general y mantenimiento preventivo.', NULL, 'en_proceso', 'media', 435.00, 0.00, 78.30, 513.30, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(8, 'OT-0008', 1, 1, 2, '2026-06-10', '2026-06-14', 62087, 'Revisión general y mantenimiento preventivo.', NULL, 'terminado', 'media', 816.00, 0.00, 146.88, 962.88, 'pendiente', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(9, 'OT-0009', 3, 3, 3, '2026-06-09', NULL, 119896, 'Revisión general y mantenimiento preventivo.', NULL, 'recepcion', 'media', 112.00, 0.00, 20.16, 132.16, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(10, 'OT-0010', 5, 5, 3, '2026-06-16', '2026-06-19', 91603, 'Revisión general y mantenimiento preventivo.', NULL, 'entregado', 'alta', 250.00, 0.00, 45.00, 295.00, 'pagado', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(11, 'OT-0011', 3, 3, 3, '2026-06-29', NULL, 146340, 'Revisión general y mantenimiento preventivo.', NULL, 'esperando_repuestos', 'media', 804.00, 0.00, 144.72, 948.72, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(12, 'OT-0012', 6, 6, 2, '2026-06-23', NULL, 41895, 'Revisión general y mantenimiento preventivo.', NULL, 'esperando_repuestos', 'baja', 258.00, 0.00, 46.44, 304.44, 'pendiente', '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(13, 'OT-0013', 1, 1, 2, '2026-06-21', NULL, 117367, 'Revisión general y mantenimiento preventivo.', NULL, 'recepcion', 'media', 370.00, 0.00, 66.60, 436.60, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(14, 'OT-0014', 1, 1, 5, '2026-06-08', NULL, 109214, 'Revisión general y mantenimiento preventivo.', NULL, 'en_proceso', 'baja', 180.00, 0.00, 32.40, 212.40, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(15, 'OT-0015', 6, 6, 2, '2026-06-10', NULL, 35405, 'Revisión general y mantenimiento preventivo.', NULL, 'esperando_repuestos', 'media', 455.00, 0.00, 81.90, 536.90, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(16, 'OT-0016', 4, 4, 2, '2026-06-25', NULL, 102991, 'Revisión general y mantenimiento preventivo.', NULL, 'en_proceso', 'media', 380.00, 0.00, 68.40, 448.40, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(17, 'OT-0017', 4, 4, 5, '2026-06-23', NULL, 134534, 'Revisión general y mantenimiento preventivo.', NULL, 'en_proceso', 'alta', 280.00, 0.00, 50.40, 330.40, 'pagado', '2026-07-04 02:52:43', '2026-07-04 10:29:18'),
	(18, 'OT-0018', 3, 3, 3, '2026-06-08', NULL, 113368, 'Revisión general y mantenimiento preventivo.', NULL, 'en_proceso', 'baja', 280.00, 0.00, 50.40, 330.40, 'pendiente', '2026-07-04 02:52:43', '2026-07-04 02:52:43');

-- Volcando estructura para tabla saas_taller_automotriz.orden_repuesto
CREATE TABLE IF NOT EXISTS `orden_repuesto` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `orden_id` bigint unsigned NOT NULL,
  `repuesto_id` bigint unsigned DEFAULT NULL,
  `descripcion` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cantidad` int NOT NULL DEFAULT '1',
  `precio` decimal(10,2) NOT NULL DEFAULT '0.00',
  `subtotal` decimal(10,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `orden_repuesto_orden_id_foreign` (`orden_id`),
  KEY `orden_repuesto_repuesto_id_foreign` (`repuesto_id`),
  CONSTRAINT `orden_repuesto_orden_id_foreign` FOREIGN KEY (`orden_id`) REFERENCES `ordenes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `orden_repuesto_repuesto_id_foreign` FOREIGN KEY (`repuesto_id`) REFERENCES `repuestos` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.orden_repuesto: ~18 rows (aproximadamente)
DELETE FROM `orden_repuesto`;
INSERT INTO `orden_repuesto` (`id`, `orden_id`, `repuesto_id`, `descripcion`, `cantidad`, `precio`, `subtotal`, `created_at`, `updated_at`) VALUES
	(1, 1, 3, 'Pastillas de freno delanteras', 2, 95.00, 190.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(2, 1, 7, 'Correa de distribución', 2, 140.00, 280.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(3, 3, 5, 'Bujías (juego x4)', 2, 75.00, 150.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(4, 4, 1, 'Filtro de aceite', 1, 28.00, 28.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(5, 4, 6, 'Filtro de aire', 1, 32.00, 32.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(6, 5, 2, 'Aceite 15W-40 (1L)', 2, 38.00, 76.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(7, 6, 1, 'Filtro de aceite', 1, 28.00, 28.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(8, 6, 3, 'Pastillas de freno delanteras', 2, 95.00, 190.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(9, 7, 5, 'Bujías (juego x4)', 1, 75.00, 75.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(10, 8, 2, 'Aceite 15W-40 (1L)', 2, 38.00, 76.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(11, 8, 5, 'Bujías (juego x4)', 2, 75.00, 150.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(12, 9, 6, 'Filtro de aire', 1, 32.00, 32.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(13, 10, 3, 'Pastillas de freno delanteras', 2, 95.00, 190.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(14, 11, 6, 'Filtro de aire', 2, 32.00, 64.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(15, 11, 7, 'Correa de distribución', 1, 140.00, 140.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(16, 12, 1, 'Filtro de aceite', 1, 28.00, 28.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(17, 15, 3, 'Pastillas de freno delanteras', 1, 95.00, 95.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(18, 15, 7, 'Correa de distribución', 2, 140.00, 280.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43');

-- Volcando estructura para tabla saas_taller_automotriz.orden_servicio
CREATE TABLE IF NOT EXISTS `orden_servicio` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `orden_id` bigint unsigned NOT NULL,
  `servicio_id` bigint unsigned DEFAULT NULL,
  `descripcion` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cantidad` int NOT NULL DEFAULT '1',
  `precio` decimal(10,2) NOT NULL DEFAULT '0.00',
  `subtotal` decimal(10,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `orden_servicio_orden_id_foreign` (`orden_id`),
  KEY `orden_servicio_servicio_id_foreign` (`servicio_id`),
  CONSTRAINT `orden_servicio_orden_id_foreign` FOREIGN KEY (`orden_id`) REFERENCES `ordenes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `orden_servicio_servicio_id_foreign` FOREIGN KEY (`servicio_id`) REFERENCES `servicios` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.orden_servicio: ~34 rows (aproximadamente)
DELETE FROM `orden_servicio`;
INSERT INTO `orden_servicio` (`id`, `orden_id`, `servicio_id`, `descripcion`, `cantidad`, `precio`, `subtotal`, `created_at`, `updated_at`) VALUES
	(1, 1, 3, 'Cambio de pastillas de freno', 1, 150.00, 150.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(2, 1, 4, 'Afinamiento de motor', 1, 280.00, 280.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(3, 2, 2, 'Alineamiento y balanceo', 1, 90.00, 90.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(4, 2, 8, 'Cambio de correa de distribución', 1, 450.00, 450.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(5, 3, 8, 'Cambio de correa de distribución', 1, 450.00, 450.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(6, 4, 4, 'Afinamiento de motor', 1, 280.00, 280.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(7, 4, 5, 'Diagnóstico por escáner', 1, 80.00, 80.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(8, 5, 3, 'Cambio de pastillas de freno', 1, 150.00, 150.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(9, 5, 4, 'Afinamiento de motor', 1, 280.00, 280.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(10, 5, 5, 'Diagnóstico por escáner', 1, 80.00, 80.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(11, 6, 8, 'Cambio de correa de distribución', 1, 450.00, 450.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(12, 7, 1, 'Cambio de aceite y filtro', 1, 120.00, 120.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(13, 7, 2, 'Alineamiento y balanceo', 1, 90.00, 90.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(14, 7, 3, 'Cambio de pastillas de freno', 1, 150.00, 150.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(15, 8, 5, 'Diagnóstico por escáner', 1, 80.00, 80.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(16, 8, 6, 'Cambio de batería', 1, 60.00, 60.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(17, 8, 8, 'Cambio de correa de distribución', 1, 450.00, 450.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(18, 9, 5, 'Diagnóstico por escáner', 1, 80.00, 80.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(19, 10, 6, 'Cambio de batería', 1, 60.00, 60.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(20, 11, 2, 'Alineamiento y balanceo', 1, 90.00, 90.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(21, 11, 6, 'Cambio de batería', 1, 60.00, 60.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(22, 11, 8, 'Cambio de correa de distribución', 1, 450.00, 450.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(23, 12, 2, 'Alineamiento y balanceo', 1, 90.00, 90.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(24, 12, 5, 'Diagnóstico por escáner', 1, 80.00, 80.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(25, 12, 6, 'Cambio de batería', 1, 60.00, 60.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(26, 13, 2, 'Alineamiento y balanceo', 1, 90.00, 90.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(27, 13, 4, 'Afinamiento de motor', 1, 280.00, 280.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(28, 14, 1, 'Cambio de aceite y filtro', 1, 120.00, 120.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(29, 14, 6, 'Cambio de batería', 1, 60.00, 60.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(30, 15, 5, 'Diagnóstico por escáner', 1, 80.00, 80.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(31, 16, 4, 'Afinamiento de motor', 1, 280.00, 280.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(32, 16, 7, 'Revisión de suspensión', 1, 100.00, 100.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(33, 17, 4, 'Afinamiento de motor', 1, 280.00, 280.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(34, 18, 4, 'Afinamiento de motor', 1, 280.00, 280.00, '2026-07-04 02:52:43', '2026-07-04 02:52:43');

-- Volcando estructura para tabla saas_taller_automotriz.pagos_suscripcion
CREATE TABLE IF NOT EXISTS `pagos_suscripcion` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `taller_id` bigint unsigned NOT NULL,
  `plan_id` bigint unsigned DEFAULT NULL,
  `monto` decimal(10,2) NOT NULL DEFAULT '0.00',
  `fecha_pago` date NOT NULL,
  `periodo` enum('mensual','anual') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'mensual',
  `metodo` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'transferencia',
  `referencia` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cubre_hasta` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pagos_suscripcion_taller_id_foreign` (`taller_id`),
  KEY `pagos_suscripcion_plan_id_foreign` (`plan_id`),
  CONSTRAINT `pagos_suscripcion_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `planes` (`id`) ON DELETE SET NULL,
  CONSTRAINT `pagos_suscripcion_taller_id_foreign` FOREIGN KEY (`taller_id`) REFERENCES `talleres` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.pagos_suscripcion: ~20 rows (aproximadamente)
DELETE FROM `pagos_suscripcion`;
INSERT INTO `pagos_suscripcion` (`id`, `taller_id`, `plan_id`, `monto`, `fecha_pago`, `periodo`, `metodo`, `referencia`, `cubre_hasta`, `created_at`, `updated_at`) VALUES
	(1, 1, 1, 990.00, '2026-06-04', 'anual', 'yape', 'PAG-64262', '2026-07-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(2, 1, 1, 990.00, '2026-05-04', 'anual', 'tarjeta', 'PAG-39725', '2026-06-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(3, 1, 1, 990.00, '2026-04-04', 'anual', 'tarjeta', 'PAG-22298', '2026-05-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(4, 1, 1, 990.00, '2026-03-04', 'anual', 'tarjeta', 'PAG-68287', '2026-04-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(5, 2, 2, 199.00, '2026-06-04', 'mensual', 'transferencia', 'PAG-10781', '2026-07-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(6, 2, 2, 199.00, '2026-05-04', 'mensual', 'transferencia', 'PAG-61238', '2026-06-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(7, 4, 1, 99.00, '2026-06-04', 'mensual', 'transferencia', 'PAG-38609', '2026-07-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(8, 4, 1, 99.00, '2026-05-04', 'mensual', 'transferencia', 'PAG-97984', '2026-06-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(9, 4, 1, 99.00, '2026-04-04', 'mensual', 'transferencia', 'PAG-98205', '2026-05-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(10, 5, 2, 199.00, '2026-06-04', 'mensual', 'tarjeta', 'PAG-93298', '2026-07-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(11, 5, 2, 199.00, '2026-05-04', 'mensual', 'yape', 'PAG-12096', '2026-06-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(12, 6, 3, 3990.00, '2026-06-04', 'anual', 'tarjeta', 'PAG-89771', '2026-07-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(13, 8, 2, 199.00, '2026-06-04', 'mensual', 'transferencia', 'PAG-31205', '2026-07-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(14, 9, 3, 399.00, '2026-06-04', 'mensual', 'yape', 'PAG-98744', '2026-07-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(15, 9, 3, 399.00, '2026-05-04', 'mensual', 'yape', 'PAG-64456', '2026-06-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(16, 9, 3, 399.00, '2026-04-04', 'mensual', 'transferencia', 'PAG-20325', '2026-05-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(17, 9, 3, 399.00, '2026-03-04', 'mensual', 'yape', 'PAG-21309', '2026-04-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(18, 10, 1, 990.00, '2026-06-04', 'anual', 'tarjeta', 'PAG-39065', '2026-07-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(19, 10, 1, 990.00, '2026-05-04', 'anual', 'tarjeta', 'PAG-67217', '2026-06-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(20, 10, 1, 990.00, '2026-04-04', 'anual', 'transferencia', 'PAG-93606', '2026-05-04', '2026-07-04 10:56:36', '2026-07-04 10:56:36');

-- Volcando estructura para tabla saas_taller_automotriz.password_reset_tokens
CREATE TABLE IF NOT EXISTS `password_reset_tokens` (
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(191) 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 saas_taller_automotriz.password_reset_tokens: ~0 rows (aproximadamente)
DELETE FROM `password_reset_tokens`;

-- Volcando estructura para tabla saas_taller_automotriz.planes
CREATE TABLE IF NOT EXISTS `planes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `precio_mensual` decimal(10,2) NOT NULL DEFAULT '0.00',
  `precio_anual` decimal(10,2) NOT NULL DEFAULT '0.00',
  `limite_usuarios` int NOT NULL DEFAULT '0',
  `limite_ordenes` int NOT NULL DEFAULT '0',
  `descripcion` text COLLATE utf8mb4_unicode_ci,
  `caracteristicas` text COLLATE utf8mb4_unicode_ci,
  `destacado` tinyint(1) NOT NULL DEFAULT '0',
  `activo` tinyint(1) NOT NULL DEFAULT '1',
  `orden` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.planes: ~3 rows (aproximadamente)
DELETE FROM `planes`;
INSERT INTO `planes` (`id`, `nombre`, `slug`, `precio_mensual`, `precio_anual`, `limite_usuarios`, `limite_ordenes`, `descripcion`, `caracteristicas`, `destacado`, `activo`, `orden`, `created_at`, `updated_at`) VALUES
	(1, 'Básico', 'basico', 99.00, 990.00, 3, 100, 'Ideal para talleres que están empezando.', 'Hasta 3 usuarios\n100 órdenes por mes\nGestión de clientes y vehículos\nInventario básico\nSoporte por correo', 0, 1, 1, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(2, 'Profesional', 'profesional', 199.00, 1990.00, 10, 500, 'El favorito de los talleres en crecimiento.', 'Hasta 10 usuarios\n500 órdenes por mes\nFacturación y caja\nReportes avanzados\nImportar / exportar datos\nSoporte prioritario', 1, 1, 2, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(3, 'Empresarial', 'empresarial', 399.00, 3990.00, 0, 0, 'Para cadenas y talleres de alto volumen.', 'Usuarios ilimitados\nÓrdenes ilimitadas\nMulti-sucursal\nRoles y permisos avanzados\nAPI e integraciones\nSoporte 24/7 dedicado', 0, 1, 3, '2026-07-04 10:56:36', '2026-07-04 10:56:36');

-- Volcando estructura para tabla saas_taller_automotriz.proveedores
CREATE TABLE IF NOT EXISTS `proveedores` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ruc` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nombre` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contacto` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.proveedores: ~3 rows (aproximadamente)
DELETE FROM `proveedores`;
INSERT INTO `proveedores` (`id`, `ruc`, `nombre`, `contacto`, `telefono`, `email`, `direccion`, `activo`, `created_at`, `updated_at`) VALUES
	(1, '20123456781', 'Repuestos San Martín', NULL, '014567890', NULL, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(2, '20456789012', 'AutoPartes del Perú', NULL, '013334455', NULL, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(3, '20567890123', 'Lubricantes Premium', NULL, '015556677', NULL, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43');

-- Volcando estructura para tabla saas_taller_automotriz.repuestos
CREATE TABLE IF NOT EXISTS `repuestos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `proveedor_id` bigint unsigned DEFAULT NULL,
  `codigo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nombre` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `categoria` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unidad` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'UND',
  `precio_compra` decimal(10,2) NOT NULL DEFAULT '0.00',
  `precio_venta` decimal(10,2) NOT NULL DEFAULT '0.00',
  `stock` int NOT NULL DEFAULT '0',
  `stock_minimo` int NOT NULL DEFAULT '0',
  `ubicacion` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `repuestos_proveedor_id_foreign` (`proveedor_id`),
  CONSTRAINT `repuestos_proveedor_id_foreign` FOREIGN KEY (`proveedor_id`) REFERENCES `proveedores` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.repuestos: ~7 rows (aproximadamente)
DELETE FROM `repuestos`;
INSERT INTO `repuestos` (`id`, `proveedor_id`, `codigo`, `nombre`, `categoria`, `unidad`, `precio_compra`, `precio_venta`, `stock`, `stock_minimo`, `ubicacion`, `activo`, `created_at`, `updated_at`) VALUES
	(1, 1, 'REP-001', 'Filtro de aceite', 'Filtros', 'UND', 15.00, 28.00, 94, 10, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 10:29:19'),
	(2, 3, 'REP-002', 'Aceite 15W-40 (1L)', 'Lubricantes', 'UND', 22.00, 38.00, 91, 15, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 10:29:19'),
	(3, 3, 'REP-003', 'Pastillas de freno delanteras', 'Frenos', 'UND', 55.00, 95.00, 76, 12, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 10:29:19'),
	(4, 1, 'REP-004', 'Batería 12V 70Ah', 'Eléctrico', 'UND', 180.00, 260.00, 111, 5, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 10:29:19'),
	(5, 1, 'REP-005', 'Bujías (juego x4)', 'Motor', 'UND', 40.00, 75.00, 127, 8, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 10:29:19'),
	(6, 1, 'REP-006', 'Filtro de aire', 'Filtros', 'UND', 18.00, 32.00, 37, 10, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 10:29:19'),
	(7, 2, 'REP-007', 'Correa de distribución', 'Motor', 'UND', 85.00, 140.00, 103, 5, NULL, 1, '2026-07-04 02:52:43', '2026-07-04 10:29:19');

-- Volcando estructura para tabla saas_taller_automotriz.servicios
CREATE TABLE IF NOT EXISTS `servicios` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `codigo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nombre` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `categoria` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `descripcion` text COLLATE utf8mb4_unicode_ci,
  `precio` decimal(10,2) NOT NULL DEFAULT '0.00',
  `duracion_min` int DEFAULT NULL,
  `activo` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.servicios: ~8 rows (aproximadamente)
DELETE FROM `servicios`;
INSERT INTO `servicios` (`id`, `codigo`, `nombre`, `categoria`, `descripcion`, `precio`, `duracion_min`, `activo`, `created_at`, `updated_at`) VALUES
	(1, 'SRV-001', 'Cambio de aceite y filtro', 'Mantenimiento', NULL, 120.00, 40, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(2, 'SRV-002', 'Alineamiento y balanceo', 'Suspensión', NULL, 90.00, 60, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(3, 'SRV-003', 'Cambio de pastillas de freno', 'Frenos', NULL, 150.00, 90, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(4, 'SRV-004', 'Afinamiento de motor', 'Motor', NULL, 280.00, 120, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(5, 'SRV-005', 'Diagnóstico por escáner', 'Electrónica', NULL, 80.00, 45, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(6, 'SRV-006', 'Cambio de batería', 'Electricidad', NULL, 60.00, 30, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(7, 'SRV-007', 'Revisión de suspensión', 'Suspensión', NULL, 100.00, 60, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(8, 'SRV-008', 'Cambio de correa de distribución', 'Motor', NULL, 450.00, 180, 1, '2026-07-04 02:52:43', '2026-07-04 02:52:43');

-- Volcando estructura para tabla saas_taller_automotriz.sessions
CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.sessions: ~0 rows (aproximadamente)
DELETE FROM `sessions`;

-- Volcando estructura para tabla saas_taller_automotriz.talleres
CREATE TABLE IF NOT EXISTS `talleres` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nombre` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ruc` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contacto_nombre` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ciudad` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `plan_id` bigint unsigned DEFAULT NULL,
  `estado` enum('prueba','activo','suspendido','cancelado') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'prueba',
  `periodo` enum('mensual','anual') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'mensual',
  `fecha_inicio` date DEFAULT NULL,
  `fecha_vencimiento` date DEFAULT NULL,
  `notas` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `talleres_plan_id_foreign` (`plan_id`),
  CONSTRAINT `talleres_plan_id_foreign` FOREIGN KEY (`plan_id`) REFERENCES `planes` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.talleres: ~10 rows (aproximadamente)
DELETE FROM `talleres`;
INSERT INTO `talleres` (`id`, `nombre`, `ruc`, `contacto_nombre`, `email`, `telefono`, `ciudad`, `plan_id`, `estado`, `periodo`, `fecha_inicio`, `fecha_vencimiento`, `notas`, `created_at`, `updated_at`) VALUES
	(1, 'Taller MotorMax', '20383934879', 'Contacto 1', 'tallermotormax@correo.com', '995428010', 'Trujillo', 1, 'activo', 'anual', '2025-09-07', '2026-08-13', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(2, 'Servicentro El Rápido', '20933428976', 'Contacto 2', 'servicentroelrápido@correo.com', '940752367', 'Arequipa', 2, 'activo', 'mensual', '2026-06-14', '2026-07-14', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(3, 'AutoFix Premium', '20623296566', 'Contacto 3', 'autofixpremium@correo.com', '972862314', 'Trujillo', 3, 'prueba', 'mensual', '2026-06-29', '2026-07-13', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(4, 'Mecánica González', '20604346982', 'Contacto 4', 'mecánicagonzález@correo.com', '972465457', 'Cusco', 1, 'activo', 'mensual', '2026-05-05', '2026-07-07', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(5, 'Taller Los Andes', '20706784742', 'Contacto 5', 'tallerlosandes@correo.com', '995142367', 'Arequipa', 2, 'suspendido', 'mensual', '2026-05-15', '2026-06-24', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(6, 'CarService Pro', '20829411045', 'Contacto 6', 'carservicepro@correo.com', '953295645', 'Trujillo', 3, 'activo', 'anual', '2026-03-06', '2027-03-01', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(7, 'Lubricentro Central', '20882075750', 'Contacto 7', 'lubricentrocentral@correo.com', '955463081', 'Arequipa', 1, 'prueba', 'mensual', '2026-07-02', '2026-07-16', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(8, 'Taller Hermanos Ruiz', '20559416571', 'Contacto 8', 'tallerhermanosruiz@correo.com', '969191578', 'Cusco', 2, 'cancelado', 'mensual', '2025-12-16', '2026-04-15', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(9, 'AutoElite', '20950708062', 'Contacto 9', 'autoelite@correo.com', '939506528', 'Lima', 3, 'activo', 'mensual', '2026-06-19', '2026-07-19', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36'),
	(10, 'Multiservicios Díaz', '20339840259', 'Contacto 10', 'multiserviciosdíaz@correo.com', '984663522', 'Arequipa', 1, 'activo', 'anual', '2025-05-30', '2027-05-30', NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36');

-- Volcando estructura para tabla saas_taller_automotriz.users
CREATE TABLE IF NOT EXISTS `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rol` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'empleado',
  `telefono` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` 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`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.users: ~6 rows (aproximadamente)
DELETE FROM `users`;
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `rol`, `telefono`, `avatar`, `activo`, `remember_token`, `created_at`, `updated_at`) VALUES
	(1, 'Administrador', 'admin@taller.com', NULL, '$2y$12$7JgEd72GyMV3NtztTKNVG.0SpHD1T4Kgppi4hjoDTj2iw.5ODpWWe', 'admin', '999888777', NULL, 1, NULL, '2026-07-04 02:52:42', '2026-07-04 02:52:42'),
	(2, 'Carlos Ramírez', 'carlos@taller.com', NULL, '$2y$12$55IvIXSxMPhUBF19pdyB/eh9YFlchJzzvEVrg9uR5syDr0CDJ.mJa', 'mecanico', NULL, NULL, 1, NULL, '2026-07-04 02:52:42', '2026-07-04 02:52:42'),
	(3, 'Luis Torres', 'luis@taller.com', NULL, '$2y$12$DxS17rEbONMIme6np/RocO4Kwdp0LwHLT1Fc7wmafdG95QlLCxd8G', 'mecanico', NULL, NULL, 1, NULL, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(4, 'Miguel Ángel Díaz', 'miguel@taller.com', NULL, '$2y$12$A1TwVc72zw1FgHTOXdl48uD6xdpNCRT2gQ2iwgbS2enYvyVlHFAvS', 'mecanico', NULL, NULL, 1, NULL, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(5, 'Gerente General', 'gerente@taller.com', NULL, '$2y$12$2VrP.q1uKQwlpHxF49QBQun/7BGLCc15Qpavez6rxZiUFYA8Tcuoe', 'gerente', NULL, NULL, 1, NULL, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(6, 'Super Administrador', 'superadmin@autotaller.com', NULL, '$2y$12$bquvk04KyP.EEfMaix/GUu/FqcfRaPaeFgVuOKcPP0pR4fd7SEjsq', 'superadmin', '900000000', NULL, 1, NULL, '2026-07-04 10:56:36', '2026-07-04 10:56:36');

-- Volcando estructura para tabla saas_taller_automotriz.vehiculos
CREATE TABLE IF NOT EXISTS `vehiculos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cliente_id` bigint unsigned NOT NULL,
  `placa` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `marca` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `modelo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `anio` year DEFAULT NULL,
  `color` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vin` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `motor` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `combustible` enum('gasolina','diesel','glp','gnv','electrico','hibrido') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'gasolina',
  `transmision` enum('manual','automatica') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kilometraje` int DEFAULT NULL,
  `observaciones` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vehiculos_cliente_id_foreign` (`cliente_id`),
  KEY `vehiculos_placa_index` (`placa`),
  CONSTRAINT `vehiculos_cliente_id_foreign` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Volcando datos para la tabla saas_taller_automotriz.vehiculos: ~6 rows (aproximadamente)
DELETE FROM `vehiculos`;
INSERT INTO `vehiculos` (`id`, `cliente_id`, `placa`, `marca`, `modelo`, `anio`, `color`, `vin`, `motor`, `combustible`, `transmision`, `kilometraje`, `observaciones`, `created_at`, `updated_at`) VALUES
	(1, 1, 'ABC-123', 'Toyota', 'Corolla', '2019', 'Blanco', NULL, NULL, 'gasolina', 'automatica', 51972, NULL, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(2, 2, 'XYZ-789', 'Hyundai', 'Accent', '2017', 'Negro', NULL, NULL, 'gasolina', 'automatica', 73422, NULL, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(3, 3, 'DEF-456', 'Kia', 'Rio', '2021', 'Gris', NULL, NULL, 'gasolina', 'manual', 26690, NULL, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(4, 4, 'GHI-321', 'Nissan', 'Sentra', '2013', 'Rojo', NULL, NULL, 'gasolina', 'automatica', 102295, NULL, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(5, 5, 'JKL-654', 'Volkswagen', 'Gol', '2023', 'Azul', NULL, NULL, 'gasolina', 'manual', 38581, NULL, '2026-07-04 02:52:43', '2026-07-04 02:52:43'),
	(6, 6, 'F1B-200', 'Toyota', 'Hiace', '2020', 'Blanco', NULL, NULL, 'diesel', 'manual', 98000, NULL, '2026-07-04 02:52:43', '2026-07-04 02:52:43');

/*!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) */;
