-- Table structure for table `mobile_push_devices`
--

SET autocommit=0;
COMMIT;

-- Dumped table `mobile_push_devices` with 0 row(s)
--

--
-- Table structure for table `modules`
--

CREATE TABLE `modules` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `value` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `order_menu` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `modules`
--

SET autocommit=0;
INSERT INTO `modules` VALUES (1,'documents','Ventas',2,NULL,NULL),(2,'purchases','Compras',7,NULL,NULL),(3,'advanced','Documentos Avanzados',8,NULL,NULL),(4,'reports','Reportes',9,NULL,NULL),(5,'configuration','Configuration',12,NULL,NULL),(6,'pos','Punto de venta (POS)',3,NULL,NULL),(7,'dashboard','Dashboard',1,NULL,NULL),(8,'inventory','Inventario',7,NULL,NULL),(9,'accounting','Contabilidad',10,NULL,NULL),(10,'ecommerce','Ecommerce',4,NULL,NULL),(11,'cuenta','Cuenta',13,NULL,NULL),(12,'finance','Finanzas',11,NULL,NULL),(14,'establishments','Usuarios/Locales & Series',7,NULL,NULL),(15,'hotels','Hoteles',14,NULL,NULL),(16,'documentary-procedure','Trámite documentario',15,NULL,NULL),(17,'items','Productos/Servicios',5,NULL,NULL),(18,'persons','Clientes',6,NULL,NULL),(19,'digemid','Farmacos',15,'2026-07-02 11:24:29','2026-07-02 11:24:29'),(20,'apps','Apps',13,NULL,NULL),(21,'suscription_app','Suscriptiones',16,NULL,NULL),(22,'production_app','Producción',17,NULL,NULL),(23,'restaurant_app','Restaurante',18,NULL,NULL),(24,'full_suscription_app','Suscripción Servicios SAAS',17,NULL,NULL),(25,'generate_link_app','Generador de link de pago',19,NULL,NULL),(26,'app_2_generator','Generador APP 2.0',20,NULL,NULL),(27,'guia','Guia de remisión',3,NULL,NULL),(28,'veterinary','Veterinaria',20,'2026-07-02 11:24:40','2026-07-02 11:24:40'),(29,'clinica','Clínica',20,'2026-07-02 11:24:41','2026-07-02 11:24:41');
COMMIT;

-- Dumped table `modules` with 28 row(s)
--

--
-- Table structure for table `module_levels`
--

CREATE TABLE `module_levels` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `value` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `module_id` int(10) unsigned NOT NULL,
  `route_name` varchar(255) DEFAULT NULL,
  `route_path` varchar(255) DEFAULT NULL,
  `label_menu` varchar(3) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `module_levels_module_id_foreign` (`module_id`),
  CONSTRAINT `module_levels_module_id_foreign` FOREIGN KEY (`module_id`) REFERENCES `modules` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `module_levels`
--

SET autocommit=0;
INSERT INTO `module_levels` VALUES (1,'new_document','Nuevo comprobante',1,'tenant.documents.create','/documents/create','NC',NULL,NULL),(2,'list_document','L. Comprobantes',1,NULL,NULL,NULL,NULL,NULL),(3,'document_not_sent','Doc. No enviados',1,NULL,NULL,NULL,NULL,NULL),(4,'document_contingengy','Doc. Contingencia',1,NULL,NULL,NULL,NULL,NULL),(5,'catalogs','Catálogos',1,NULL,NULL,NULL,NULL,NULL),(6,'summary_voided','Resúmenes y Anulaciones',1,NULL,NULL,NULL,NULL,NULL),(7,'quotations','Cotizaciones',1,NULL,NULL,NULL,NULL,NULL),(8,'sale_notes','Notas de Venta',1,'tenant.sale_notes.index','/sale-notes','NV',NULL,NULL),(9,'incentives','Comisiones',1,NULL,NULL,NULL,NULL,NULL),(10,'sale-opportunity','Oportunidad de venta',1,NULL,NULL,NULL,NULL,NULL),(11,'contracts','Contratos',1,NULL,NULL,NULL,NULL,NULL),(12,'order-note','Pedidos',1,'tenant.order_notes.index','/order-notes','PED',NULL,NULL),(13,'technical-service','Servicios de soporte técnico',1,NULL,NULL,NULL,NULL,NULL),(14,'regularize_shipping','CPE pendientes de rectificación',1,NULL,NULL,NULL,NULL,NULL),(15,'pos','Punto de venta',6,'tenant.pos.index','/pos','POS',NULL,NULL),(16,'cash','Caja chica POS',6,NULL,NULL,NULL,NULL,NULL),(17,'ecommerce','Ir a la tienda',10,NULL,NULL,NULL,NULL,NULL),(18,'ecommerce_orders','Pedidos',10,NULL,NULL,NULL,NULL,NULL),(19,'ecommerce_items','Productos tienda virtual',10,NULL,NULL,NULL,NULL,NULL),(20,'ecommerce_tags','Etiquetas',10,NULL,NULL,NULL,NULL,NULL),(21,'ecommerce_promotions','Promociones - Banners',10,NULL,NULL,NULL,NULL,NULL),(22,'ecommerce_settings','Configuración',10,NULL,NULL,NULL,NULL,NULL),(23,'items','Productos',17,'tenant.items.index','/items','PRO',NULL,NULL),(24,'items_packs','Packs',17,NULL,NULL,NULL,NULL,NULL),(25,'items_services','Servicios',17,NULL,NULL,NULL,NULL,NULL),(26,'items_categories','Categorías',17,NULL,NULL,NULL,NULL,NULL),(27,'items_brands','Marcas',17,NULL,NULL,NULL,NULL,NULL),(28,'items_lots','Series',17,NULL,NULL,NULL,NULL,NULL),(29,'clients','Clientes',18,NULL,NULL,NULL,NULL,NULL),(30,'clients_types','Tipos de clientes',18,NULL,NULL,NULL,NULL,NULL),(31,'purchases_create','Nueva Compra',2,'tenant.purchases.create','/purchases/create','NC',NULL,NULL),(32,'purchases_list','Listado',2,NULL,NULL,NULL,NULL,NULL),(33,'purchases_orders','Ordenes de compra',2,NULL,NULL,NULL,NULL,NULL),(34,'purchases_expenses','Gastos diversos',2,NULL,NULL,NULL,NULL,NULL),(35,'purchases_suppliers','Proveedores',2,NULL,NULL,NULL,NULL,NULL),(36,'purchases_quotations','Solicitar cotización',2,NULL,NULL,NULL,NULL,NULL),(37,'purchases_fixed_assets_items','Activos fijos - Ítems',2,NULL,NULL,NULL,NULL,NULL),(38,'purchases_fixed_assets_purchases','Activos fijos - Compras',2,NULL,NULL,NULL,NULL,NULL),(39,'inventory','Movimientos',8,'inventory.index','/inventory','INV',NULL,NULL),(40,'inventory_transfers','Traslados',8,NULL,NULL,NULL,NULL,NULL),(41,'inventory_devolutions','Devoluciones',8,NULL,NULL,NULL,NULL,NULL),(42,'inventory_report_kardex','Reporte kardex',8,NULL,NULL,NULL,NULL,NULL),(43,'inventory_report','Reporte inventario',8,NULL,NULL,NULL,NULL,NULL),(44,'inventory_report_valued_kardex','Kardex valorizado',8,NULL,NULL,NULL,NULL,'2026-07-02 11:24:34'),(45,'users','Usuarios',14,'tenant.users.index','/users','USR',NULL,NULL),(46,'users_establishments','Establecimientos',14,'tenant.establishments.index','/establishments','ES',NULL,NULL),(47,'advanced_retentions','Retenciones',3,NULL,NULL,NULL,NULL,NULL),(49,'advanced_perceptions','Percepciones',3,NULL,NULL,NULL,NULL,NULL),(50,'advanced_order_forms','Ordenes de pedido',3,NULL,NULL,NULL,NULL,NULL),(51,'account_report','Exportar reporte',9,NULL,NULL,NULL,NULL,NULL),(52,'account_formats','Exportar formatos',9,NULL,NULL,NULL,NULL,NULL),(53,'account_summary','Reporte resumido - Ventas',9,NULL,NULL,NULL,NULL,NULL),(54,'finances_movements','Movimientos',12,NULL,NULL,NULL,NULL,NULL),(55,'finances_incomes','Ingresos',12,NULL,NULL,NULL,NULL,NULL),(56,'finances_unpaid','Cuentas por cobrar',12,NULL,NULL,NULL,NULL,NULL),(57,'finances_to_pay','Cuentas por pagar',12,NULL,NULL,NULL,NULL,NULL),(58,'finances_payments','Pagos',12,NULL,NULL,NULL,NULL,NULL),(59,'finances_balance','Balance',12,NULL,NULL,NULL,NULL,NULL),(60,'finances_payment_method_types','Ingresos y Egresos - M. Pago',12,NULL,NULL,NULL,NULL,NULL),(61,'account_users_settings','Configuración',11,NULL,NULL,NULL,NULL,NULL),(62,'account_users_list','Lista de pagos',11,NULL,NULL,NULL,NULL,NULL),(63,'hotels_reception','Recepción',15,NULL,NULL,NULL,NULL,NULL),(64,'hotels_rates','Tarifas',15,NULL,NULL,NULL,NULL,NULL),(65,'hotels_floors','Pisos',15,NULL,NULL,NULL,NULL,NULL),(66,'hotels_cats','Categorías',15,NULL,NULL,NULL,NULL,NULL),(67,'hotels_rooms','Habitaciones',15,NULL,NULL,NULL,NULL,NULL),(68,'documentary_offices','Oficinas',16,NULL,NULL,NULL,NULL,NULL),(69,'documentary_process','Procesos',16,NULL,NULL,NULL,NULL,NULL),(70,'documentary_documents','Tipos de documento',16,NULL,NULL,NULL,NULL,NULL),(71,'documentary_actions','Acciones',16,NULL,NULL,NULL,NULL,NULL),(72,'documentary_files','Expedientes',16,NULL,NULL,NULL,NULL,NULL),(73,'digemid','Productos (legado)',19,NULL,NULL,NULL,'2026-07-02 11:24:29','2026-07-02 11:24:29'),(74,'documentary_requirements','Requerimientos',16,NULL,NULL,NULL,'2026-07-02 11:24:29','2026-07-02 11:24:29'),(75,'inventory_item_extra_data','Datos extra de items',8,NULL,NULL,NULL,NULL,NULL),(76,'configuration_company','Empresa',5,'tenant.companies.create','/companies/create','ME',NULL,NULL),(77,'configuration_advance','Avanzado',5,NULL,NULL,NULL,NULL,NULL),(78,'configuration_visual','Visual',5,NULL,NULL,NULL,NULL,NULL),(79,'advanced_purchase_settlements','Liquidaciones de compra',3,NULL,NULL,NULL,NULL,NULL),(80,'suscription_app_client','Cliente',21,NULL,NULL,NULL,NULL,NULL),(81,'suscription_app_service','Servicio',21,NULL,NULL,NULL,NULL,NULL),(82,'suscription_app_payments','Pagos',21,NULL,NULL,NULL,NULL,NULL),(83,'suscription_app_plans','Planes',21,NULL,NULL,NULL,NULL,NULL),(85,'digemid_health_report','Cumplimiento Regulatorio',19,'reports.compliance.index','/prescriptions/digemid/compliance','CUM','2026-07-02 11:24:38','2026-07-02 11:24:38'),(86,'digemid_doctors','Medicos',19,'tenant.prescriptions.doctors.index','/prescriptions/doctors','MED','2026-07-02 11:24:38','2026-07-02 11:24:38'),(87,'digemid_cie10','CIE 10',19,'tenant.prescriptions.cie10.index','/prescriptions/cie10','C10','2026-07-02 11:24:38','2026-07-02 11:24:38'),(88,'digemid_psychotropics_report','Reporte de Psicotropicos',19,'tenant.prescriptions.reports.index','/prescriptions/reports','RPS','2026-07-02 11:24:38','2026-07-02 11:24:38'),(89,'digemid_purchase_reception','Recepcion de productos farmaceuticos',19,'tenant.reports.purchases.format_09.index','/reports/purchases/format_09','RPF','2026-07-02 11:24:38','2026-07-02 11:24:38'),(90,'items_coupons','Cupones',17,NULL,NULL,NULL,'2026-07-02 11:24:38','2026-07-02 11:24:38'),(91,'veterinary','Veterinaria',28,NULL,NULL,NULL,'2026-07-02 11:24:40','2026-07-02 11:24:40'),(92,'vet_panel','Panel',28,NULL,NULL,NULL,'2026-07-02 11:24:41','2026-07-02 11:24:41'),(93,'vet_pets','Mascotas',28,NULL,NULL,NULL,'2026-07-02 11:24:41','2026-07-02 11:24:41'),(94,'vet_appointments','Citas / Agenda',28,NULL,NULL,NULL,'2026-07-02 11:24:41','2026-07-02 11:24:41'),(95,'vet_boardings','Hospedaje',28,NULL,NULL,NULL,'2026-07-02 11:24:41','2026-07-02 11:24:41'),(96,'vet_reminders','Recordatorios',28,NULL,NULL,NULL,'2026-07-02 11:24:41','2026-07-02 11:24:41'),(97,'vet_memberships','Membresías',28,NULL,NULL,NULL,'2026-07-02 11:24:41','2026-07-02 11:24:41'),(98,'vet_reports','Reportes',28,NULL,NULL,NULL,'2026-07-02 11:24:41','2026-07-02 11:24:41'),(99,'vet_settings','Configuración',28,NULL,NULL,NULL,'2026-07-02 11:24:41','2026-07-02 11:24:41'),(100,'clinica','Clínica',29,NULL,NULL,NULL,'2026-07-02 11:24:41','2026-07-02 11:24:41'),(101,'inventory_reconciliation','Reporte de conciliación de inventario',8,'reports.inventory_reconciliation.index','/reports/inventory-reconciliation','REC','2026-07-30 16:51:14','2026-07-30 16:51:14');
COMMIT;

-- Dumped table `module_levels` with 99 row(s)
--

--
-- Table structure for table `module_level_user`
--

CREATE TABLE `module_level_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `module_level_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=133 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `module_level_user`
--

SET autocommit=0;
INSERT INTO `module_level_user` VALUES (1,76,0),(2,77,0),(3,78,0),(4,1,1),(5,2,1),(6,3,1),(7,4,1),(8,5,1),(9,6,1),(10,7,1),(11,8,1),(12,9,1),(13,10,1),(14,11,1),(15,12,1),(16,13,1),(17,14,1),(18,15,1),(19,16,1),(20,23,1),(21,24,1),(22,25,1),(23,26,1),(24,27,1),(25,28,1),(26,101,1),(27,29,1),(28,30,1),(29,31,1),(30,32,1),(31,33,1),(32,34,1),(33,35,1),(34,36,1),(35,37,1),(36,38,1),(37,39,1),(38,40,1),(39,41,1),(40,42,1),(41,43,1),(42,44,1),(43,75,1),(44,45,1),(45,46,1),(46,47,1),(47,49,1),(48,50,1),(49,79,1),(50,51,1),(51,52,1),(52,53,1),(53,54,1),(54,55,1),(55,56,1),(56,57,1),(57,58,1),(58,59,1),(59,60,1),(60,76,1),(61,77,1),(62,78,1),(63,61,1),(64,62,1),(65,96,1),(66,97,1),(67,98,1),(68,99,1),(69,100,1),(70,1,2),(71,2,2),(72,3,2),(73,4,2),(74,5,2),(75,6,2),(76,7,2),(77,8,2),(78,9,2),(79,10,2),(80,11,2),(81,12,2),(82,13,2),(83,14,2),(84,15,2),(85,16,2),(86,23,2),(87,24,2),(88,25,2),(89,26,2),(90,27,2),(91,28,2),(92,29,2),(93,30,2),(94,31,2),(95,32,2),(96,33,2),(97,34,2),(98,35,2),(99,36,2),(100,37,2),(101,38,2),(102,39,2),(103,40,2),(104,41,2),(105,42,2),(106,43,2),(107,44,2),(108,75,2),(109,45,2),(110,47,2),(111,49,2),(112,50,2),(113,79,2),(114,51,2),(115,52,2),(116,53,2),(117,54,2),(118,55,2),(119,56,2),(120,57,2),(121,58,2),(122,59,2),(123,60,2),(124,76,2),(125,77,2),(126,78,2),(127,61,2),(128,62,2),(129,15,3),(130,16,3),(131,15,4),(132,16,4);
COMMIT;

-- Dumped table `module_level_user` with 132 row(s)
--

--
-- Table structure for table `module_user`
--

CREATE TABLE `module_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `module_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `module_user`
--

SET autocommit=0;
INSERT INTO `module_user` VALUES (1,7,1),(2,1,1),(3,6,1),(4,17,1),(5,18,1),(6,2,1),(7,8,1),(8,14,1),(9,3,1),(10,4,1),(11,9,1),(12,12,1),(13,5,1),(14,11,1),(15,19,1),(16,7,2),(17,1,2),(18,6,2),(19,17,2),(20,18,2),(21,2,2),(22,8,2),(23,14,2),(24,3,2),(25,4,2),(26,9,2),(27,12,2),(28,5,2),(29,11,2),(30,19,2),(31,6,3),(32,6,4);
COMMIT;

-- Dumped table `module_user` with 32 row(s)
--

--
-- Table structure for table `notes`
--

CREATE TABLE `notes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `document_id` int(10) unsigned NOT NULL,
  `note_type` enum('credit','debit') NOT NULL,
  `note_credit_type_id` varchar(255) DEFAULT NULL,
  `note_debit_type_id` varchar(255) DEFAULT NULL,
  `note_description` varchar(255) NOT NULL,
  `affected_document_id` int(10) unsigned DEFAULT NULL,
  `data_affected_document` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data_affected_document`)),
  PRIMARY KEY (`id`),
  KEY `notes_document_id_foreign` (`document_id`),
  KEY `notes_note_credit_type_id_foreign` (`note_credit_type_id`),
  KEY `notes_note_debit_type_id_foreign` (`note_debit_type_id`),
  KEY `notes_affected_document_id_foreign` (`affected_document_id`),
  CONSTRAINT `notes_affected_document_id_foreign` FOREIGN KEY (`affected_document_id`) REFERENCES `documents` (`id`),
  CONSTRAINT `notes_document_id_foreign` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE,
  CONSTRAINT `notes_note_credit_type_id_foreign` FOREIGN KEY (`note_credit_type_id`) REFERENCES `cat_note_credit_types` (`id`),
  CONSTRAINT `notes_note_debit_type_id_foreign` FOREIGN KEY (`note_debit_type_id`) REFERENCES `cat_note_debit_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notes`
--

SET autocommit=0;
COMMIT;

-- Dumped table `notes` with 0 row(s)
--

--
-- Table structure for table `offline_configurations`
--

CREATE TABLE `offline_configurations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `is_client` tinyint(1) NOT NULL DEFAULT 0,
  `token_server` varchar(255) DEFAULT NULL,
  `url_server` varchar(255) DEFAULT NULL,
  `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;

--
-- Dumping data for table `offline_configurations`
--

SET autocommit=0;
INSERT INTO `offline_configurations` VALUES (1,0,NULL,NULL,NULL,NULL);
COMMIT;

-- Dumped table `offline_configurations` with 1 row(s)
--

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

CREATE TABLE `orders` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `external_id` char(36) NOT NULL,
  `customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`customer`)),
  `shipping_address` varchar(255) DEFAULT NULL,
  `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`items`)),
  `total` decimal(12,2) NOT NULL,
  `reference_payment` varchar(255) NOT NULL,
  `document_external_id` char(36) DEFAULT NULL,
  `number_document` varchar(255) DEFAULT NULL,
  `status_order_id` tinyint(3) unsigned DEFAULT NULL,
  `purchase` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`purchase`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `apply_restaurant` tinyint(1) DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `orders_status_order_id_foreign` (`status_order_id`),
  CONSTRAINT `orders_status_order_id_foreign` FOREIGN KEY (`status_order_id`) REFERENCES `status_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

SET autocommit=0;
COMMIT;

-- Dumped table `orders` with 0 row(s)
--

--
-- Table structure for table `order_forms`
--

CREATE TABLE `order_forms` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `external_id` char(36) NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `establishment` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`establishment`)),
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `prefix` varchar(255) NOT NULL,
  `date_of_issue` date NOT NULL,
  `time_of_issue` time NOT NULL,
  `customer_id` int(10) unsigned NOT NULL,
  `customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`customer`)),
  `observations` text NOT NULL,
  `transport_mode_type_id` varchar(255) NOT NULL,
  `transfer_reason_type_id` varchar(255) NOT NULL,
  `transfer_reason_description` varchar(255) NOT NULL,
  `date_of_shipping` date NOT NULL,
  `transshipment_indicator` tinyint(1) NOT NULL,
  `port_code` varchar(255) DEFAULT NULL,
  `unit_type_id` varchar(255) NOT NULL,
  `total_weight` decimal(10,2) NOT NULL,
  `packages_number` int(11) NOT NULL,
  `container_number` int(11) DEFAULT NULL,
  `origin` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`origin`)),
  `delivery` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`delivery`)),
  `dispatcher_id` int(10) unsigned NOT NULL,
  `driver_id` int(10) unsigned NOT NULL,
  `license_plates` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`license_plates`)),
  `legends` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`legends`)),
  `optional` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`optional`)),
  `filename` varchar(255) DEFAULT NULL,
  `qr` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_forms_dispatcher_id_foreign` (`dispatcher_id`),
  KEY `order_forms_driver_id_foreign` (`driver_id`),
  KEY `order_forms_user_id_foreign` (`user_id`),
  KEY `order_forms_establishment_id_foreign` (`establishment_id`),
  KEY `order_forms_soap_type_id_foreign` (`soap_type_id`),
  KEY `order_forms_state_type_id_foreign` (`state_type_id`),
  KEY `order_forms_customer_id_foreign` (`customer_id`),
  KEY `order_forms_unit_type_id_foreign` (`unit_type_id`),
  KEY `order_forms_transport_mode_type_id_foreign` (`transport_mode_type_id`),
  KEY `order_forms_transfer_reason_type_id_foreign` (`transfer_reason_type_id`),
  KEY `order_forms_date_of_issue_index` (`date_of_issue`),
  CONSTRAINT `order_forms_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `order_forms_dispatcher_id_foreign` FOREIGN KEY (`dispatcher_id`) REFERENCES `dispatchers` (`id`),
  CONSTRAINT `order_forms_driver_id_foreign` FOREIGN KEY (`driver_id`) REFERENCES `drivers` (`id`),
  CONSTRAINT `order_forms_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`),
  CONSTRAINT `order_forms_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `order_forms_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `order_forms_transfer_reason_type_id_foreign` FOREIGN KEY (`transfer_reason_type_id`) REFERENCES `cat_transfer_reason_types` (`id`),
  CONSTRAINT `order_forms_transport_mode_type_id_foreign` FOREIGN KEY (`transport_mode_type_id`) REFERENCES `cat_transport_mode_types` (`id`),
  CONSTRAINT `order_forms_unit_type_id_foreign` FOREIGN KEY (`unit_type_id`) REFERENCES `cat_unit_types` (`id`),
  CONSTRAINT `order_forms_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_forms`
--

SET autocommit=0;
COMMIT;

-- Dumped table `order_forms` with 0 row(s)
--

--
-- Table structure for table `order_form_items`
--

CREATE TABLE `order_form_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_form_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item`)),
  `quantity` decimal(12,4) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `order_form_items_order_form_id_foreign` (`order_form_id`),
  KEY `order_form_items_item_id_foreign` (`item_id`),
  CONSTRAINT `order_form_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `order_form_items_order_form_id_foreign` FOREIGN KEY (`order_form_id`) REFERENCES `order_forms` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_form_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `order_form_items` with 0 row(s)
--

--
-- Table structure for table `order_notes`
--

CREATE TABLE `order_notes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `external_id` char(36) NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `establishment` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`establishment`)),
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `prefix` char(3) NOT NULL,
  `date_of_issue` date NOT NULL,
  `time_of_issue` time NOT NULL,
  `date_of_due` date DEFAULT NULL,
  `delivery_date` date DEFAULT NULL,
  `customer_id` int(10) unsigned NOT NULL,
  `customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`customer`)),
  `shipping_address` text DEFAULT NULL,
  `currency_type_id` varchar(255) NOT NULL,
  `payment_method_type_id` char(2) DEFAULT NULL,
  `exchange_rate_sale` decimal(13,3) NOT NULL,
  `total_prepayment` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exportation` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxed` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_unaffected` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exonerated` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `subtotal` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `prepayments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`prepayments`)),
  `guides` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`guides`)),
  `related` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`related`)),
  `perception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`perception`)),
  `detraction` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`detraction`)),
  `legends` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`legends`)),
  `additional_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`additional_data`)),
  `filename` varchar(255) DEFAULT NULL,
  `observation` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `quotation_id` int(10) unsigned DEFAULT 0 COMMENT 'Relacion con cotizaciones',
  PRIMARY KEY (`id`),
  KEY `order_notes_user_id_foreign` (`user_id`),
  KEY `order_notes_establishment_id_foreign` (`establishment_id`),
  KEY `order_notes_customer_id_foreign` (`customer_id`),
  KEY `order_notes_soap_type_id_foreign` (`soap_type_id`),
  KEY `order_notes_state_type_id_foreign` (`state_type_id`),
  KEY `order_notes_currency_type_id_foreign` (`currency_type_id`),
  KEY `order_notes_payment_method_type_id_foreign` (`payment_method_type_id`),
  CONSTRAINT `order_notes_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `order_notes_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `order_notes_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`),
  CONSTRAINT `order_notes_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `order_notes_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `order_notes_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `order_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_notes`
--

SET autocommit=0;
COMMIT;

-- Dumped table `order_notes` with 0 row(s)
--

--
-- Table structure for table `order_note_items`
--

CREATE TABLE `order_note_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_note_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item`)),
  `quantity` decimal(12,4) NOT NULL,
  `unit_value` decimal(16,6) NOT NULL,
  `affectation_igv_type_id` varchar(255) NOT NULL,
  `total_base_igv` decimal(12,2) NOT NULL,
  `percentage_igv` decimal(12,2) NOT NULL,
  `total_igv` decimal(12,2) NOT NULL,
  `system_isc_type_id` varchar(255) DEFAULT NULL,
  `total_base_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `percentage_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `percentage_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_plastic_bag_taxes` decimal(6,2) DEFAULT 0.00 COMMENT 'Impuesto bolsa plastica',
  `total_taxes` decimal(12,2) NOT NULL,
  `price_type_id` varchar(255) NOT NULL,
  `unit_price` decimal(16,6) NOT NULL,
  `total_value` decimal(12,2) NOT NULL,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attributes`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `additional_information` longtext DEFAULT NULL COMMENT 'Informacion adcional',
  `warehouse_id` int(10) unsigned DEFAULT NULL,
  `name_product_pdf` longtext DEFAULT NULL COMMENT 'Nombre del producto para el pdf',
  PRIMARY KEY (`id`),
  KEY `order_note_items_order_note_id_foreign` (`order_note_id`),
  KEY `order_note_items_item_id_foreign` (`item_id`),
  KEY `order_note_items_affectation_igv_type_id_foreign` (`affectation_igv_type_id`),
  KEY `order_note_items_system_isc_type_id_foreign` (`system_isc_type_id`),
  KEY `order_note_items_price_type_id_foreign` (`price_type_id`),
  KEY `order_note_items_warehouse_id_foreign` (`warehouse_id`),
  CONSTRAINT `order_note_items_affectation_igv_type_id_foreign` FOREIGN KEY (`affectation_igv_type_id`) REFERENCES `cat_affectation_igv_types` (`id`),
  CONSTRAINT `order_note_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `order_note_items_order_note_id_foreign` FOREIGN KEY (`order_note_id`) REFERENCES `order_notes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `order_note_items_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `cat_price_types` (`id`),
  CONSTRAINT `order_note_items_system_isc_type_id_foreign` FOREIGN KEY (`system_isc_type_id`) REFERENCES `cat_system_isc_types` (`id`),
  CONSTRAINT `order_note_items_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_note_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `order_note_items` with 0 row(s)
--

--
-- Table structure for table `origin_addresses`
--

CREATE TABLE `origin_addresses` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `address` varchar(255) NOT NULL,
  `location_id` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`location_id`)),
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `origin_addresses`
--

SET autocommit=0;
COMMIT;

-- Dumped table `origin_addresses` with 0 row(s)
--

--
-- Table structure for table `packaging`
--

CREATE TABLE `packaging` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `item_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `soap_type_id` char(2) DEFAULT NULL,
  `item_extra_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`item_extra_data`)),
  `establishment_id` int(10) unsigned DEFAULT NULL,
  `quantity` decimal(8,2) DEFAULT 0.00,
  `number_packages` decimal(8,2) DEFAULT 0.00,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`item`)),
  `observation` longtext DEFAULT NULL,
  `lot_code` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `date_start` date DEFAULT NULL,
  `time_start` time DEFAULT NULL,
  `date_end` date DEFAULT NULL,
  `time_end` time DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `packaging_collaborator` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `packaging_soap_type_id_foreign` (`soap_type_id`),
  CONSTRAINT `packaging_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `packaging`
--

SET autocommit=0;
COMMIT;

-- Dumped table `packaging` with 0 row(s)
--

--
-- Table structure for table `padrones`
--

CREATE TABLE `padrones` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `ruc` varchar(255) NOT NULL,
  `nombre_razon_social` varchar(155) NOT NULL,
  `estado_contribuyente` varchar(100) NOT NULL,
  `condicion_domicilio` varchar(100) NOT NULL,
  `ubigeo` varchar(50) NOT NULL,
  `tipo_via` varchar(20) NOT NULL,
  `nombre_via` varchar(50) NOT NULL,
  `codigo_zona` varchar(155) NOT NULL,
  `tipo_zona` varchar(20) NOT NULL,
  `numero` varchar(155) NOT NULL,
  `interior` varchar(50) NOT NULL,
  `lote` varchar(20) NOT NULL,
  `departamento` varchar(100) NOT NULL,
  `manzana` varchar(20) NOT NULL,
  `kilometro` varchar(20) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `padrones_ruc_index` (`ruc`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `padrones`
--

SET autocommit=0;
COMMIT;

-- Dumped table `padrones` with 0 row(s)
--

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

SET autocommit=0;
COMMIT;

-- Dumped table `password_resets` with 0 row(s)
--

--
-- Table structure for table `payment_conditions`
--

CREATE TABLE `payment_conditions` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `days` int(11) NOT NULL DEFAULT 0,
  `is_locked` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_conditions`
--

SET autocommit=0;
INSERT INTO `payment_conditions` VALUES ('01','Contado',0,1,1),('02','Crédito',0,1,1);
COMMIT;

-- Dumped table `payment_conditions` with 2 row(s)
--

--
-- Table structure for table `payment_configurations`
--

SET autocommit=0;
COMMIT;

-- Dumped table `payment_configurations` with 1 row(s)
--

--
-- Table structure for table `payment_files`
--

CREATE TABLE `payment_files` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `filename` varchar(255) NOT NULL,
  `payment_id` int(11) NOT NULL,
  `payment_type` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_index` (`payment_id`,`payment_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_files`
--

SET autocommit=0;
COMMIT;

-- Dumped table `payment_files` with 0 row(s)
--

--
-- Table structure for table `payment_links`
--

CREATE TABLE `payment_links` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `soap_type_id` char(2) NOT NULL,
  `uuid` char(36) NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `payment_link_type_id` char(2) NOT NULL,
  `payment_id` int(11) DEFAULT NULL,
  `payment_type` varchar(255) DEFAULT NULL,
  `total` decimal(12,2) NOT NULL,
  `uploaded_filename` varchar(255) DEFAULT NULL,
  `query_transaction` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `payment_links_uuid_unique` (`uuid`),
  KEY `payment_index` (`payment_id`,`payment_type`),
  KEY `payment_links_user_id_foreign` (`user_id`),
  KEY `payment_links_soap_type_id_foreign` (`soap_type_id`),
  KEY `payment_links_payment_link_type_id_foreign` (`payment_link_type_id`),
  CONSTRAINT `payment_links_payment_link_type_id_foreign` FOREIGN KEY (`payment_link_type_id`) REFERENCES `payment_link_types` (`id`),
  CONSTRAINT `payment_links_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `payment_links_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_links`
--

SET autocommit=0;
COMMIT;

-- Dumped table `payment_links` with 0 row(s)
--

--
-- Table structure for table `payment_link_types`
--

CREATE TABLE `payment_link_types` (
  `id` char(2) NOT NULL,
  `description` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_link_types`
--

SET autocommit=0;
INSERT INTO `payment_link_types` VALUES ('01','Yape'),('02','Mercado Pago');
COMMIT;

-- Dumped table `payment_link_types` with 2 row(s)
--

--
-- Table structure for table `payment_method_types`
--

CREATE TABLE `payment_method_types` (
  `id` char(2) NOT NULL,
  `description` varchar(255) NOT NULL,
  `has_card` tinyint(1) NOT NULL DEFAULT 0,
  `charge` decimal(12,2) DEFAULT NULL,
  `number_days` int(11) DEFAULT NULL,
  `is_credit` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Define si es tipo credito',
  `is_cash` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Define si es es efectivo',
  `active_pos` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Visible en POS para contado',
  `pos_bank_account_id` int(10) unsigned DEFAULT NULL COMMENT 'Cuenta bancaria por defecto en POS contado. Null => caja',
  PRIMARY KEY (`id`),
  KEY `payment_method_types_is_credit_index` (`is_credit`),
  KEY `payment_method_types_active_pos_index` (`active_pos`),
  KEY `payment_method_types_pos_bank_account_id_index` (`pos_bank_account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payment_method_types`
--

SET autocommit=0;
INSERT INTO `payment_method_types` VALUES ('01','Efectivo',0,NULL,NULL,0,1,1,NULL),('02','Yape',0,NULL,NULL,0,0,1,NULL),('03','Plin',0,NULL,NULL,0,0,1,NULL),('04','Transferencia',0,NULL,NULL,0,0,0,NULL),('05','Factura a 30 dias',0,NULL,30,1,0,0,NULL),('07','BCP',0,NULL,0,0,0,1,NULL),('09','Credito',0,NULL,NULL,1,0,0,NULL);
COMMIT;

-- Dumped table `payment_method_types` with 7 row(s)
--

--
-- Table structure for table `perceptions`
--

SET autocommit=0;
COMMIT;

-- Dumped table `perceptions` with 0 row(s)
--

--
-- Table structure for table `perception_documents`
--

CREATE TABLE `perception_documents` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `perception_id` int(10) unsigned NOT NULL,
  `document_type_id` varchar(255) NOT NULL,
  `number` varchar(255) NOT NULL,
  `date_of_issue` date NOT NULL,
  `date_of_perception` date NOT NULL,
  `currency_type_id` varchar(255) NOT NULL,
  `total_document` decimal(10,2) NOT NULL,
  `total_perception` decimal(10,2) NOT NULL,
  `payments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`payments`)),
  `series` varchar(255) NOT NULL,
  `exchange_rate` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`exchange_rate`)),
  `total_to_pay` decimal(10,2) NOT NULL,
  `total_payment` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `perception_details_perception_id_foreign` (`perception_id`),
  KEY `perception_documents_document_type_id_foreign` (`document_type_id`),
  KEY `perception_documents_currency_type_id_foreign` (`currency_type_id`),
  CONSTRAINT `perception_details_perception_id_foreign` FOREIGN KEY (`perception_id`) REFERENCES `perceptions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `perception_documents_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `perception_documents_document_type_id_foreign` FOREIGN KEY (`document_type_id`) REFERENCES `cat_document_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `perception_documents`
--

SET autocommit=0;
COMMIT;

-- Dumped table `perception_documents` with 0 row(s)
--

--
-- Table structure for table `persons`
--

CREATE TABLE `persons` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('customers','suppliers') NOT NULL,
  `identity_document_type_id` varchar(255) NOT NULL,
  `number` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `birthdate` date DEFAULT NULL,
  `gender` char(1) DEFAULT NULL,
  `trade_name` varchar(255) DEFAULT NULL,
  `internal_code` varchar(100) DEFAULT NULL,
  `barcode` varchar(150) DEFAULT NULL,
  `country_id` char(2) NOT NULL,
  `nationality_id` char(2) DEFAULT NULL,
  `department_id` char(2) DEFAULT NULL,
  `province_id` char(4) DEFAULT NULL,
  `district_id` char(6) DEFAULT NULL,
  `address_type_id` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `condition` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `telephone` varchar(255) DEFAULT NULL,
  `accumulated_points` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT 'sistema por puntos',
  `perception_agent` tinyint(1) NOT NULL DEFAULT 0,
  `person_type_id` int(10) unsigned DEFAULT NULL,
  `contact` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`contact`)),
  `comment` varchar(255) DEFAULT NULL,
  `percentage_perception` decimal(12,2) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `website` text DEFAULT NULL COMMENT 'Sitio Web',
  `zone` longtext DEFAULT NULL COMMENT 'Zona',
  `observation` longtext DEFAULT NULL COMMENT 'Observaciones',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `status` tinyint(4) NOT NULL DEFAULT 1,
  `credit_days` int(10) unsigned DEFAULT 0 COMMENT 'establece los dias de credito',
  `optional_email` longtext DEFAULT NULL COMMENT 'Conjunto de correos de envio',
  `parent_id` int(10) unsigned DEFAULT 0 COMMENT 'Se relaciona con si mismo, numero mayor a 0 es el id del padre.',
  `zone_id` int(10) unsigned DEFAULT NULL,
  `seller_id` int(10) unsigned DEFAULT NULL,
  `has_discount` tinyint(1) NOT NULL DEFAULT 0,
  `discount_type` char(2) NOT NULL DEFAULT '01',
  `discount_amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `price_list` tinyint(3) unsigned NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `persons_identity_document_type_id_foreign` (`identity_document_type_id`),
  KEY `persons_country_id_foreign` (`country_id`),
  KEY `persons_department_id_foreign` (`department_id`),
  KEY `persons_province_id_foreign` (`province_id`),
  KEY `persons_district_id_foreign` (`district_id`),
  KEY `persons_name_index` (`name`),
  KEY `persons_number_index` (`number`),
  KEY `persons_type_index` (`type`),
  KEY `persons_person_type_id_foreign` (`person_type_id`),
  KEY `persons_enabled_index` (`enabled`),
  KEY `persons_address_type_id_foreign` (`address_type_id`),
  KEY `persons_seller_id_index` (`seller_id`),
  KEY `persons_nationality_id_foreign` (`nationality_id`),
  CONSTRAINT `persons_address_type_id_foreign` FOREIGN KEY (`address_type_id`) REFERENCES `cat_address_types` (`id`),
  CONSTRAINT `persons_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`),
  CONSTRAINT `persons_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
  CONSTRAINT `persons_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`),
  CONSTRAINT `persons_identity_document_type_id_foreign` FOREIGN KEY (`identity_document_type_id`) REFERENCES `cat_identity_document_types` (`id`),
  CONSTRAINT `persons_nationality_id_foreign` FOREIGN KEY (`nationality_id`) REFERENCES `countries` (`id`),
  CONSTRAINT `persons_person_type_id_foreign` FOREIGN KEY (`person_type_id`) REFERENCES `person_types` (`id`),
  CONSTRAINT `persons_province_id_foreign` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `persons`
--

SET autocommit=0;
INSERT INTO `persons` VALUES (1,'customers','0','99999999','Clientes - Varios',NULL,NULL,NULL,NULL,NULL,'PE',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00,0,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,'2026-07-02 11:24:34','2026-07-02 11:24:34',1,0,NULL,0,NULL,NULL,0,'01',0.00,1),(2,'customers','1','75478910','VEGA SALAZAR, JEAN CLAUDE',NULL,NULL,NULL,NULL,NULL,'PE',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00,0,NULL,'{\"full_name\":null,\"phone\":null}',NULL,0.00,1,NULL,NULL,NULL,'2026-07-02 11:37:32','2026-07-02 11:37:32',1,0,NULL,0,NULL,NULL,0,'01',0.00,1),(3,'customers','1','21545940','GARAYAR FLORES, ROBERTO CRESENCIO',NULL,NULL,NULL,NULL,NULL,'PE',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00,0,NULL,'{\"full_name\":null,\"phone\":null}',NULL,0.00,1,NULL,NULL,NULL,'2026-07-04 22:31:10','2026-07-04 22:31:10',1,0,NULL,0,NULL,NULL,0,'01',0.00,1);
COMMIT;

-- Dumped table `persons` with 3 row(s)
--

--
-- Table structure for table `person_address`
--

CREATE TABLE `person_address` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `person_id` int(10) unsigned NOT NULL,
  `department_id` char(2) DEFAULT NULL,
  `province_id` char(4) DEFAULT NULL,
  `district_id` char(6) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `person_address_person_id_foreign` (`person_id`),
  KEY `person_address_department_id_foreign` (`department_id`),
  KEY `person_address_province_id_foreign` (`province_id`),
  KEY `person_address_district_id_foreign` (`district_id`),
  CONSTRAINT `person_address_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
  CONSTRAINT `person_address_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`),
  CONSTRAINT `person_address_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `person_address_province_id_foreign` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_address`
--

SET autocommit=0;
COMMIT;

-- Dumped table `person_address` with 0 row(s)
--

--
-- Table structure for table `person_addresses`
--

CREATE TABLE `person_addresses` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `person_id` int(10) unsigned NOT NULL,
  `country_id` char(2) NOT NULL,
  `department_id` char(2) DEFAULT NULL,
  `province_id` char(4) DEFAULT NULL,
  `district_id` char(6) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `main` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `person_addresses_person_id_foreign` (`person_id`),
  KEY `person_addresses_country_id_foreign` (`country_id`),
  KEY `person_addresses_department_id_foreign` (`department_id`),
  KEY `person_addresses_province_id_foreign` (`province_id`),
  KEY `person_addresses_district_id_foreign` (`district_id`),
  CONSTRAINT `person_addresses_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`),
  CONSTRAINT `person_addresses_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`),
  CONSTRAINT `person_addresses_district_id_foreign` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`),
  CONSTRAINT `person_addresses_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `person_addresses_province_id_foreign` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_addresses`
--

SET autocommit=0;
COMMIT;

-- Dumped table `person_addresses` with 0 row(s)
--

--
-- Table structure for table `person_types`
--

CREATE TABLE `person_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` text NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_types`
--

SET autocommit=0;
INSERT INTO `person_types` VALUES (1,'Interno','2026-07-02 11:24:23','2026-07-02 11:24:23'),(2,'Distribuidor','2026-07-02 11:24:23','2026-07-02 11:24:23');
COMMIT;

-- Dumped table `person_types` with 2 row(s)
--

--
-- Table structure for table `pharmacy_configurations`
--

CREATE TABLE `pharmacy_configurations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `establishment_id` int(10) unsigned NOT NULL,
  `profit_field` tinyint(1) NOT NULL DEFAULT 0,
  `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;

--
-- Dumping data for table `pharmacy_configurations`
--

SET autocommit=0;
INSERT INTO `pharmacy_configurations` VALUES (1,1,0,'2026-07-02 11:36:26','2026-07-02 11:36:26');
COMMIT;

-- Dumped table `pharmacy_configurations` with 1 row(s)
--

--
-- Table structure for table `points`
--

CREATE TABLE `points` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `person_id` int(10) unsigned NOT NULL,
  `folio` varchar(255) NOT NULL,
  `points` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `banned` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `points_person_id_foreign` (`person_id`),
  CONSTRAINT `points_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `points`
--

SET autocommit=0;
COMMIT;

-- Dumped table `points` with 0 row(s)
--

--
-- Table structure for table `pos_parked_sales`
--

CREATE TABLE `pos_parked_sales` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` char(36) NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `cash_id` int(10) unsigned NOT NULL,
  `created_by_user_id` int(10) unsigned NOT NULL,
  `customer_id` int(10) unsigned DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `payload` longtext NOT NULL,
  `locked_by_user_id` int(10) unsigned DEFAULT NULL,
  `lock_expires_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pos_parked_sales_uuid_unique` (`uuid`),
  KEY `idx_pos_parked_sales_cash_id` (`cash_id`),
  KEY `idx_pos_parked_sales_created_by` (`created_by_user_id`),
  KEY `idx_pos_parked_sales_lock_expires` (`lock_expires_at`),
  KEY `idx_pos_parked_sales_created_at` (`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pos_parked_sales`
--

SET autocommit=0;
COMMIT;

-- Dumped table `pos_parked_sales` with 0 row(s)
--

--
-- Table structure for table `preprinted_format_templates`
--

CREATE TABLE `preprinted_format_templates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `formats` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `preprinted_format_templates`
--

SET autocommit=0;
COMMIT;

-- Dumped table `preprinted_format_templates` with 0 row(s)
--

--
-- Table structure for table `prescription_cie10`
--

CREATE TABLE `prescription_cie10` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `diagnoses_code` varchar(255) NOT NULL,
  `diagnoses_description` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `prescription_cie10`
--

SET autocommit=0;
COMMIT;

-- Dumped table `prescription_cie10` with 0 row(s)
--

--
-- Table structure for table `prescription_doctors`
--

CREATE TABLE `prescription_doctors` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `cmp` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `prescription_doctors`
--

SET autocommit=0;
COMMIT;

-- Dumped table `prescription_doctors` with 0 row(s)
--

--
-- Table structure for table `prescription_prescriptions`
--

CREATE TABLE `prescription_prescriptions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `customer_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `presentation_unit_type_id` int(10) unsigned DEFAULT NULL,
  `document_id` int(10) unsigned DEFAULT NULL,
  `sale_note_id` int(10) unsigned DEFAULT NULL,
  `quantity` int(11) NOT NULL,
  `prescription_number` varchar(255) DEFAULT NULL,
  `prescription_date` date DEFAULT NULL,
  `prescription_doctor_id` int(10) unsigned DEFAULT NULL,
  `doctor_name` varchar(255) DEFAULT NULL,
  `prescription_cie10_id` int(10) unsigned DEFAULT NULL,
  `diagnosis_text` varchar(255) DEFAULT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `warehouse_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `prescription_prescriptions_customer_id_foreign` (`customer_id`),
  KEY `prescription_prescriptions_item_id_foreign` (`item_id`),
  KEY `prescription_prescriptions_prescription_doctor_id_foreign` (`prescription_doctor_id`),
  KEY `prescription_prescriptions_prescription_cie10_id_foreign` (`prescription_cie10_id`),
  KEY `prescription_prescriptions_user_id_foreign` (`user_id`),
  KEY `prescription_prescriptions_warehouse_id_foreign` (`warehouse_id`),
  KEY `prescription_presentation_idx` (`presentation_unit_type_id`),
  CONSTRAINT `prescription_prescriptions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `prescription_prescriptions_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `prescription_prescriptions_prescription_cie10_id_foreign` FOREIGN KEY (`prescription_cie10_id`) REFERENCES `prescription_cie10` (`id`),
  CONSTRAINT `prescription_prescriptions_prescription_doctor_id_foreign` FOREIGN KEY (`prescription_doctor_id`) REFERENCES `prescription_doctors` (`id`),
  CONSTRAINT `prescription_prescriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `prescription_prescriptions_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `prescription_prescriptions`
--

SET autocommit=0;
COMMIT;

-- Dumped table `prescription_prescriptions` with 0 row(s)
--

--
-- Table structure for table `procedures`
--

CREATE TABLE `procedures` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `is_available` tinyint(1) NOT NULL DEFAULT 0,
  `status` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `procedures`
--

SET autocommit=0;
COMMIT;

-- Dumped table `procedures` with 0 row(s)
--

--
-- Table structure for table `production`
--

CREATE TABLE `production` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT 0,
  `soap_type_id` char(2) DEFAULT NULL,
  `item_id` int(10) unsigned DEFAULT 0,
  `inventory_id_reference` int(10) unsigned DEFAULT NULL,
  `quantity` decimal(12,4) DEFAULT 0.0000 COMMENT 'Peso dle insumo ',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `machine_id` int(10) unsigned NOT NULL DEFAULT 0,
  `production_order` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `comment` longtext DEFAULT NULL,
  `date_start` date DEFAULT NULL,
  `time_start` time DEFAULT NULL,
  `date_end` date DEFAULT NULL,
  `time_end` time DEFAULT NULL,
  `lot_code` varchar(255) DEFAULT NULL,
  `item_extra_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`item_extra_data`)),
  `mix_date_start` date DEFAULT NULL,
  `mix_time_start` time DEFAULT NULL,
  `mix_date_end` date DEFAULT NULL,
  `mix_time_end` time DEFAULT NULL,
  `informative` tinyint(3) unsigned DEFAULT 0,
  `agreed` decimal(8,2) DEFAULT 0.00,
  `imperfect` decimal(8,2) DEFAULT 0.00,
  `proccess_type` longtext DEFAULT NULL,
  `production_collaborator` text DEFAULT NULL,
  `mix_collaborator` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `production_soap_type_id_foreign` (`soap_type_id`),
  CONSTRAINT `production_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `production`
--

SET autocommit=0;
COMMIT;

-- Dumped table `production` with 0 row(s)
--

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

CREATE TABLE `promotions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `image` varchar(255) NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item_unit_type_id` int(10) unsigned DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `apply_restaurant` tinyint(1) DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `promotions_item_id_foreign` (`item_id`),
  KEY `promotion_iut_idx` (`item_unit_type_id`),
  CONSTRAINT `promotions_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `promotions_item_unit_type_id_fk` FOREIGN KEY (`item_unit_type_id`) REFERENCES `item_unit_types` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

SET autocommit=0;
COMMIT;

-- Dumped table `promotions` with 0 row(s)
--

--
-- Table structure for table `provinces`
--

CREATE TABLE `provinces` (
  `id` char(4) NOT NULL,
  `department_id` char(2) NOT NULL,
  `description` varchar(255) NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `provinces_department_id_foreign` (`department_id`),
  CONSTRAINT `provinces_department_id_foreign` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `provinces`
--

SET autocommit=0;
INSERT INTO `provinces` VALUES ('0101','01','Chachapoyas',1),('0102','01','Bagua',1),('0103','01','Bongará',1),('0104','01','Condorcanqui',1),('0105','01','Luya',1),('0106','01','Rodríguez de Mendoza',1),('0107','01','Utcubamba',1),('0201','02','Huaraz',1),('0202','02','Aija',1),('0203','02','Antonio Raymondi',1),('0204','02','Asunción',1),('0205','02','Bolognesi',1),('0206','02','Carhuaz',1),('0207','02','Carlos Fermín Fitzcarrald',1),('0208','02','Casma',1),('0209','02','Corongo',1),('0210','02','Huari',1),('0211','02','Huarmey',1),('0212','02','Huaylas',1),('0213','02','Mariscal Luzuriaga',1),('0214','02','Ocros',1),('0215','02','Pallasca',1),('0216','02','Pomabamba',1),('0217','02','Recuay',1),('0218','02','Santa',1),('0219','02','Sihuas',1),('0220','02','Yungay',1),('0301','03','Abancay',1),('0302','03','Andahuaylas',1),('0303','03','Antabamba',1),('0304','03','Aymaraes',1),('0305','03','Cotabambas',1),('0306','03','Chincheros',1),('0307','03','Grau',1),('0401','04','Arequipa',1),('0402','04','Camaná',1),('0403','04','Caravelí',1),('0404','04','Castilla',1),('0405','04','Caylloma',1),('0406','04','Condesuyos',1),('0407','04','Islay',1),('0408','04','La Uniòn',1),('0501','05','Huamanga',1),('0502','05','Cangallo',1),('0503','05','Huanca Sancos',1),('0504','05','Huanta',1),('0505','05','La Mar',1),('0506','05','Lucanas',1),('0507','05','Parinacochas',1),('0508','05','Pàucar del Sara Sara',1),('0509','05','Sucre',1),('0510','05','Víctor Fajardo',1),('0511','05','Vilcas Huamán',1),('0601','06','Cajamarca',1),('0602','06','Cajabamba',1),('0603','06','Celendín',1),('0604','06','Chota',1),('0605','06','Contumazá',1),('0606','06','Cutervo',1),('0607','06','Hualgayoc',1),('0608','06','Jaén',1),('0609','06','San Ignacio',1),('0610','06','San Marcos',1),('0611','06','San Miguel',1),('0612','06','San Pablo',1),('0613','06','Santa Cruz',1),('0701','07','Prov. Const. del Callao',1),('0801','08','Cusco',1),('0802','08','Acomayo',1),('0803','08','Anta',1),('0804','08','Calca',1),('0805','08','Canas',1),('0806','08','Canchis',1),('0807','08','Chumbivilcas',1),('0808','08','Espinar',1),('0809','08','La Convención',1),('0810','08','Paruro',1),('0811','08','Paucartambo',1),('0812','08','Quispicanchi',1),('0813','08','Urubamba',1),('0901','09','Huancavelica',1),('0902','09','Acobamba',1),('0903','09','Angaraes',1),('0904','09','Castrovirreyna',1),('0905','09','Churcampa',1),('0906','09','Huaytará',1),('0907','09','Tayacaja',1),('1001','10','Huánuco',1),('1002','10','Ambo',1),('1003','10','Dos de Mayo',1),('1004','10','Huacaybamba',1),('1005','10','Huamalíes',1),('1006','10','Leoncio Prado',1),('1007','10','Marañón',1),('1008','10','Pachitea',1),('1009','10','Puerto Inca',1),('1010','10','Lauricocha',1),('1011','10','Yarowilca',1),('1101','11','Ica',1),('1102','11','Chincha',1),('1103','11','Nasca',1),('1104','11','Palpa',1),('1105','11','Pisco',1),('1201','12','Huancayo',1),('1202','12','Concepción',1),('1203','12','Chanchamayo',1),('1204','12','Jauja',1),('1205','12','Junín',1),('1206','12','Satipo',1),('1207','12','Tarma',1),('1208','12','Yauli',1),('1209','12','Chupaca',1),('1301','13','Trujillo',1),('1302','13','Ascope',1),('1303','13','Bolívar',1),('1304','13','Chepén',1),('1305','13','Julcán',1),('1306','13','Otuzco',1),('1307','13','Pacasmayo',1),('1308','13','Pataz',1),('1309','13','Sánchez Carrión',1),('1310','13','Santiago de Chuco',1),('1311','13','Gran Chimú',1),('1312','13','Virú',1),('1401','14','Chiclayo',1),('1402','14','Ferreñafe',1),('1403','14','Lambayeque',1),('1501','15','Lima',1),('1502','15','Barranca',1),('1503','15','Cajatambo',1),('1504','15','Canta',1),('1505','15','Cañete',1),('1506','15','Huaral',1),('1507','15','Huarochirí',1),('1508','15','Huaura',1),('1509','15','Oyón',1),('1510','15','Yauyos',1),('1601','16','Maynas',1),('1602','16','Alto Amazonas',1),('1603','16','Loreto',1),('1604','16','Mariscal Ramón Castilla',1),('1605','16','Requena',1),('1606','16','Ucayali',1),('1607','16','Datem del Marañón',1),('1608','16','Putumayo',1),('1701','17','Tambopata',1),('1702','17','Manu',1),('1703','17','Tahuamanu',1),('1801','18','Mariscal Nieto',1),('1802','18','General Sánchez Cerro',1),('1803','18','Ilo',1),('1901','19','Pasco',1),('1902','19','Daniel Alcides Carrión',1),('1903','19','Oxapampa',1),('2001','20','Piura',1),('2002','20','Ayabaca',1),('2003','20','Huancabamba',1),('2004','20','Morropón',1),('2005','20','Paita',1),('2006','20','Sullana',1),('2007','20','Talara',1),('2008','20','Sechura',1),('2101','21','Puno',1),('2102','21','Azángaro',1),('2103','21','Carabaya',1),('2104','21','Chucuito',1),('2105','21','El Collao',1),('2106','21','Huancané',1),('2107','21','Lampa',1),('2108','21','Melgar',1),('2109','21','Moho',1),('2110','21','San Antonio de Putina',1),('2111','21','San Román',1),('2112','21','Sandia',1),('2113','21','Yunguyo',1),('2201','22','Moyobamba',1),('2202','22','Bellavista',1),('2203','22','El Dorado',1),('2204','22','Huallaga',1),('2205','22','Lamas',1),('2206','22','Mariscal Cáceres',1),('2207','22','Picota',1),('2208','22','Rioja',1),('2209','22','San Martín',1),('2210','22','Tocache',1),('2301','23','Tacna',1),('2302','23','Candarave',1),('2303','23','Jorge Basadre',1),('2304','23','Tarata',1),('2401','24','Tumbes',1),('2402','24','Contralmirante Villar',1),('2403','24','Zarumilla',1),('2501','25','Coronel Portillo',1),('2502','25','Atalaya',1),('2503','25','Padre Abad',1),('2504','25','Purús',1);
COMMIT;

-- Dumped table `provinces` with 196 row(s)
--

--
-- Table structure for table `purchases`
--

CREATE TABLE `purchases` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `external_id` char(36) NOT NULL,
  `xml_fingerprint_sha256` char(64) DEFAULT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `group_id` char(2) NOT NULL,
  `document_type_id` varchar(255) NOT NULL,
  `series` char(4) NOT NULL,
  `number` int(11) NOT NULL,
  `date_of_issue` date NOT NULL,
  `date_of_due` date DEFAULT NULL,
  `time_of_issue` time NOT NULL,
  `supplier_id` int(10) unsigned NOT NULL,
  `supplier` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`supplier`)),
  `purchase_order_id` int(10) unsigned DEFAULT NULL,
  `currency_type_id` varchar(255) NOT NULL,
  `payment_condition_id` varchar(255) DEFAULT NULL,
  `observation` text DEFAULT NULL,
  `exchange_rate_sale` decimal(13,3) NOT NULL,
  `total_prepayment` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exportation` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxed` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_unaffected` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exonerated` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_plastic_bag_taxes` decimal(6,2) NOT NULL DEFAULT 0.00,
  `total_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `total_canceled` tinyint(1) NOT NULL DEFAULT 0,
  `customer_id` int(10) unsigned DEFAULT NULL,
  `perception_date` date DEFAULT NULL,
  `perception_number` int(11) DEFAULT NULL,
  `total_perception` decimal(12,2) DEFAULT NULL,
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `prepayments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`prepayments`)),
  `guides` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`guides`)),
  `related` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`related`)),
  `perception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`perception`)),
  `detraction` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`detraction`)),
  `legends` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`legends`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchases_xml_fingerprint_unique` (`xml_fingerprint_sha256`),
  KEY `purchases_user_id_foreign` (`user_id`),
  KEY `purchases_establishment_id_foreign` (`establishment_id`),
  KEY `purchases_soap_type_id_foreign` (`soap_type_id`),
  KEY `purchases_state_type_id_foreign` (`state_type_id`),
  KEY `purchases_group_id_foreign` (`group_id`),
  KEY `purchases_document_type_id_foreign` (`document_type_id`),
  KEY `purchases_currency_type_id_foreign` (`currency_type_id`),
  KEY `purchases_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `purchases_customer_id_foreign` (`customer_id`),
  KEY `purchases_payment_condition_id_foreign` (`payment_condition_id`),
  KEY `purchases_supplier_document_series_number_idx` (`supplier_id`,`document_type_id`,`series`,`number`),
  CONSTRAINT `purchases_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `purchases_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `purchases_document_type_id_foreign` FOREIGN KEY (`document_type_id`) REFERENCES `cat_document_types` (`id`),
  CONSTRAINT `purchases_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`),
  CONSTRAINT `purchases_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`),
  CONSTRAINT `purchases_payment_condition_id_foreign` FOREIGN KEY (`payment_condition_id`) REFERENCES `general_payment_conditions` (`id`),
  CONSTRAINT `purchases_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`),
  CONSTRAINT `purchases_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `purchases_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `purchases_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `purchases_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchases`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchases` with 0 row(s)
--

--
-- Table structure for table `purchase_fee`
--

CREATE TABLE `purchase_fee` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_id` int(10) unsigned NOT NULL,
  `date` date NOT NULL,
  `currency_type_id` varchar(255) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `payment_method_type_id` char(2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_fee_purchase_id_foreign` (`purchase_id`),
  KEY `purchase_fee_currency_type_id_foreign` (`currency_type_id`),
  KEY `purchase_fee_payment_method_type_id_foreign` (`payment_method_type_id`),
  CONSTRAINT `purchase_fee_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `purchase_fee_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `purchase_fee_purchase_id_foreign` FOREIGN KEY (`purchase_id`) REFERENCES `purchases` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_fee`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_fee` with 0 row(s)
--

--
-- Table structure for table `purchase_items`
--

CREATE TABLE `purchase_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item`)),
  `item_lot_group_id` int(10) unsigned DEFAULT NULL,
  `lot_code` varchar(255) DEFAULT NULL,
  `quantity` decimal(12,4) NOT NULL,
  `unit_value` decimal(16,6) NOT NULL,
  `date_of_due` date DEFAULT NULL,
  `affectation_igv_type_id` varchar(255) NOT NULL,
  `total_base_igv` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `percentage_igv` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `total_igv` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `system_isc_type_id` varchar(255) DEFAULT NULL,
  `total_base_isc` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `percentage_isc` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `total_isc` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `total_base_other_taxes` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `percentage_other_taxes` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `total_other_taxes` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `total_taxes` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `price_type_id` varchar(255) NOT NULL,
  `unit_price` decimal(16,6) NOT NULL,
  `total_value` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `total_charge` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `total_discount` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `total` decimal(12,4) NOT NULL DEFAULT 0.0000,
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attributes`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `warehouse_id` int(10) unsigned DEFAULT NULL,
  `name_product_pdf` longtext DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_items_purchase_id_foreign` (`purchase_id`),
  KEY `purchase_items_item_id_foreign` (`item_id`),
  KEY `purchase_items_affectation_igv_type_id_foreign` (`affectation_igv_type_id`),
  KEY `purchase_items_system_isc_type_id_foreign` (`system_isc_type_id`),
  KEY `purchase_items_price_type_id_foreign` (`price_type_id`),
  KEY `purchase_items_warehouse_id_foreign` (`warehouse_id`),
  KEY `purchase_items_item_lot_group_id_index` (`item_lot_group_id`),
  CONSTRAINT `purchase_items_affectation_igv_type_id_foreign` FOREIGN KEY (`affectation_igv_type_id`) REFERENCES `cat_affectation_igv_types` (`id`),
  CONSTRAINT `purchase_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `purchase_items_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `cat_price_types` (`id`),
  CONSTRAINT `purchase_items_purchase_id_foreign` FOREIGN KEY (`purchase_id`) REFERENCES `purchases` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_items_system_isc_type_id_foreign` FOREIGN KEY (`system_isc_type_id`) REFERENCES `cat_system_isc_types` (`id`),
  CONSTRAINT `purchase_items_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_items` with 0 row(s)
--

--
-- Table structure for table `purchase_orders`
--

CREATE TABLE `purchase_orders` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `external_id` char(36) NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `prefix` varchar(255) NOT NULL DEFAULT 'OC',
  `date_of_issue` date NOT NULL,
  `date_of_due` date DEFAULT NULL,
  `time_of_issue` time NOT NULL,
  `supplier_id` int(10) unsigned NOT NULL,
  `supplier` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`supplier`)),
  `currency_type_id` varchar(255) NOT NULL,
  `exchange_rate_sale` decimal(13,3) NOT NULL,
  `total_prepayment` decimal(12,4) NOT NULL,
  `total_charge` decimal(12,4) NOT NULL,
  `total_discount` decimal(12,4) NOT NULL,
  `total_exportation` decimal(12,4) NOT NULL,
  `total_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxed` decimal(12,4) NOT NULL,
  `total_unaffected` decimal(12,4) NOT NULL,
  `total_exonerated` decimal(12,4) NOT NULL,
  `total_igv` decimal(12,4) NOT NULL,
  `total_base_isc` decimal(12,4) NOT NULL,
  `total_isc` decimal(12,4) NOT NULL,
  `total_base_other_taxes` decimal(12,4) NOT NULL,
  `total_other_taxes` decimal(12,4) NOT NULL,
  `total_taxes` decimal(12,4) NOT NULL,
  `total_value` decimal(12,4) NOT NULL,
  `total` decimal(12,4) NOT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `upload_filename` varchar(255) DEFAULT NULL,
  `purchase_quotation_id` int(10) unsigned DEFAULT NULL,
  `sale_opportunity_id` int(10) unsigned DEFAULT NULL,
  `payment_method_type_id` char(2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_orders_purchase_quotation_id_foreign` (`purchase_quotation_id`),
  KEY `purchase_orders_user_id_foreign` (`user_id`),
  KEY `purchase_orders_establishment_id_foreign` (`establishment_id`),
  KEY `purchase_orders_supplier_id_foreign` (`supplier_id`),
  KEY `purchase_orders_soap_type_id_foreign` (`soap_type_id`),
  KEY `purchase_orders_state_type_id_foreign` (`state_type_id`),
  KEY `purchase_orders_currency_type_id_foreign` (`currency_type_id`),
  KEY `purchase_orders_payment_method_type_id_foreign` (`payment_method_type_id`),
  KEY `purchase_orders_sale_opportunity_id_foreign` (`sale_opportunity_id`),
  CONSTRAINT `purchase_orders_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `purchase_orders_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`),
  CONSTRAINT `purchase_orders_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `purchase_orders_purchase_quotation_id_foreign` FOREIGN KEY (`purchase_quotation_id`) REFERENCES `purchase_quotations` (`id`),
  CONSTRAINT `purchase_orders_sale_opportunity_id_foreign` FOREIGN KEY (`sale_opportunity_id`) REFERENCES `sale_opportunities` (`id`),
  CONSTRAINT `purchase_orders_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `purchase_orders_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `purchase_orders_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `purchase_orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_orders`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_orders` with 0 row(s)
--

--
-- Table structure for table `purchase_order_items`
--

CREATE TABLE `purchase_order_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_order_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item`)),
  `quantity` int(11) NOT NULL,
  `unit_value` decimal(16,6) NOT NULL,
  `affectation_igv_type_id` varchar(255) NOT NULL,
  `total_base_igv` decimal(12,2) NOT NULL,
  `percentage_igv` decimal(12,2) NOT NULL,
  `total_igv` decimal(12,2) NOT NULL,
  `system_isc_type_id` varchar(255) DEFAULT NULL,
  `total_base_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `percentage_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `percentage_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxes` decimal(12,2) NOT NULL,
  `price_type_id` varchar(255) NOT NULL,
  `unit_price` decimal(16,6) NOT NULL,
  `total_value` decimal(12,2) NOT NULL,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attributes`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  PRIMARY KEY (`id`),
  KEY `purchase_order_items_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `purchase_order_items_item_id_foreign` (`item_id`),
  KEY `purchase_order_items_affectation_igv_type_id_foreign` (`affectation_igv_type_id`),
  KEY `purchase_order_items_system_isc_type_id_foreign` (`system_isc_type_id`),
  KEY `purchase_order_items_price_type_id_foreign` (`price_type_id`),
  CONSTRAINT `purchase_order_items_affectation_igv_type_id_foreign` FOREIGN KEY (`affectation_igv_type_id`) REFERENCES `cat_affectation_igv_types` (`id`),
  CONSTRAINT `purchase_order_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `purchase_order_items_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `cat_price_types` (`id`),
  CONSTRAINT `purchase_order_items_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE,
  CONSTRAINT `purchase_order_items_system_isc_type_id_foreign` FOREIGN KEY (`system_isc_type_id`) REFERENCES `cat_system_isc_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_order_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_order_items` with 0 row(s)
--

--
-- Table structure for table `purchase_payments`
--

CREATE TABLE `purchase_payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_id` int(10) unsigned NOT NULL,
  `purchase_fee_id` int(10) unsigned DEFAULT NULL,
  `date_of_payment` date NOT NULL,
  `payment_method_type_id` char(2) NOT NULL,
  `has_card` tinyint(1) NOT NULL DEFAULT 0,
  `card_brand_id` char(2) DEFAULT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `payment` decimal(12,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_payments_purchase_id_foreign` (`purchase_id`),
  KEY `purchase_payments_card_brand_id_foreign` (`card_brand_id`),
  KEY `purchase_payments_payment_method_type_id_foreign` (`payment_method_type_id`),
  KEY `purchase_payments_date_of_payment_index` (`date_of_payment`),
  KEY `purchase_payments_purchase_fee_id_index` (`purchase_fee_id`),
  CONSTRAINT `purchase_payments_card_brand_id_foreign` FOREIGN KEY (`card_brand_id`) REFERENCES `card_brands` (`id`),
  CONSTRAINT `purchase_payments_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `purchase_payments_purchase_fee_id_foreign` FOREIGN KEY (`purchase_fee_id`) REFERENCES `purchase_fee` (`id`) ON DELETE SET NULL,
  CONSTRAINT `purchase_payments_purchase_id_foreign` FOREIGN KEY (`purchase_id`) REFERENCES `purchases` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_payments`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_payments` with 0 row(s)
--

--
-- Table structure for table `purchase_quotations`
--

CREATE TABLE `purchase_quotations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `external_id` char(36) NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `establishment` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`establishment`)),
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `prefix` varchar(255) NOT NULL,
  `date_of_issue` date NOT NULL,
  `time_of_issue` time NOT NULL,
  `suppliers` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`suppliers`)),
  `filename` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_quotations_user_id_foreign` (`user_id`),
  KEY `purchase_quotations_establishment_id_foreign` (`establishment_id`),
  KEY `purchase_quotations_soap_type_id_foreign` (`soap_type_id`),
  KEY `purchase_quotations_state_type_id_foreign` (`state_type_id`),
  CONSTRAINT `purchase_quotations_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`),
  CONSTRAINT `purchase_quotations_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `purchase_quotations_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `purchase_quotations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_quotations`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_quotations` with 0 row(s)
--

--
-- Table structure for table `purchase_quotation_items`
--

CREATE TABLE `purchase_quotation_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_quotation_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item`)),
  `quantity` decimal(12,4) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_quotation_items_purchase_quotation_id_foreign` (`purchase_quotation_id`),
  KEY `purchase_quotation_items_item_id_foreign` (`item_id`),
  CONSTRAINT `purchase_quotation_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `purchase_quotation_items_purchase_quotation_id_foreign` FOREIGN KEY (`purchase_quotation_id`) REFERENCES `purchase_quotations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_quotation_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_quotation_items` with 0 row(s)
--

--
-- Table structure for table `purchase_settlements`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_settlements` with 0 row(s)
--

--
-- Table structure for table `purchase_settlement_items`
--

CREATE TABLE `purchase_settlement_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_settlement_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item`)),
  `quantity` decimal(12,2) NOT NULL,
  `unit_value` decimal(12,2) NOT NULL,
  `affectation_igv_type_id` varchar(255) NOT NULL,
  `total_base_igv` decimal(12,2) NOT NULL,
  `percentage_igv` decimal(12,2) NOT NULL,
  `total_igv` decimal(12,2) NOT NULL,
  `total_taxes` decimal(12,2) NOT NULL,
  `price_type_id` varchar(255) NOT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `total_value` decimal(12,2) NOT NULL,
  `total` decimal(12,2) NOT NULL,
  `income_tax_affectation_igv_type_id` varchar(255) DEFAULT NULL,
  `income_retention_percentage` decimal(12,2) NOT NULL DEFAULT 0.00,
  `income_retention_amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  PRIMARY KEY (`id`),
  KEY `purchase_settlement_items_purchase_settlement_id_foreign` (`purchase_settlement_id`),
  KEY `purchase_settlement_items_item_id_foreign` (`item_id`),
  KEY `p_s_i_income_tax_affectation_igv_type_id_fk` (`income_tax_affectation_igv_type_id`),
  KEY `purchase_settlement_items_affectation_igv_type_id_foreign` (`affectation_igv_type_id`),
  KEY `purchase_settlement_items_price_type_id_foreign` (`price_type_id`),
  CONSTRAINT `p_s_i_income_tax_affectation_igv_type_id_fk` FOREIGN KEY (`income_tax_affectation_igv_type_id`) REFERENCES `cat_affectation_igv_types` (`id`),
  CONSTRAINT `purchase_settlement_items_affectation_igv_type_id_foreign` FOREIGN KEY (`affectation_igv_type_id`) REFERENCES `cat_affectation_igv_types` (`id`),
  CONSTRAINT `purchase_settlement_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `purchase_settlement_items_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `cat_price_types` (`id`),
  CONSTRAINT `purchase_settlement_items_purchase_settlement_id_foreign` FOREIGN KEY (`purchase_settlement_id`) REFERENCES `purchase_settlements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_settlement_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_settlement_items` with 0 row(s)
--

--
-- Table structure for table `purchase_settlement_payments`
--

CREATE TABLE `purchase_settlement_payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_settlement_id` int(10) unsigned NOT NULL,
  `date_of_payment` date NOT NULL,
  `payment_method_type_id` char(2) NOT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `change` decimal(12,2) NOT NULL DEFAULT 0.00,
  `payment` decimal(12,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_settlement_payments_purchase_settlement_id_foreign` (`purchase_settlement_id`),
  KEY `purchase_settlement_payments_payment_method_type_id_foreign` (`payment_method_type_id`),
  CONSTRAINT `purchase_settlement_payments_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `purchase_settlement_payments_purchase_settlement_id_foreign` FOREIGN KEY (`purchase_settlement_id`) REFERENCES `purchase_settlements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_settlement_payments`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_settlement_payments` with 0 row(s)
--

--
-- Table structure for table `purchase_xml_imports`
--

CREATE TABLE `purchase_xml_imports` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `import_id` char(36) NOT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'previewed',
  `supplier_id` int(10) unsigned DEFAULT NULL,
  `supplier_ruc` varchar(15) DEFAULT NULL,
  `document_type_id` varchar(2) DEFAULT NULL,
  `series` varchar(20) DEFAULT NULL,
  `number` varchar(20) DEFAULT NULL,
  `xml_fingerprint_sha256` char(64) NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`payload`)),
  `issues` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`issues`)),
  `resolutions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`resolutions`)),
  `confirmed_purchase_id` int(10) unsigned DEFAULT NULL,
  `confirmed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `purchase_xml_imports_import_id_unique` (`import_id`),
  KEY `purchase_xml_imports_created_by_foreign` (`created_by`),
  KEY `purchase_xml_imports_supplier_id_foreign` (`supplier_id`),
  KEY `purchase_xml_imports_confirmed_purchase_id_foreign` (`confirmed_purchase_id`),
  KEY `purchase_xml_imports_status_index` (`status`),
  KEY `purchase_xml_imports_fingerprint_idx` (`xml_fingerprint_sha256`),
  CONSTRAINT `purchase_xml_imports_confirmed_purchase_id_foreign` FOREIGN KEY (`confirmed_purchase_id`) REFERENCES `purchases` (`id`),
  CONSTRAINT `purchase_xml_imports_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `purchase_xml_imports_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_xml_imports`
--

SET autocommit=0;
COMMIT;

-- Dumped table `purchase_xml_imports` with 0 row(s)
--

--
-- Table structure for table `quotations`
--

CREATE TABLE `quotations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `seller_id` int(10) unsigned DEFAULT NULL,
  `external_id` char(36) NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `establishment` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`establishment`)),
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `prefix` char(3) NOT NULL,
  `date_of_issue` date NOT NULL,
  `time_of_issue` time NOT NULL,
  `date_of_due` varchar(255) DEFAULT NULL,
  `delivery_date` varchar(255) DEFAULT NULL,
  `customer_id` int(10) unsigned NOT NULL,
  `customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`customer`)),
  `shipping_address` text DEFAULT NULL,
  `currency_type_id` varchar(255) NOT NULL,
  `payment_method_type_id` char(2) DEFAULT NULL,
  `exchange_rate_sale` decimal(13,3) NOT NULL,
  `total_prepayment` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exportation` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxed` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_unaffected` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exonerated` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `subtotal` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `prepayments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`prepayments`)),
  `guides` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`guides`)),
  `related` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`related`)),
  `perception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`perception`)),
  `detraction` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`detraction`)),
  `legends` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`legends`)),
  `filename` varchar(255) DEFAULT NULL,
  `terms_condition` text DEFAULT NULL,
  `referential_information` varchar(100) DEFAULT NULL,
  `account_number` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `contact` varchar(255) DEFAULT NULL,
  `changed` tinyint(1) NOT NULL DEFAULT 0,
  `sale_opportunity_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `description` varchar(1000) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `quotations_user_id_foreign` (`user_id`),
  KEY `quotations_establishment_id_foreign` (`establishment_id`),
  KEY `quotations_customer_id_foreign` (`customer_id`),
  KEY `quotations_soap_type_id_foreign` (`soap_type_id`),
  KEY `quotations_state_type_id_foreign` (`state_type_id`),
  KEY `quotations_currency_type_id_foreign` (`currency_type_id`),
  KEY `quotations_payment_method_type_id_foreign` (`payment_method_type_id`),
  KEY `quotations_sale_opportunity_id_foreign` (`sale_opportunity_id`),
  CONSTRAINT `quotations_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `quotations_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `quotations_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`),
  CONSTRAINT `quotations_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `quotations_sale_opportunity_id_foreign` FOREIGN KEY (`sale_opportunity_id`) REFERENCES `sale_opportunities` (`id`),
  CONSTRAINT `quotations_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `quotations_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `quotations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `quotations`
--

SET autocommit=0;
COMMIT;

-- Dumped table `quotations` with 0 row(s)
--

--
-- Table structure for table `quotation_items`
--

CREATE TABLE `quotation_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `quotation_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item`)),
  `quantity` decimal(12,4) NOT NULL,
  `unit_value` decimal(16,6) NOT NULL,
  `affectation_igv_type_id` varchar(255) NOT NULL,
  `total_base_igv` decimal(12,2) NOT NULL,
  `percentage_igv` decimal(12,2) NOT NULL,
  `total_igv` decimal(12,2) NOT NULL,
  `system_isc_type_id` varchar(255) DEFAULT NULL,
  `total_base_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `percentage_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `percentage_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxes` decimal(12,2) NOT NULL,
  `price_type_id` varchar(255) NOT NULL,
  `unit_price` decimal(16,6) NOT NULL,
  `total_value` decimal(12,2) NOT NULL,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attributes`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `additional_information` longtext DEFAULT NULL COMMENT 'Informacion adicional',
  `warehouse_id` int(10) unsigned DEFAULT 0 COMMENT 'Id de warehouse',
  `name_product_pdf` longtext DEFAULT NULL COMMENT 'Nombre de producto en el pdf',
  PRIMARY KEY (`id`),
  KEY `quotation_items_quotation_id_foreign` (`quotation_id`),
  KEY `quotation_items_item_id_foreign` (`item_id`),
  KEY `quotation_items_affectation_igv_type_id_foreign` (`affectation_igv_type_id`),
  KEY `quotation_items_system_isc_type_id_foreign` (`system_isc_type_id`),
  KEY `quotation_items_price_type_id_foreign` (`price_type_id`),
  CONSTRAINT `quotation_items_affectation_igv_type_id_foreign` FOREIGN KEY (`affectation_igv_type_id`) REFERENCES `cat_affectation_igv_types` (`id`),
  CONSTRAINT `quotation_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `quotation_items_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `cat_price_types` (`id`),
  CONSTRAINT `quotation_items_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`) ON DELETE CASCADE,
  CONSTRAINT `quotation_items_system_isc_type_id_foreign` FOREIGN KEY (`system_isc_type_id`) REFERENCES `cat_system_isc_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `quotation_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `quotation_items` with 0 row(s)
--

--
-- Table structure for table `quotation_payments`
--

CREATE TABLE `quotation_payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `quotation_id` int(10) unsigned NOT NULL,
  `date_of_payment` date NOT NULL,
  `payment_method_type_id` char(2) NOT NULL,
  `has_card` tinyint(1) NOT NULL DEFAULT 0,
  `card_brand_id` char(2) DEFAULT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `change` decimal(12,2) DEFAULT NULL,
  `payment` decimal(12,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `quotation_payments_quotation_id_foreign` (`quotation_id`),
  KEY `quotation_payments_card_brand_id_foreign` (`card_brand_id`),
  KEY `quotation_payments_payment_method_type_id_foreign` (`payment_method_type_id`),
  CONSTRAINT `quotation_payments_card_brand_id_foreign` FOREIGN KEY (`card_brand_id`) REFERENCES `card_brands` (`id`),
  CONSTRAINT `quotation_payments_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `quotation_payments_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `quotation_payments`
--

SET autocommit=0;
COMMIT;

-- Dumped table `quotation_payments` with 0 row(s)
--

--
-- Table structure for table `rel_user_to_documentary_offices`
--

CREATE TABLE `rel_user_to_documentary_offices` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `active` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `user_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'usuario asociado',
  `documentary_office_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'etapa asociada',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rel_user_to_documentary_offices`
--

SET autocommit=0;
COMMIT;

-- Dumped table `rel_user_to_documentary_offices` with 0 row(s)
--

--
-- Table structure for table `report_configurations`
--

CREATE TABLE `report_configurations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `route_name` varchar(255) NOT NULL,
  `route_path` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `convert_pen` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `report_configurations_route_name_unique` (`route_name`),
  UNIQUE KEY `report_configurations_route_path_unique` (`route_path`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `report_configurations`
--

SET autocommit=0;
INSERT INTO `report_configurations` VALUES (1,'tenant.reports.general_items.index','reports/general-items','Ventas - Reporte general de productos',0,'2026-07-02 11:24:32','2026-07-02 11:24:32'),(2,'tenant.reports.purchases.general_items.index','reports/purchases/general_items','Compras - Reporte general de productos',0,'2026-07-02 11:24:32','2026-07-02 11:24:32'),(3,'tenant.reports.purchases.index','reports/purchases','Compras - Compras totales',0,'2026-07-02 11:24:32','2026-07-02 11:24:32');
COMMIT;

-- Dumped table `report_configurations` with 3 row(s)
--

--
-- Table structure for table `restaurant_configurations`
--

CREATE TABLE `restaurant_configurations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `menu_pos` tinyint(1) NOT NULL,
  `menu_order` tinyint(1) NOT NULL,
  `menu_tables` tinyint(1) NOT NULL,
  `first_menu` varchar(255) NOT NULL,
  `tables_quantity` int(11) NOT NULL DEFAULT 15,
  `menu_bar` tinyint(1) NOT NULL DEFAULT 1,
  `menu_kitchen` tinyint(1) NOT NULL DEFAULT 1,
  `items_maintenance` tinyint(1) NOT NULL DEFAULT 0,
  `enabled_environment_1` tinyint(1) NOT NULL DEFAULT 1,
  `enabled_environment_2` tinyint(1) NOT NULL DEFAULT 0,
  `tables_quantity_environment_2` int(11) NOT NULL DEFAULT 5,
  `enabled_environment_3` tinyint(1) NOT NULL DEFAULT 0,
  `tables_quantity_environment_3` int(11) NOT NULL DEFAULT 5,
  `enabled_environment_4` tinyint(1) NOT NULL DEFAULT 0,
  `tables_quantity_environment_4` int(11) NOT NULL DEFAULT 5,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `restaurant_configurations`
--

SET autocommit=0;
INSERT INTO `restaurant_configurations` VALUES (1,1,1,1,'POS',15,1,1,0,1,0,5,0,5,0,5);
COMMIT;

-- Dumped table `restaurant_configurations` with 1 row(s)
--

--
-- Table structure for table `restaurant_notes`
--

CREATE TABLE `restaurant_notes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `restaurant_notes`
--

SET autocommit=0;
COMMIT;

-- Dumped table `restaurant_notes` with 0 row(s)
--

--
-- Table structure for table `restaurant_roles`
--

CREATE TABLE `restaurant_roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `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;

--
-- Dumping data for table `restaurant_roles`
--

SET autocommit=0;
INSERT INTO `restaurant_roles` VALUES (1,'MOZO','Mozo','Usuario que genera pedidos en mesas',NULL,NULL),(2,'CAJA','Caja','Usuario que genera pago de pedidos',NULL,NULL),(3,'ADM','Administrador','Usuario con permisos totales',NULL,NULL),(6,'KITBAR','Cocina/Bar','Usuario con acceso a cocina y bar',NULL,NULL);
COMMIT;

-- Dumped table `restaurant_roles` with 4 row(s)
--

--
-- Table structure for table `restaurant_tables`
--

CREATE TABLE `restaurant_tables` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `status` varchar(255) NOT NULL,
  `products` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`products`)),
  `total` decimal(12,2) NOT NULL,
  `personas` int(11) NOT NULL,
  `cliente` varchar(255) DEFAULT NULL,
  `comentarios` varchar(255) DEFAULT NULL,
  `label` varchar(255) NOT NULL,
  `shape` varchar(255) NOT NULL,
  `environment` varchar(255) NOT NULL,
  `waiter` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `restaurant_tables`
--

SET autocommit=0;
COMMIT;

-- Dumped table `restaurant_tables` with 0 row(s)
--

--
-- Table structure for table `restaurant_table_envs`
--

CREATE TABLE `restaurant_table_envs` (
  `id` int(10) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `active` tinyint(1) NOT NULL,
  `tables_quantity` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `restaurant_table_envs`
--

SET autocommit=0;
INSERT INTO `restaurant_table_envs` VALUES (1,'Ambiente 1',1,25),(2,'Ambiente 2',1,25),(3,'Ambiente 3',1,25),(4,'Ambiente 4',1,25);
COMMIT;

-- Dumped table `restaurant_table_envs` with 4 row(s)
--

--
-- Table structure for table `retentions`
--

SET autocommit=0;
COMMIT;

-- Dumped table `retentions` with 0 row(s)
--

--
-- Table structure for table `retention_documents`
--

CREATE TABLE `retention_documents` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `retention_id` int(10) unsigned NOT NULL,
  `document_type_id` varchar(255) NOT NULL,
  `series` varchar(255) NOT NULL,
  `number` varchar(255) NOT NULL,
  `date_of_issue` date NOT NULL,
  `currency_type_id` varchar(255) NOT NULL,
  `total_document` decimal(10,2) NOT NULL,
  `payments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`payments`)),
  `exchange_rate` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`exchange_rate`)),
  `date_of_retention` date NOT NULL,
  `total_retention` decimal(10,2) NOT NULL,
  `total_to_pay` decimal(10,2) NOT NULL,
  `total_payment` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `retention_documents_retention_id_foreign` (`retention_id`),
  KEY `retention_documents_document_type_id_foreign` (`document_type_id`),
  KEY `retention_documents_currency_type_id_foreign` (`currency_type_id`),
  CONSTRAINT `retention_documents_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `retention_documents_document_type_id_foreign` FOREIGN KEY (`document_type_id`) REFERENCES `cat_document_types` (`id`),
  CONSTRAINT `retention_documents_retention_id_foreign` FOREIGN KEY (`retention_id`) REFERENCES `retentions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `retention_documents`
--

SET autocommit=0;
COMMIT;

-- Dumped table `retention_documents` with 0 row(s)
--

--
-- Table structure for table `sale_notes`
--

CREATE TABLE `sale_notes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `voided_by_user_id` int(10) unsigned DEFAULT NULL,
  `voided_at` timestamp NULL DEFAULT NULL,
  `voided_reason` varchar(255) DEFAULT NULL,
  `external_id` char(36) NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `establishment` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`establishment`)),
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `prefix` char(2) NOT NULL DEFAULT 'NV',
  `series` varchar(255) DEFAULT NULL,
  `number` int(11) DEFAULT NULL,
  `date_of_issue` date NOT NULL,
  `time_of_issue` time NOT NULL,
  `customer_id` int(10) unsigned NOT NULL,
  `customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`customer`)),
  `currency_type_id` varchar(255) NOT NULL,
  `payment_condition_id` char(2) NOT NULL DEFAULT '01',
  `payment_method_type_id` char(2) DEFAULT NULL,
  `exchange_rate_sale` decimal(13,3) NOT NULL,
  `point_system` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'indica si se uso en sistema por puntos',
  `point_system_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'datos de sistema por puntos' CHECK (json_valid(`point_system_data`)),
  `created_from_pos` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'indica si se registro desde pos',
  `apply_concurrency` tinyint(1) NOT NULL DEFAULT 0,
  `enabled_concurrency` tinyint(1) NOT NULL DEFAULT 0,
  `automatic_date_of_issue` date DEFAULT NULL,
  `quantity_period` int(11) DEFAULT NULL,
  `type_period` varchar(255) DEFAULT NULL,
  `total_prepayment` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `coupon_id` int(10) unsigned DEFAULT NULL,
  `coupon_code` varchar(50) DEFAULT NULL,
  `total_exportation` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxed` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_unaffected` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exonerated` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_plastic_bag_taxes` decimal(6,2) NOT NULL DEFAULT 0.00,
  `total_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `subtotal` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `dispatch_ticket_pdf` tinyint(1) NOT NULL DEFAULT 0,
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `prepayments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`prepayments`)),
  `guides` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`guides`)),
  `related` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`related`)),
  `perception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`perception`)),
  `detraction` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`detraction`)),
  `legends` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`legends`)),
  `additional_information` text DEFAULT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `unique_filename` varchar(255) DEFAULT NULL,
  `quotation_id` int(10) unsigned DEFAULT NULL,
  `order_note_id` int(10) unsigned DEFAULT NULL,
  `technical_service_id` int(10) unsigned DEFAULT NULL,
  `order_id` int(10) unsigned DEFAULT NULL,
  `total_canceled` tinyint(1) NOT NULL DEFAULT 0,
  `changed` tinyint(1) NOT NULL DEFAULT 0,
  `paid` tinyint(1) NOT NULL DEFAULT 0,
  `license_plate` varchar(255) DEFAULT NULL,
  `plate_number` varchar(255) DEFAULT NULL,
  `reference_data` varchar(500) DEFAULT NULL,
  `agent_id` int(10) unsigned DEFAULT NULL,
  `observation` text DEFAULT NULL,
  `purchase_order` varchar(50) DEFAULT NULL,
  `document_id` int(10) unsigned DEFAULT NULL,
  `user_rel_suscription_plan_id` int(10) unsigned DEFAULT 0 COMMENT 'Relacion con suscripciones',
  `due_date` date DEFAULT NULL COMMENT 'Fecha de vencimiento',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `total_points` double NOT NULL DEFAULT 0,
  `seller_id` int(10) unsigned DEFAULT 0,
  `grade` text DEFAULT NULL COMMENT 'Grado designado - utilizado en matricula',
  `section` text DEFAULT NULL COMMENT 'Seccion designado - utilizado en matricula',
  `terms_condition` text DEFAULT NULL,
  `prescription_doctor_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sale_notes_unique_filename_unique` (`unique_filename`),
  KEY `sale_notes_user_id_foreign` (`user_id`),
  KEY `sale_notes_establishment_id_foreign` (`establishment_id`),
  KEY `sale_notes_customer_id_foreign` (`customer_id`),
  KEY `sale_notes_soap_type_id_foreign` (`soap_type_id`),
  KEY `sale_notes_state_type_id_foreign` (`state_type_id`),
  KEY `sale_notes_currency_type_id_foreign` (`currency_type_id`),
  KEY `sale_notes_quotation_id_foreign` (`quotation_id`),
  KEY `sale_notes_apply_concurrency_index` (`apply_concurrency`),
  KEY `sale_notes_type_period_index` (`type_period`),
  KEY `sale_notes_quantity_period_index` (`quantity_period`),
  KEY `sale_notes_automatic_date_of_issue_index` (`automatic_date_of_issue`),
  KEY `sale_notes_enabled_concurrency_index` (`enabled_concurrency`),
  KEY `sale_notes_order_note_id_foreign` (`order_note_id`),
  KEY `sale_notes_payment_method_type_id_foreign` (`payment_method_type_id`),
  KEY `sale_notes_order_id_foreign` (`order_id`),
  KEY `sale_notes_technical_service_id_foreign` (`technical_service_id`),
  KEY `sale_notes_agent_id_foreign` (`agent_id`),
  KEY `sale_notes_changed_index` (`changed`),
  KEY `sale_notes_payment_condition_id_foreign` (`payment_condition_id`),
  CONSTRAINT `sale_notes_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `agents` (`id`),
  CONSTRAINT `sale_notes_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `sale_notes_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `sale_notes_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`),
  CONSTRAINT `sale_notes_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`),
  CONSTRAINT `sale_notes_order_note_id_foreign` FOREIGN KEY (`order_note_id`) REFERENCES `order_notes` (`id`),
  CONSTRAINT `sale_notes_payment_condition_id_foreign` FOREIGN KEY (`payment_condition_id`) REFERENCES `payment_conditions` (`id`),
  CONSTRAINT `sale_notes_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `sale_notes_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`),
  CONSTRAINT `sale_notes_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `sale_notes_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `sale_notes_technical_service_id_foreign` FOREIGN KEY (`technical_service_id`) REFERENCES `technical_services` (`id`),
  CONSTRAINT `sale_notes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_notes`
--

SET autocommit=0;
INSERT INTO `sale_notes` VALUES (1,4,NULL,NULL,NULL,'b1b69d63-e41c-458b-b90f-28981b4343cf',1,'{\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"11\",\"department\":{\"id\":\"11\",\"description\":\"ICA\"},\"province_id\":\"1101\",\"province\":{\"id\":\"1101\",\"description\":\"Ica\"},\"district_id\":\"110101\",\"district\":{\"id\":\"110101\",\"description\":\"Ica\"},\"urbanization\":null,\"address\":\"Av Victorio Gotuzzo Bianchi\",\"email\":\"rgarayarf@gmail.com\",\"telephone\":\"956814646\",\"code\":\"0000\",\"trade_address\":\"Av Victorio Gotuzzo Bianchi\",\"web_address\":null,\"aditional_information\":null,\"logo\":null}','01','01','NV','NV01',1,'2026-07-20','12:02:14',1,'{\"identity_document_type_id\":\"0\",\"identity_document_type\":{\"id\":\"0\",\"description\":\"Doc.trib.no.dom.sin.ruc\"},\"number\":\"99999999\",\"name\":\"Clientes - Varios\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":null,\"department\":{\"id\":null,\"description\":null},\"province_id\":null,\"province\":{\"id\":null,\"description\":null},\"district_id\":null,\"district\":{\"id\":null,\"description\":null},\"address\":null,\"email\":null,\"telephone\":null,\"perception_agent\":false,\"address_id\":null,\"internal_code\":null,\"address_type_id\":null,\"address_type\":{\"id\":null,\"description\":null}}','PEN','01',NULL,3.408,0,NULL,1,0,0,NULL,NULL,NULL,0.00,0.00,0.00,NULL,NULL,0.00,0.00,2.54,0.00,0.00,0.46,0.00,0.00,0.00,0.00,0.00,0.00,0.46,2.54,3.00,3.00,0,'[]','[]',NULL,'[]',NULL,NULL,NULL,NULL,'','NV01-1-20260720','NV01-1-20260720',NULL,NULL,NULL,NULL,1,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'2026-07-20 12:03:58','2026-07-20 12:03:58',0,4,NULL,NULL,NULL,NULL),(2,4,NULL,NULL,NULL,'f26b283a-bad1-4671-a0b0-aa150bc5c49f',1,'{\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"11\",\"department\":{\"id\":\"11\",\"description\":\"ICA\"},\"province_id\":\"1101\",\"province\":{\"id\":\"1101\",\"description\":\"Ica\"},\"district_id\":\"110101\",\"district\":{\"id\":\"110101\",\"description\":\"Ica\"},\"urbanization\":null,\"address\":\"Av Victorio Gotuzzo Bianchi\",\"email\":\"rgarayarf@gmail.com\",\"telephone\":\"956814646\",\"code\":\"0000\",\"trade_address\":\"Av Victorio Gotuzzo Bianchi\",\"web_address\":null,\"aditional_information\":null,\"logo\":null}','01','01','NV','NV01',2,'2026-07-20','12:13:50',1,'{\"identity_document_type_id\":\"0\",\"identity_document_type\":{\"id\":\"0\",\"description\":\"Doc.trib.no.dom.sin.ruc\"},\"number\":\"99999999\",\"name\":\"Clientes - Varios\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":null,\"department\":{\"id\":null,\"description\":null},\"province_id\":null,\"province\":{\"id\":null,\"description\":null},\"district_id\":null,\"district\":{\"id\":null,\"description\":null},\"address\":null,\"email\":null,\"telephone\":null,\"perception_agent\":false,\"address_id\":null,\"internal_code\":null,\"address_type_id\":null,\"address_type\":{\"id\":null,\"description\":null}}','PEN','01',NULL,3.408,0,NULL,1,0,0,NULL,NULL,NULL,0.00,0.00,0.00,NULL,NULL,0.00,0.00,15.25,0.00,0.00,2.75,0.00,0.00,0.00,0.00,0.00,0.00,2.75,15.25,18.00,18.00,0,'[]','[]',NULL,'[]',NULL,NULL,NULL,NULL,'','NV01-2-20260720','NV01-2-20260720',NULL,NULL,NULL,NULL,1,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'2026-07-20 12:15:31','2026-07-20 12:15:31',0,4,NULL,NULL,NULL,NULL);
COMMIT;

-- Dumped table `sale_notes` with 2 row(s)
--

--
-- Table structure for table `sale_note_fee`
--

CREATE TABLE `sale_note_fee` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sale_note_id` int(10) unsigned NOT NULL,
  `date` date NOT NULL,
  `currency_type_id` varchar(255) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `payment_method_type_id` varchar(2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_note_fee_sale_note_id_foreign` (`sale_note_id`),
  KEY `sale_note_fee_currency_type_id_foreign` (`currency_type_id`),
  KEY `sale_note_fee_payment_method_type_id_foreign` (`payment_method_type_id`),
  CONSTRAINT `sale_note_fee_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `sale_note_fee_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `sale_note_fee_sale_note_id_foreign` FOREIGN KEY (`sale_note_id`) REFERENCES `sale_notes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_note_fee`
--

SET autocommit=0;
COMMIT;

-- Dumped table `sale_note_fee` with 0 row(s)
--

--
-- Table structure for table `sale_note_items`
--

CREATE TABLE `sale_note_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sale_note_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item`)),
  `quantity` decimal(12,4) NOT NULL,
  `unit_value` decimal(16,6) NOT NULL,
  `affectation_igv_type_id` varchar(255) NOT NULL,
  `total_base_igv` decimal(12,2) NOT NULL,
  `percentage_igv` decimal(12,2) NOT NULL,
  `total_igv` decimal(12,2) NOT NULL,
  `system_isc_type_id` varchar(255) DEFAULT NULL,
  `total_base_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `percentage_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `percentage_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_plastic_bag_taxes` decimal(6,2) NOT NULL DEFAULT 0.00,
  `total_taxes` decimal(12,2) NOT NULL,
  `price_type_id` varchar(255) NOT NULL,
  `unit_price` decimal(16,6) NOT NULL,
  `total_value` decimal(12,2) NOT NULL,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attributes`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `additional_information` text DEFAULT NULL,
  `inventory_kardex_id` int(10) unsigned DEFAULT NULL,
  `warehouse_id` int(10) unsigned DEFAULT NULL,
  `name_product_pdf` longtext DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_note_items_sale_note_id_foreign` (`sale_note_id`),
  KEY `sale_note_items_item_id_foreign` (`item_id`),
  KEY `sale_note_items_affectation_igv_type_id_foreign` (`affectation_igv_type_id`),
  KEY `sale_note_items_system_isc_type_id_foreign` (`system_isc_type_id`),
  KEY `sale_note_items_price_type_id_foreign` (`price_type_id`),
  KEY `sale_note_items_inventory_kardex_id_foreign` (`inventory_kardex_id`),
  KEY `sale_note_items_warehouse_id_foreign` (`warehouse_id`),
  CONSTRAINT `sale_note_items_affectation_igv_type_id_foreign` FOREIGN KEY (`affectation_igv_type_id`) REFERENCES `cat_affectation_igv_types` (`id`),
  CONSTRAINT `sale_note_items_inventory_kardex_id_foreign` FOREIGN KEY (`inventory_kardex_id`) REFERENCES `inventory_kardex` (`id`),
  CONSTRAINT `sale_note_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `sale_note_items_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `cat_price_types` (`id`),
  CONSTRAINT `sale_note_items_sale_note_id_foreign` FOREIGN KEY (`sale_note_id`) REFERENCES `sale_notes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `sale_note_items_system_isc_type_id_foreign` FOREIGN KEY (`system_isc_type_id`) REFERENCES `cat_system_isc_types` (`id`),
  CONSTRAINT `sale_note_items_warehouse_id_foreign` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_note_items`
--

SET autocommit=0;
INSERT INTO `sale_note_items` VALUES (1,1,207,'{\"stock\":15,\"id\":207,\"item_id\":207,\"full_description\":\"ACEITE DE RICINO - 30 ML\",\"name\":null,\"second_name\":null,\"description\":\"ACEITE DE RICINO - 30 ML - ALKOFARMA\",\"currency_type_id\":\"PEN\",\"internal_id\":null,\"currency_type_symbol\":\"S\\/\",\"sale_unit_price\":3,\"purchase_unit_price\":0,\"unit_type_id\":\"NIU\",\"aux_unit_type_id\":\"NIU\",\"sale_affectation_igv_type_id\":\"10\",\"purchase_affectation_igv_type_id\":\"10\",\"calculate_quantity\":false,\"has_igv\":true,\"is_set\":false,\"active\":1,\"edit_unit_price\":false,\"editable_sale_price\":false,\"aux_quantity\":1,\"edit_sale_unit_price\":\"3.00\",\"aux_sale_unit_price\":\"3.00\",\"image_url\":\"https:\\/\\/adela.sysfarma.pe\\/logo\\/imagen-no-disponible.jpg\",\"warehouses\":[{\"warehouse_id\":1,\"warehouse_description\":\"Almac\\u00e9n Oficina Principal\",\"stock\":\"15.0000\",\"is_current_warehouse\":true}],\"category_id\":4,\"sets\":[],\"unit_type\":[{\"id\":366,\"description\":\"Unidad\",\"item_id\":207,\"unit_type_id\":\"NIU\",\"quantity_unit\":1,\"price1\":3,\"price2\":0,\"price3\":0,\"price_default\":1,\"barcode\":\"366NIU1\",\"deleted_at\":null,\"pricing_source\":\"master_template\",\"pricing_status\":\"master\",\"unit_type\":{\"id\":\"NIU\",\"active\":1,\"symbol\":null,\"description\":\"Unidades\"},\"warehouse_prices\":[]}],\"category\":\"SOLUCION ORAL\",\"brand\":\"ALKOFARMA\",\"has_plastic_bag_taxes\":false,\"amount_plastic_bag_taxes\":\"0.10\",\"lots_group\":[{\"id\":189,\"code\":\"2071285\",\"quantity\":15,\"date_of_due\":\"2028-07-31\",\"checked\":false,\"compromise_quantity\":0}],\"lot_status\":\"ok\",\"active_principle\":\"ACEITE DE RICINO\",\"payWithPoints\":false,\"generic\":0,\"location\":\"J - 3\",\"atc_name\":null,\"formula\":\"FRASCO CON GOTERO\",\"has_isc\":false,\"system_isc_type_id\":null,\"percentage_isc\":\"0.00\",\"stock_min\":\"1\",\"exchange_points\":false,\"quantity_of_points\":0,\"exchanged_for_points\":false,\"used_points_for_exchange\":null,\"original_affectation_igv_type_id\":\"10\",\"restrict_sale_cpe\":false,\"requires_prescription\":false,\"is_vaccine\":false,\"commission_amount\":null,\"commission_type\":null,\"index\":2,\"presentation\":{\"id\":366,\"description\":\"Unidad\",\"item_id\":207,\"unit_type_id\":\"NIU\",\"quantity_unit\":1,\"price1\":3,\"price2\":0,\"price3\":0,\"price_default\":1,\"barcode\":\"366NIU1\",\"deleted_at\":null,\"pricing_source\":\"master_template\",\"pricing_status\":\"master\",\"unit_type\":{\"id\":\"NIU\",\"active\":1,\"symbol\":null,\"description\":\"Unidades\"},\"warehouse_prices\":[]},\"unit_price\":3,\"IdLoteSelected\":189}',1.0000,2.542373,'10',2.54,18.00,0.46,NULL,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.46,'01',3.000000,2.54,0.00,0.00,3.00,'[]','[]','[]',NULL,275,NULL,NULL),(2,2,233,'{\"stock\":25,\"id\":233,\"item_id\":233,\"full_description\":\"41667 - PLAKIT 1.5 1.5 mg\",\"name\":\"PLAKIT 1.5 1.5 mg\",\"second_name\":null,\"description\":\"PLAKIT 1.5 1.5 mg - INTIPHARMA S.A.C.\",\"currency_type_id\":\"PEN\",\"internal_id\":\"41667\",\"currency_type_symbol\":\"S\\/\",\"sale_unit_price\":18,\"purchase_unit_price\":0,\"unit_type_id\":\"NIU\",\"aux_unit_type_id\":\"NIU\",\"sale_affectation_igv_type_id\":\"10\",\"purchase_affectation_igv_type_id\":\"10\",\"calculate_quantity\":false,\"has_igv\":true,\"is_set\":false,\"active\":1,\"edit_unit_price\":false,\"editable_sale_price\":false,\"aux_quantity\":1,\"edit_sale_unit_price\":\"18.00\",\"aux_sale_unit_price\":\"18.00\",\"image_url\":\"https:\\/\\/adela.sysfarma.pe\\/logo\\/imagen-no-disponible.jpg\",\"warehouses\":[{\"warehouse_id\":1,\"warehouse_description\":\"Almac\\u00e9n Oficina Principal\",\"stock\":\"25.0000\",\"is_current_warehouse\":true}],\"category_id\":0,\"sets\":[],\"unit_type\":[{\"id\":394,\"description\":\"Unidad\",\"item_id\":233,\"unit_type_id\":\"NIU\",\"quantity_unit\":1,\"price1\":18,\"price2\":0,\"price3\":0,\"price_default\":1,\"barcode\":\"394NIU1\",\"deleted_at\":null,\"pricing_source\":\"master_template\",\"pricing_status\":\"master\",\"unit_type\":{\"id\":\"NIU\",\"active\":1,\"symbol\":null,\"description\":\"Unidades\"},\"warehouse_prices\":[]}],\"category\":null,\"brand\":\"INTIPHARMA S.A.C.\",\"has_plastic_bag_taxes\":false,\"amount_plastic_bag_taxes\":\"0.10\",\"lots_group\":[{\"id\":216,\"code\":\"E85225002\",\"quantity\":25,\"date_of_due\":\"2028-05-31\",\"checked\":false,\"compromise_quantity\":0}],\"lot_status\":\"ok\",\"active_principle\":\"LEVONORGESTREL\",\"payWithPoints\":false,\"generic\":0,\"location\":null,\"atc_name\":null,\"formula\":\"Tableta Recubierta\",\"has_isc\":false,\"system_isc_type_id\":null,\"percentage_isc\":\"0.00\",\"stock_min\":\"1\",\"exchange_points\":false,\"quantity_of_points\":0,\"exchanged_for_points\":false,\"used_points_for_exchange\":null,\"original_affectation_igv_type_id\":\"10\",\"restrict_sale_cpe\":false,\"requires_prescription\":false,\"is_vaccine\":false,\"commission_amount\":null,\"commission_type\":null,\"index\":0,\"presentation\":{\"id\":394,\"description\":\"Unidad\",\"item_id\":233,\"unit_type_id\":\"NIU\",\"quantity_unit\":1,\"price1\":18,\"price2\":0,\"price3\":0,\"price_default\":1,\"barcode\":\"394NIU1\",\"deleted_at\":null,\"pricing_source\":\"master_template\",\"pricing_status\":\"master\",\"unit_type\":{\"id\":\"NIU\",\"active\":1,\"symbol\":null,\"description\":\"Unidades\"},\"warehouse_prices\":[]},\"unit_price\":18,\"IdLoteSelected\":216}',1.0000,15.254237,'10',15.25,18.00,2.75,NULL,0.00,0.00,0.00,0.00,0.00,0.00,0.00,2.75,'01',18.000000,15.25,0.00,0.00,18.00,'[]','[]','[]',NULL,276,NULL,NULL);
COMMIT;

-- Dumped table `sale_note_items` with 2 row(s)
--

--
-- Table structure for table `sale_note_migration`
--

CREATE TABLE `sale_note_migration` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sale_notes_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `success` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `url` varchar(255) NOT NULL,
  `remote_id` int(10) unsigned NOT NULL DEFAULT 0,
  `number` varchar(255) DEFAULT NULL,
  `data` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_note_migration`
--

SET autocommit=0;
COMMIT;

-- Dumped table `sale_note_migration` with 0 row(s)
--

--
-- Table structure for table `sale_note_payments`
--

CREATE TABLE `sale_note_payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sale_note_id` int(10) unsigned NOT NULL,
  `date_of_payment` date NOT NULL,
  `payment_method_type_id` char(2) NOT NULL,
  `has_card` tinyint(1) NOT NULL DEFAULT 0,
  `card_brand_id` char(2) DEFAULT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `payment_received` tinyint(1) DEFAULT NULL,
  `change` decimal(12,2) DEFAULT NULL,
  `payment` decimal(12,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_note_payments_sale_note_id_foreign` (`sale_note_id`),
  KEY `sale_note_payments_card_brand_id_foreign` (`card_brand_id`),
  KEY `sale_note_payments_payment_method_type_id_foreign` (`payment_method_type_id`),
  KEY `sale_note_payments_date_of_payment_index` (`date_of_payment`),
  CONSTRAINT `sale_note_payments_card_brand_id_foreign` FOREIGN KEY (`card_brand_id`) REFERENCES `card_brands` (`id`),
  CONSTRAINT `sale_note_payments_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `sale_note_payments_sale_note_id_foreign` FOREIGN KEY (`sale_note_id`) REFERENCES `sale_notes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_note_payments`
--

SET autocommit=0;
INSERT INTO `sale_note_payments` VALUES (1,1,'2026-07-20','01',0,NULL,NULL,NULL,NULL,3.00),(2,2,'2026-07-20','01',0,NULL,NULL,NULL,20.00,-2.00),(3,2,'2026-07-20','02',0,NULL,NULL,NULL,NULL,20.00);
COMMIT;

-- Dumped table `sale_note_payments` with 3 row(s)
--

--
-- Table structure for table `sale_opportunities`
--

CREATE TABLE `sale_opportunities` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `external_id` char(36) NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `establishment` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`establishment`)),
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `prefix` varchar(255) NOT NULL,
  `date_of_issue` date NOT NULL,
  `time_of_issue` time NOT NULL,
  `customer_id` int(10) unsigned NOT NULL,
  `customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`customer`)),
  `currency_type_id` varchar(255) NOT NULL,
  `exchange_rate_sale` decimal(13,3) NOT NULL,
  `total_exportation` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxed` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_unaffected` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exonerated` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `detail` text DEFAULT NULL,
  `observation` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_opportunities_user_id_foreign` (`user_id`),
  KEY `sale_opportunities_establishment_id_foreign` (`establishment_id`),
  KEY `sale_opportunities_customer_id_foreign` (`customer_id`),
  KEY `sale_opportunities_soap_type_id_foreign` (`soap_type_id`),
  KEY `sale_opportunities_state_type_id_foreign` (`state_type_id`),
  KEY `sale_opportunities_currency_type_id_foreign` (`currency_type_id`),
  CONSTRAINT `sale_opportunities_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `sale_opportunities_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `sale_opportunities_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`),
  CONSTRAINT `sale_opportunities_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `sale_opportunities_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `sale_opportunities_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_opportunities`
--

SET autocommit=0;
COMMIT;

-- Dumped table `sale_opportunities` with 0 row(s)
--

--
-- Table structure for table `sale_opportunity_files`
--

CREATE TABLE `sale_opportunity_files` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sale_opportunity_id` int(10) unsigned NOT NULL,
  `filename` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_opportunity_files_sale_opportunity_id_foreign` (`sale_opportunity_id`),
  CONSTRAINT `sale_opportunity_files_sale_opportunity_id_foreign` FOREIGN KEY (`sale_opportunity_id`) REFERENCES `sale_opportunities` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_opportunity_files`
--

SET autocommit=0;
COMMIT;

-- Dumped table `sale_opportunity_files` with 0 row(s)
--

--
-- Table structure for table `sale_opportunity_items`
--

CREATE TABLE `sale_opportunity_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sale_opportunity_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`item`)),
  `quantity` decimal(12,4) NOT NULL,
  `unit_value` decimal(16,6) NOT NULL,
  `affectation_igv_type_id` varchar(255) NOT NULL,
  `total_base_igv` decimal(12,2) NOT NULL,
  `percentage_igv` decimal(12,2) NOT NULL,
  `total_igv` decimal(12,2) NOT NULL,
  `total_taxes` decimal(12,2) NOT NULL,
  `price_type_id` varchar(255) NOT NULL,
  `unit_price` decimal(16,6) NOT NULL,
  `total_value` decimal(12,2) NOT NULL,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attributes`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  PRIMARY KEY (`id`),
  KEY `sale_opportunity_items_sale_opportunity_id_foreign` (`sale_opportunity_id`),
  KEY `sale_opportunity_items_item_id_foreign` (`item_id`),
  KEY `sale_opportunity_items_affectation_igv_type_id_foreign` (`affectation_igv_type_id`),
  KEY `sale_opportunity_items_price_type_id_foreign` (`price_type_id`),
  CONSTRAINT `sale_opportunity_items_affectation_igv_type_id_foreign` FOREIGN KEY (`affectation_igv_type_id`) REFERENCES `cat_affectation_igv_types` (`id`),
  CONSTRAINT `sale_opportunity_items_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `sale_opportunity_items_price_type_id_foreign` FOREIGN KEY (`price_type_id`) REFERENCES `cat_price_types` (`id`),
  CONSTRAINT `sale_opportunity_items_sale_opportunity_id_foreign` FOREIGN KEY (`sale_opportunity_id`) REFERENCES `sale_opportunities` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sale_opportunity_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `sale_opportunity_items` with 0 row(s)
--

--
-- Table structure for table `seller_point_ledger`
--

CREATE TABLE `seller_point_ledger` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `seller_id` int(10) unsigned NOT NULL,
  `cash_id` int(10) unsigned DEFAULT NULL,
  `shift_type` varchar(10) DEFAULT NULL,
  `sales_net` decimal(12,2) NOT NULL DEFAULT 0.00,
  `points` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT 'con signo: + earned / +-/ adjustment',
  `reason` varchar(20) NOT NULL DEFAULT 'earned',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `seller_point_ledger_seller_id_created_at_index` (`seller_id`,`created_at`),
  KEY `seller_point_ledger_seller_id_index` (`seller_id`),
  KEY `seller_point_ledger_cash_id_index` (`cash_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `seller_point_ledger`
--

SET autocommit=0;
COMMIT;

-- Dumped table `seller_point_ledger` with 0 row(s)
--

--
-- Table structure for table `seller_reward`
--

CREATE TABLE `seller_reward` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `points_cost` decimal(12,2) NOT NULL DEFAULT 0.00,
  `stock` int(11) DEFAULT NULL COMMENT 'NULL = ilimitado',
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `seller_reward_active_index` (`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `seller_reward`
--

SET autocommit=0;
COMMIT;

-- Dumped table `seller_reward` with 0 row(s)
--

--
-- Table structure for table `seller_reward_redemption`
--

CREATE TABLE `seller_reward_redemption` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `seller_id` int(10) unsigned NOT NULL,
  `seller_reward_id` int(10) unsigned NOT NULL,
  `reward_name` varchar(255) NOT NULL,
  `points_cost` decimal(12,2) NOT NULL DEFAULT 0.00,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `seller_reward_redemption_seller_id_created_at_index` (`seller_id`,`created_at`),
  KEY `seller_reward_redemption_seller_id_index` (`seller_id`),
  KEY `seller_reward_redemption_seller_reward_id_index` (`seller_reward_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `seller_reward_redemption`
--

SET autocommit=0;
COMMIT;

-- Dumped table `seller_reward_redemption` with 0 row(s)
--

--
-- Table structure for table `series`
--

CREATE TABLE `series` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `establishment_id` int(10) unsigned NOT NULL,
  `document_type_id` varchar(255) NOT NULL,
  `number` varchar(255) NOT NULL,
  `contingency` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `series_establishment_id_foreign` (`establishment_id`),
  KEY `series_document_type_id_foreign` (`document_type_id`),
  CONSTRAINT `series_document_type_id_foreign` FOREIGN KEY (`document_type_id`) REFERENCES `cat_document_types` (`id`),
  CONSTRAINT `series_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `series`
--

SET autocommit=0;
INSERT INTO `series` VALUES (2,1,'03','B001',0,NULL,NULL),(3,1,'07','FC01',0,NULL,NULL),(4,1,'07','BC01',0,NULL,NULL),(5,1,'08','FD01',0,NULL,NULL),(6,1,'08','BD01',0,NULL,NULL),(7,1,'20','R001',0,NULL,NULL),(8,1,'09','T001',0,NULL,NULL),(9,1,'40','P001',0,NULL,NULL),(10,1,'80','NV01',0,NULL,NULL),(11,1,'04','L001',0,NULL,NULL),(12,1,'U2','NIA1',0,NULL,NULL),(13,1,'U3','NSA1',0,NULL,NULL),(14,1,'U4','NTA1',0,NULL,NULL);
COMMIT;

-- Dumped table `series` with 13 row(s)
--

--
-- Table structure for table `series_configurations`
--

CREATE TABLE `series_configurations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `series_id` int(10) unsigned NOT NULL,
  `document_type_id` varchar(255) NOT NULL,
  `series` varchar(255) NOT NULL,
  `number` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `series_configurations_series_id_foreign` (`series_id`),
  KEY `series_configurations_series_index` (`series`),
  KEY `series_configurations_number_index` (`number`),
  KEY `series_configurations_document_type_id_foreign` (`document_type_id`),
  CONSTRAINT `series_configurations_document_type_id_foreign` FOREIGN KEY (`document_type_id`) REFERENCES `cat_document_types` (`id`),
  CONSTRAINT `series_configurations_series_id_foreign` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `series_configurations`
--

SET autocommit=0;
COMMIT;

-- Dumped table `series_configurations` with 0 row(s)
--

--
-- Table structure for table `skins`
--

CREATE TABLE `skins` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `filename` varchar(255) NOT NULL,
  `status` 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=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `skins`
--

SET autocommit=0;
INSERT INTO `skins` VALUES (1,'Default','default.css',1,NULL,NULL),(2,'Light','light.css',1,NULL,NULL);
COMMIT;

-- Dumped table `skins` with 2 row(s)
--

--
-- Table structure for table `soap_types`
--

CREATE TABLE `soap_types` (
  `id` char(2) NOT NULL,
  `description` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `soap_types`
--

SET autocommit=0;
INSERT INTO `soap_types` VALUES ('01','Demo'),('02','Producción'),('03','Interno');
COMMIT;

-- Dumped table `soap_types` with 3 row(s)
--

--
-- Table structure for table `specialties`
--

CREATE TABLE `specialties` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `status` tinyint(1) DEFAULT 1,
  `item_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `specialties_code_unique` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `specialties`
--

SET autocommit=0;
COMMIT;

-- Dumped table `specialties` with 0 row(s)
--

--
-- Table structure for table `state_types`
--

CREATE TABLE `state_types` (
  `id` char(2) NOT NULL,
  `description` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `state_types`
--

SET autocommit=0;
INSERT INTO `state_types` VALUES ('01','Registrado'),('03','Enviado'),('05','Aceptado'),('07','Observado'),('09','Rechazado'),('11','Anulado'),('13','Por anular');
COMMIT;

-- Dumped table `state_types` with 7 row(s)
--

--
-- Table structure for table `status_orders`
--

CREATE TABLE `status_orders` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(30) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `status_orders`
--

SET autocommit=0;
INSERT INTO `status_orders` VALUES (1,'Pago sin verificar','2026-07-02 11:24:26',NULL),(2,'Pago verificado','2026-07-02 11:24:26',NULL),(3,'Despachado','2026-07-02 11:24:26',NULL),(4,'Confirmado por el cliente','2026-07-02 11:24:26',NULL);
COMMIT;

-- Dumped table `status_orders` with 4 row(s)
--

--
-- Table structure for table `summaries`
--

CREATE TABLE `summaries` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `external_id` char(36) NOT NULL,
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `summary_status_type_id` varchar(255) NOT NULL,
  `ubl_version` varchar(255) NOT NULL,
  `date_of_issue` date NOT NULL,
  `date_of_reference` date NOT NULL,
  `identifier` varchar(255) NOT NULL,
  `filename` varchar(255) NOT NULL,
  `unique_filename` varchar(255) DEFAULT NULL,
  `ticket` varchar(255) DEFAULT NULL,
  `has_ticket` tinyint(1) NOT NULL DEFAULT 0,
  `has_cdr` tinyint(1) NOT NULL DEFAULT 0,
  `soap_shipping_response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`soap_shipping_response`)),
  `send_to_pse` tinyint(1) NOT NULL DEFAULT 0,
  `response_signature_pse` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_signature_pse`)),
  `response_send_cdr_pse` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_send_cdr_pse`)),
  `unknown_error_status_response` tinyint(1) NOT NULL DEFAULT 0,
  `manually_regularized` tinyint(1) NOT NULL DEFAULT 0,
  `error_manually_regularized` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`error_manually_regularized`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `summaries_unique_filename_unique` (`unique_filename`),
  KEY `summaries_user_id_foreign` (`user_id`),
  KEY `summaries_soap_type_id_foreign` (`soap_type_id`),
  KEY `summaries_state_type_id_foreign` (`state_type_id`),
  KEY `summaries_summary_status_type_id_foreign` (`summary_status_type_id`),
  KEY `summaries_date_of_issue_index` (`date_of_issue`),
  CONSTRAINT `summaries_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `summaries_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `summaries_summary_status_type_id_foreign` FOREIGN KEY (`summary_status_type_id`) REFERENCES `cat_summary_status_types` (`id`),
  CONSTRAINT `summaries_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `summaries`
--

SET autocommit=0;
COMMIT;

-- Dumped table `summaries` with 0 row(s)
--

--
-- Table structure for table `summary_documents`
--

CREATE TABLE `summary_documents` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `summary_id` int(10) unsigned NOT NULL,
  `document_id` int(10) unsigned NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `summary_documents_summary_id_foreign` (`summary_id`),
  KEY `summary_documents_document_id_foreign` (`document_id`),
  CONSTRAINT `summary_documents_document_id_foreign` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`),
  CONSTRAINT `summary_documents_summary_id_foreign` FOREIGN KEY (`summary_id`) REFERENCES `summaries` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `summary_documents`
--

SET autocommit=0;
COMMIT;

-- Dumped table `summary_documents` with 0 row(s)
--

--
-- Table structure for table `supplier_item_aliases`
--

CREATE TABLE `supplier_item_aliases` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `supplier_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `supplier_item_code` varchar(100) DEFAULT NULL,
  `supplier_description_original` varchar(500) DEFAULT NULL,
  `supplier_description_normalized` varchar(255) DEFAULT NULL,
  `created_by` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `supplier_item_aliases_supplier_code_unique` (`supplier_id`,`supplier_item_code`),
  KEY `supplier_item_aliases_item_id_foreign` (`item_id`),
  KEY `supplier_item_aliases_created_by_foreign` (`created_by`),
  KEY `supplier_item_aliases_supplier_desc_idx` (`supplier_id`,`supplier_description_normalized`),
  CONSTRAINT `supplier_item_aliases_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  CONSTRAINT `supplier_item_aliases_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
  CONSTRAINT `supplier_item_aliases_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `supplier_item_aliases`
--

SET autocommit=0;
COMMIT;

-- Dumped table `supplier_item_aliases` with 0 row(s)
--

--
-- Table structure for table `suscription_grade`
--

CREATE TABLE `suscription_grade` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `suscription_grade`
--

SET autocommit=0;
INSERT INTO `suscription_grade` VALUES (1,'1er'),(2,'2do'),(3,'3ro'),(4,'4to'),(5,'5to'),(6,'6to'),(7,'7mo'),(8,'8vo');
COMMIT;

-- Dumped table `suscription_grade` with 8 row(s)
--

--
-- Table structure for table `suscription_plans`
--

CREATE TABLE `suscription_plans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `cat_period_id` int(10) unsigned DEFAULT 0 COMMENT 'Relacion con el periodo de tiempo',
  `name` text NOT NULL COMMENT 'Nombre del plan',
  `description` longtext NOT NULL COMMENT 'Descripcion del plan',
  `total` float DEFAULT 0 COMMENT 'El total del costo del plan',
  `currency_type_id` varchar(255) DEFAULT NULL,
  `payment_method_type_id` varchar(255) DEFAULT NULL,
  `quantity_period` int(10) unsigned DEFAULT NULL,
  `exchange_rate_sale` float DEFAULT 0,
  `total_prepayment` float DEFAULT 0,
  `total_charge` float DEFAULT 0,
  `total_discount` float DEFAULT 0,
  `total_exportation` float DEFAULT 0,
  `total_free` float DEFAULT 0,
  `total_taxed` float DEFAULT 0,
  `total_unaffected` float DEFAULT 0,
  `total_exonerated` float DEFAULT 0,
  `total_igv` float DEFAULT 0,
  `total_igv_free` float DEFAULT 0,
  `total_base_isc` float DEFAULT 0,
  `total_isc` float DEFAULT 0,
  `total_base_other_taxes` float DEFAULT 0,
  `total_other_taxes` float DEFAULT 0,
  `total_taxes` float DEFAULT 0,
  `total_value` float DEFAULT 0,
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attributes`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `prepayments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`prepayments`)),
  `related` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`related`)),
  `perception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`perception`)),
  `detraction` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`detraction`)),
  `legends` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`legends`)),
  `terms_condition` longtext DEFAULT NULL,
  `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;

--
-- Dumping data for table `suscription_plans`
--

SET autocommit=0;
INSERT INTO `suscription_plans` VALUES (1,1,'Matricula Escolar','Demostración de matricula escolar',1,'PEN','01',12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
COMMIT;

-- Dumped table `suscription_plans` with 1 row(s)
--

--
-- Table structure for table `suscription_section`
--

CREATE TABLE `suscription_section` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `suscription_section`
--

SET autocommit=0;
INSERT INTO `suscription_section` VALUES (1,'A'),(2,'B'),(3,'C'),(4,'D'),(5,'E'),(6,'F'),(7,'G'),(8,'H');
COMMIT;

-- Dumped table `suscription_section` with 8 row(s)
--

--
-- Table structure for table `system_activity_logs`
--

CREATE TABLE `system_activity_logs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT NULL,
  `system_activity_log_type_id` varchar(255) DEFAULT NULL,
  `date` date NOT NULL,
  `time` time NOT NULL,
  `origin_id` int(11) DEFAULT NULL,
  `origin_type` varchar(255) DEFAULT NULL,
  `ip` varchar(255) DEFAULT NULL,
  `device_name` varchar(255) DEFAULT NULL,
  `device_type` varchar(255) DEFAULT NULL,
  `platform_name` varchar(255) DEFAULT NULL,
  `platform_version` varchar(255) DEFAULT NULL,
  `browser_name` varchar(255) DEFAULT NULL,
  `browser_version` varchar(255) DEFAULT NULL,
  `request_email` varchar(255) DEFAULT NULL,
  `route` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `location` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`location`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_index` (`origin_id`,`origin_type`),
  KEY `system_activity_logs_user_id_foreign` (`user_id`),
  KEY `system_activity_logs_auth_transaction_type_index` (`system_activity_log_type_id`),
  KEY `system_activity_logs_date_index` (`date`),
  KEY `system_activity_logs_time_index` (`time`),
  KEY `system_activity_logs_device_type_index` (`device_type`),
  CONSTRAINT `system_activity_logs_system_activity_log_type_id_foreign` FOREIGN KEY (`system_activity_log_type_id`) REFERENCES `system_activity_log_types` (`id`),
  CONSTRAINT `system_activity_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=285 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `system_activity_logs`
--

SET autocommit=0;
INSERT INTO `system_activity_logs` VALUES (1,1,'login','2026-07-02','11:25:28',1,'App\\Models\\Tenant\\User','179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-02 11:25:28','2026-07-02 11:25:28'),(2,1,'login','2026-07-02','11:26:14',1,'App\\Models\\Tenant\\User','38.250.154.81','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-02 11:26:14','2026-07-02 11:26:14'),(3,2,'failed','2026-07-04','11:01:02',2,'App\\Models\\Tenant\\User','38.250.154.81','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-04 11:01:02','2026-07-04 11:01:02'),(4,2,'login','2026-07-04','11:01:34',2,'App\\Models\\Tenant\\User','38.250.154.81','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-04 11:01:34','2026-07-04 11:01:34'),(5,1,'login','2026-07-04','15:45:09',1,'App\\Models\\Tenant\\User','179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-04 15:45:09','2026-07-04 15:45:09'),(6,2,'login','2026-07-05','13:58:58',2,'App\\Models\\Tenant\\User','38.250.154.81','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-05 13:58:58','2026-07-05 13:58:58'),(7,2,'login','2026-07-06','18:11:57',2,'App\\Models\\Tenant\\User','38.250.154.40','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-06 18:11:57','2026-07-06 18:11:57'),(8,2,'login','2026-07-07','15:46:00',2,'App\\Models\\Tenant\\User','38.250.154.40','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-07 15:46:00','2026-07-07 15:46:00'),(9,2,'login','2026-07-08','12:52:19',2,'App\\Models\\Tenant\\User','38.250.154.41','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-08 12:52:19','2026-07-08 12:52:19'),(10,1,'login','2026-07-08','14:42:13',1,'App\\Models\\Tenant\\User','179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-08 14:42:13','2026-07-08 14:42:13'),(11,2,'login','2026-07-08','14:42:55',2,'App\\Models\\Tenant\\User','38.250.154.41','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-08 14:42:55','2026-07-08 14:42:55'),(12,2,'login','2026-07-09','17:49:19',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-09 17:49:19','2026-07-09 17:49:19'),(13,2,'level_module_access_error','2026-07-09','17:56:17',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','149.0.0.0',NULL,'prescriptions/digemid/compliance',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-09 17:56:17','2026-07-09 17:56:17'),(14,1,'login','2026-07-09','18:41:59',1,'App\\Models\\Tenant\\User','179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-09 18:41:59','2026-07-09 18:41:59'),(15,2,'login','2026-07-09','18:44:12',2,'App\\Models\\Tenant\\User','38.187.11.163','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"La Tingui\\u00f1a\",\"latitude\":\"-14.0358\",\"longitude\":\"-75.7003\",\"timezone\":\"America\\/Lima\"}','2026-07-09 18:44:12','2026-07-09 18:44:12'),(16,2,'login','2026-07-10','17:48:19',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-10 17:48:19','2026-07-10 17:48:19'),(17,2,'inventory_created','2026-07-10','18:11:16',108,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 18:11:16','2026-07-10 18:11:16'),(18,NULL,'failed','2026-07-10','18:19:56',NULL,NULL,'190.120.229.196','WebKit','desktop','Linux','0','Chrome','145.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LIM\",\"region_name\":\"Lima region\",\"city_name\":\"Santiago de Surco\",\"latitude\":\"-12.1387\",\"longitude\":\"-77.009\",\"timezone\":\"America\\/Lima\"}','2026-07-10 18:19:56','2026-07-10 18:19:56'),(19,NULL,'failed','2026-07-10','18:26:57',NULL,NULL,'82.221.131.5','0','desktop','Linux','0','Firefox','140.0',NULL,NULL,NULL,'{\"country_name\":\"Iceland\",\"country_code\":\"IS\",\"region_code\":\"1\",\"region_name\":\"Capital Region\",\"city_name\":\"Reykjavik\",\"latitude\":\"64.1466\",\"longitude\":\"-21.9426\",\"timezone\":\"Atlantic\\/Reykjavik\"}','2026-07-10 18:26:57','2026-07-10 18:26:57'),(20,2,'inventory_created','2026-07-10','18:30:09',109,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 18:30:09','2026-07-10 18:30:09'),(21,2,'inventory_created','2026-07-10','18:51:40',110,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 18:51:40','2026-07-10 18:51:40'),(22,2,'inventory_created','2026-07-10','19:12:32',111,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 19:12:32','2026-07-10 19:12:32'),(23,2,'inventory_created','2026-07-10','19:27:05',112,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 19:27:05','2026-07-10 19:27:05'),(24,2,'inventory_created','2026-07-10','19:32:55',113,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 19:32:55','2026-07-10 19:32:55'),(25,2,'login','2026-07-10','19:33:12',2,'App\\Models\\Tenant\\User','38.187.11.163','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"La Tingui\\u00f1a\",\"latitude\":\"-14.0358\",\"longitude\":\"-75.7003\",\"timezone\":\"America\\/Lima\"}','2026-07-10 19:33:12','2026-07-10 19:33:12'),(26,2,'inventory_created','2026-07-10','20:05:30',114,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 20:05:30','2026-07-10 20:05:30'),(27,2,'inventory_created','2026-07-10','20:17:12',115,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 20:17:12','2026-07-10 20:17:12'),(28,2,'inventory_created','2026-07-10','20:22:21',116,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 20:22:21','2026-07-10 20:22:21'),(29,2,'inventory_created','2026-07-10','20:29:14',117,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 20:29:14','2026-07-10 20:29:14'),(30,2,'inventory_created','2026-07-10','20:38:41',118,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 20:38:41','2026-07-10 20:38:41'),(31,2,'inventory_created','2026-07-10','20:41:57',119,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 20:41:57','2026-07-10 20:41:57'),(32,2,'inventory_created','2026-07-10','20:49:52',120,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 20:49:52','2026-07-10 20:49:52'),(33,2,'inventory_created','2026-07-10','21:09:04',121,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 21:09:04','2026-07-10 21:09:04'),(34,2,'inventory_created','2026-07-10','21:14:15',122,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 21:14:15','2026-07-10 21:14:15'),(35,2,'inventory_created','2026-07-10','21:22:41',123,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 21:22:41','2026-07-10 21:22:41'),(36,2,'inventory_created','2026-07-10','21:32:27',124,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 21:32:27','2026-07-10 21:32:27'),(37,2,'inventory_created','2026-07-10','21:40:40',125,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 21:40:40','2026-07-10 21:40:40'),(38,2,'inventory_created','2026-07-10','21:44:45',126,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 21:44:45','2026-07-10 21:44:45'),(39,2,'inventory_created','2026-07-10','21:47:59',127,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 21:47:59','2026-07-10 21:47:59'),(40,2,'inventory_created','2026-07-10','21:50:25',128,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 21:50:25','2026-07-10 21:50:25'),(41,2,'inventory_created','2026-07-10','21:52:36',129,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 21:52:36','2026-07-10 21:52:36'),(42,2,'inventory_created','2026-07-10','22:12:14',130,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 22:12:14','2026-07-10 22:12:14'),(43,2,'inventory_created','2026-07-10','22:16:21',131,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-10 22:16:21','2026-07-10 22:16:21'),(44,2,'login','2026-07-11','10:14:28',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-11 10:14:28','2026-07-11 10:14:28'),(45,2,'inventory_created','2026-07-11','10:35:15',132,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 10:35:15','2026-07-11 10:35:15'),(46,2,'inventory_created','2026-07-11','10:37:51',133,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 10:37:51','2026-07-11 10:37:51'),(47,2,'inventory_created','2026-07-11','10:41:56',134,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 10:41:56','2026-07-11 10:41:56'),(48,2,'inventory_created','2026-07-11','10:45:20',135,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 10:45:20','2026-07-11 10:45:20'),(49,2,'inventory_created','2026-07-11','10:47:39',136,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 10:47:39','2026-07-11 10:47:39'),(50,2,'inventory_created','2026-07-11','10:54:35',137,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 10:54:35','2026-07-11 10:54:35'),(51,2,'inventory_created','2026-07-11','11:04:01',138,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 11:04:01','2026-07-11 11:04:01'),(52,2,'inventory_created','2026-07-11','11:06:09',139,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 11:06:09','2026-07-11 11:06:09'),(53,2,'inventory_created','2026-07-11','11:35:33',140,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 11:35:33','2026-07-11 11:35:33'),(54,2,'inventory_created','2026-07-11','11:38:28',141,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 11:38:28','2026-07-11 11:38:28'),(55,2,'inventory_created','2026-07-11','11:41:28',142,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 11:41:28','2026-07-11 11:41:28'),(56,2,'inventory_created','2026-07-11','11:50:24',143,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 11:50:24','2026-07-11 11:50:24'),(57,2,'inventory_created','2026-07-11','11:52:53',144,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 11:52:53','2026-07-11 11:52:53'),(58,2,'inventory_created','2026-07-11','11:59:48',145,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 11:59:48','2026-07-11 11:59:48'),(59,2,'inventory_created','2026-07-11','12:08:27',146,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:08:27','2026-07-11 12:08:27'),(60,2,'inventory_created','2026-07-11','12:11:46',147,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:11:46','2026-07-11 12:11:46'),(61,2,'inventory_created','2026-07-11','12:15:40',148,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:15:40','2026-07-11 12:15:40'),(62,2,'inventory_created','2026-07-11','12:18:12',149,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:18:12','2026-07-11 12:18:12'),(63,2,'inventory_created','2026-07-11','12:21:43',150,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:21:43','2026-07-11 12:21:43'),(64,2,'inventory_created','2026-07-11','12:25:07',151,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:25:07','2026-07-11 12:25:07'),(65,2,'inventory_created','2026-07-11','12:27:29',152,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:27:29','2026-07-11 12:27:29'),(66,2,'inventory_created','2026-07-11','12:31:30',153,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:31:30','2026-07-11 12:31:30'),(67,2,'inventory_created','2026-07-11','12:34:31',154,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:34:31','2026-07-11 12:34:31'),(68,2,'inventory_created','2026-07-11','12:42:00',155,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:42:00','2026-07-11 12:42:00'),(69,2,'inventory_created','2026-07-11','12:45:07',156,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:45:07','2026-07-11 12:45:07'),(70,2,'inventory_created','2026-07-11','12:54:47',157,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:54:47','2026-07-11 12:54:47'),(71,2,'inventory_created','2026-07-11','12:59:19',158,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 12:59:19','2026-07-11 12:59:19'),(72,2,'inventory_created','2026-07-11','13:01:22',159,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:01:22','2026-07-11 13:01:22'),(73,2,'inventory_created','2026-07-11','13:03:17',160,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:03:17','2026-07-11 13:03:17'),(74,2,'inventory_created','2026-07-11','13:07:32',161,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:07:32','2026-07-11 13:07:32'),(75,2,'inventory_created','2026-07-11','13:13:51',162,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:13:51','2026-07-11 13:13:51'),(76,2,'inventory_created','2026-07-11','13:16:47',163,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:16:47','2026-07-11 13:16:47'),(77,2,'inventory_created','2026-07-11','13:21:04',164,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:21:04','2026-07-11 13:21:04'),(78,2,'inventory_created','2026-07-11','13:24:08',165,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:24:08','2026-07-11 13:24:08'),(79,2,'inventory_created','2026-07-11','13:29:17',166,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:29:17','2026-07-11 13:29:17'),(80,2,'inventory_created','2026-07-11','13:35:00',167,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:35:00','2026-07-11 13:35:00'),(81,2,'inventory_created','2026-07-11','13:38:25',168,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:38:25','2026-07-11 13:38:25'),(82,2,'inventory_created','2026-07-11','13:46:12',169,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 13:46:12','2026-07-11 13:46:12'),(83,2,'inventory_created','2026-07-11','14:01:46',170,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:01:46','2026-07-11 14:01:46'),(84,2,'inventory_created','2026-07-11','14:05:54',171,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:05:54','2026-07-11 14:05:54'),(85,2,'inventory_created','2026-07-11','14:07:51',172,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:07:51','2026-07-11 14:07:51'),(86,2,'inventory_created','2026-07-11','14:10:46',173,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:10:46','2026-07-11 14:10:46'),(87,2,'inventory_created','2026-07-11','14:14:34',174,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:14:34','2026-07-11 14:14:34'),(88,2,'inventory_created','2026-07-11','14:24:38',175,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:24:38','2026-07-11 14:24:38'),(89,2,'inventory_created','2026-07-11','14:31:47',176,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:31:47','2026-07-11 14:31:47'),(90,2,'inventory_created','2026-07-11','14:32:52',177,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:32:52','2026-07-11 14:32:52'),(91,2,'inventory_created','2026-07-11','14:35:06',178,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:35:06','2026-07-11 14:35:06'),(92,2,'inventory_created','2026-07-11','14:38:26',179,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:38:26','2026-07-11 14:38:26'),(93,2,'inventory_created','2026-07-11','14:40:25',180,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:40:25','2026-07-11 14:40:25'),(94,2,'inventory_created','2026-07-11','14:42:44',181,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:42:44','2026-07-11 14:42:44'),(95,2,'inventory_created','2026-07-11','14:48:12',182,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:48:12','2026-07-11 14:48:12'),(96,2,'inventory_created','2026-07-11','14:57:26',183,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-11 14:57:26','2026-07-11 14:57:26'),(97,2,'login','2026-07-12','20:39:33',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-12 20:39:33','2026-07-12 20:39:33'),(98,2,'login','2026-07-13','13:05:17',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-13 13:05:17','2026-07-13 13:05:17'),(99,2,'inventory_created','2026-07-13','19:13:46',184,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-13 19:13:46','2026-07-13 19:13:46'),(100,2,'inventory_created','2026-07-13','19:18:21',185,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-13 19:18:21','2026-07-13 19:18:21'),(101,2,'inventory_created','2026-07-13','19:22:12',186,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-13 19:22:12','2026-07-13 19:22:12'),(102,2,'inventory_created','2026-07-13','19:23:40',187,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-13 19:23:40','2026-07-13 19:23:40'),(103,2,'login','2026-07-14','11:46:03',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-14 11:46:03','2026-07-14 11:46:03'),(104,2,'inventory_created','2026-07-14','12:08:36',188,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 12:08:36','2026-07-14 12:08:36'),(105,2,'inventory_created','2026-07-14','12:12:28',189,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 12:12:28','2026-07-14 12:12:28'),(106,2,'inventory_created','2026-07-14','12:13:33',190,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 12:13:33','2026-07-14 12:13:33'),(107,2,'inventory_created','2026-07-14','12:29:43',191,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 12:29:43','2026-07-14 12:29:43'),(108,2,'inventory_created','2026-07-14','12:30:56',192,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 12:30:56','2026-07-14 12:30:56'),(109,2,'inventory_created','2026-07-14','12:50:56',193,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 12:50:56','2026-07-14 12:50:56'),(110,2,'inventory_created','2026-07-14','12:55:40',194,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 12:55:40','2026-07-14 12:55:40'),(111,2,'inventory_created','2026-07-14','12:59:28',195,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 12:59:28','2026-07-14 12:59:28'),(112,2,'inventory_created','2026-07-14','13:04:51',196,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:04:51','2026-07-14 13:04:51'),(113,2,'inventory_created','2026-07-14','13:17:25',197,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:17:25','2026-07-14 13:17:25'),(114,2,'inventory_created','2026-07-14','13:20:07',198,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:20:07','2026-07-14 13:20:07'),(115,2,'inventory_created','2026-07-14','13:21:01',199,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:21:01','2026-07-14 13:21:01'),(116,2,'inventory_created','2026-07-14','13:23:45',200,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:23:45','2026-07-14 13:23:45'),(117,2,'inventory_created','2026-07-14','13:26:28',201,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:26:28','2026-07-14 13:26:28'),(118,2,'inventory_created','2026-07-14','13:28:05',202,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:28:05','2026-07-14 13:28:05'),(119,2,'inventory_created','2026-07-14','13:31:49',203,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:31:49','2026-07-14 13:31:49'),(120,2,'inventory_created','2026-07-14','13:42:29',204,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:42:29','2026-07-14 13:42:29'),(121,2,'inventory_created','2026-07-14','13:51:46',205,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:51:46','2026-07-14 13:51:46'),(122,2,'inventory_created','2026-07-14','13:54:57',206,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:54:57','2026-07-14 13:54:57'),(123,2,'inventory_created','2026-07-14','13:57:58',207,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 13:57:58','2026-07-14 13:57:58'),(124,2,'inventory_created','2026-07-14','14:00:29',208,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 14:00:29','2026-07-14 14:00:29'),(125,2,'inventory_created','2026-07-14','14:03:48',209,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 14:03:48','2026-07-14 14:03:48'),(126,2,'inventory_created','2026-07-14','18:07:33',210,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 18:07:33','2026-07-14 18:07:33'),(127,2,'inventory_created','2026-07-14','18:10:28',211,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 18:10:28','2026-07-14 18:10:28'),(128,2,'inventory_created','2026-07-14','18:35:14',212,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 18:35:14','2026-07-14 18:35:14'),(129,2,'inventory_created','2026-07-14','18:42:00',213,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 18:42:00','2026-07-14 18:42:00'),(130,2,'inventory_created','2026-07-14','18:55:19',214,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 18:55:19','2026-07-14 18:55:19'),(131,2,'inventory_created','2026-07-14','20:01:35',215,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 20:01:35','2026-07-14 20:01:35'),(132,2,'inventory_created','2026-07-14','20:12:47',216,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 20:12:47','2026-07-14 20:12:47'),(133,2,'inventory_created','2026-07-14','20:16:58',217,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 20:16:58','2026-07-14 20:16:58'),(134,2,'inventory_created','2026-07-14','20:24:42',218,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 20:24:42','2026-07-14 20:24:42'),(135,2,'inventory_created','2026-07-14','20:28:20',219,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 20:28:20','2026-07-14 20:28:20'),(136,2,'inventory_created','2026-07-14','20:35:37',220,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 20:35:37','2026-07-14 20:35:37'),(137,2,'inventory_created','2026-07-14','21:26:21',221,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 21:26:21','2026-07-14 21:26:21'),(138,2,'inventory_created','2026-07-14','22:00:20',222,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 22:00:20','2026-07-14 22:00:20'),(139,2,'inventory_created','2026-07-14','22:08:12',223,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-14 22:08:12','2026-07-14 22:08:12'),(140,2,'login','2026-07-15','17:39:10',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-15 17:39:10','2026-07-15 17:39:10'),(141,2,'inventory_created','2026-07-15','17:57:36',224,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 17:57:36','2026-07-15 17:57:36'),(142,2,'inventory_created','2026-07-15','18:34:06',225,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 18:34:06','2026-07-15 18:34:06'),(143,2,'inventory_created','2026-07-15','18:46:11',226,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 18:46:11','2026-07-15 18:46:11'),(144,2,'inventory_created','2026-07-15','19:08:51',227,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 19:08:51','2026-07-15 19:08:51'),(145,2,'inventory_created','2026-07-15','19:20:25',228,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 19:20:25','2026-07-15 19:20:25'),(146,2,'inventory_created','2026-07-15','19:26:53',229,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 19:26:53','2026-07-15 19:26:53'),(147,2,'inventory_created','2026-07-15','19:37:17',230,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 19:37:17','2026-07-15 19:37:17'),(148,2,'inventory_created','2026-07-15','19:45:14',231,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 19:45:14','2026-07-15 19:45:14'),(149,2,'inventory_created','2026-07-15','20:01:10',232,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 20:01:10','2026-07-15 20:01:10'),(150,2,'inventory_created','2026-07-15','20:04:51',233,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 20:04:51','2026-07-15 20:04:51'),(151,2,'inventory_created','2026-07-15','20:17:07',234,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 20:17:07','2026-07-15 20:17:07'),(152,2,'inventory_created','2026-07-15','20:40:17',235,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 20:40:17','2026-07-15 20:40:17'),(153,2,'inventory_created','2026-07-15','20:49:14',236,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 20:49:14','2026-07-15 20:49:14'),(154,2,'inventory_created','2026-07-15','20:55:16',237,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 20:55:16','2026-07-15 20:55:16'),(155,2,'inventory_created','2026-07-15','21:12:31',238,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-15 21:12:31','2026-07-15 21:12:31'),(156,2,'login','2026-07-16','18:18:53',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-16 18:18:53','2026-07-16 18:18:53'),(157,2,'inventory_created','2026-07-16','18:40:55',239,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 18:40:55','2026-07-16 18:40:55'),(158,2,'inventory_created','2026-07-16','19:01:05',240,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 19:01:05','2026-07-16 19:01:05'),(159,2,'inventory_created','2026-07-16','19:06:14',241,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 19:06:14','2026-07-16 19:06:14'),(160,2,'inventory_created','2026-07-16','19:28:51',242,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 19:28:51','2026-07-16 19:28:51'),(161,2,'inventory_created','2026-07-16','19:43:44',243,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 19:43:44','2026-07-16 19:43:44'),(162,2,'inventory_created','2026-07-16','19:51:38',244,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 19:51:38','2026-07-16 19:51:38'),(163,2,'inventory_created','2026-07-16','19:57:29',245,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 19:57:29','2026-07-16 19:57:29'),(164,2,'inventory_created','2026-07-16','20:09:54',246,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 20:09:54','2026-07-16 20:09:54'),(165,2,'inventory_created','2026-07-16','20:40:29',247,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 20:40:29','2026-07-16 20:40:29'),(166,2,'inventory_created','2026-07-16','20:51:36',248,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 20:51:36','2026-07-16 20:51:36'),(167,2,'inventory_created','2026-07-16','21:06:05',249,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 21:06:05','2026-07-16 21:06:05'),(168,2,'inventory_created','2026-07-16','21:35:35',250,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 21:35:35','2026-07-16 21:35:35'),(169,2,'inventory_created','2026-07-16','21:40:28',251,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 21:40:28','2026-07-16 21:40:28'),(170,2,'inventory_created','2026-07-16','21:43:12',252,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 21:43:12','2026-07-16 21:43:12'),(171,2,'inventory_created','2026-07-16','21:48:26',253,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 21:48:26','2026-07-16 21:48:26'),(172,2,'inventory_created','2026-07-16','21:51:54',254,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 21:51:54','2026-07-16 21:51:54'),(173,2,'inventory_created','2026-07-16','21:59:24',255,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 21:59:24','2026-07-16 21:59:24'),(174,2,'inventory_created','2026-07-16','22:02:53',256,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 22:02:53','2026-07-16 22:02:53'),(175,2,'inventory_created','2026-07-16','22:05:52',257,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 22:05:52','2026-07-16 22:05:52'),(176,2,'inventory_created','2026-07-16','22:08:56',258,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-16 22:08:56','2026-07-16 22:08:56'),(177,2,'login','2026-07-17','18:16:47',2,'App\\Models\\Tenant\\User','38.250.154.74','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-17 18:16:47','2026-07-17 18:16:47'),(178,2,'inventory_created','2026-07-17','18:31:59',259,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 18:31:59','2026-07-17 18:31:59'),(179,2,'inventory_created','2026-07-17','18:39:36',260,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 18:39:36','2026-07-17 18:39:36'),(180,2,'inventory_created','2026-07-17','18:49:12',261,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 18:49:12','2026-07-17 18:49:12'),(181,2,'inventory_created','2026-07-17','19:00:20',262,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 19:00:20','2026-07-17 19:00:20'),(182,2,'inventory_created','2026-07-17','19:05:06',263,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 19:05:06','2026-07-17 19:05:06'),(183,2,'inventory_created','2026-07-17','19:10:02',264,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 19:10:02','2026-07-17 19:10:02'),(184,2,'inventory_created','2026-07-17','19:18:27',265,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 19:18:27','2026-07-17 19:18:27'),(185,2,'inventory_created','2026-07-17','19:22:24',266,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 19:22:24','2026-07-17 19:22:24'),(186,2,'inventory_created','2026-07-17','19:57:36',267,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 19:57:36','2026-07-17 19:57:36'),(187,2,'inventory_created','2026-07-17','20:09:47',268,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 20:09:47','2026-07-17 20:09:47'),(188,2,'inventory_created','2026-07-17','20:12:59',269,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 20:12:59','2026-07-17 20:12:59'),(189,2,'inventory_created','2026-07-17','20:22:52',270,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 20:22:52','2026-07-17 20:22:52'),(190,2,'inventory_created','2026-07-17','20:37:56',271,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 20:37:56','2026-07-17 20:37:56'),(191,2,'inventory_created','2026-07-17','21:09:11',272,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-17 21:09:11','2026-07-17 21:09:11'),(192,2,'login','2026-07-20','11:32:00',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:32:00','2026-07-20 11:32:00'),(193,2,'inventory_created','2026-07-20','11:34:58',273,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'inventory/transaction',NULL,NULL,'2026-07-20 11:34:58','2026-07-20 11:34:58'),(194,2,'inventory_created','2026-07-20','11:37:38',274,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'inventory/transaction',NULL,NULL,'2026-07-20 11:37:38','2026-07-20 11:37:38'),(195,2,'logout','2026-07-20','11:41:32',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:41:32','2026-07-20 11:41:32'),(196,3,'login','2026-07-20','11:41:41',3,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:41:41','2026-07-20 11:41:41'),(197,3,'module_access_error','2026-07-20','11:41:41',3,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:41:41','2026-07-20 11:41:41'),(198,3,'logout','2026-07-20','11:42:20',3,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:42:20','2026-07-20 11:42:20'),(199,2,'login','2026-07-20','11:42:22',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:42:22','2026-07-20 11:42:22'),(200,2,'logout','2026-07-20','11:43:15',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:43:15','2026-07-20 11:43:15'),(201,4,'login','2026-07-20','11:43:24',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:43:24','2026-07-20 11:43:24'),(202,4,'module_access_error','2026-07-20','11:43:24',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:43:24','2026-07-20 11:43:24'),(203,1,'login','2026-07-20','11:50:24',1,'App\\Models\\Tenant\\User','179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:50:24','2026-07-20 11:50:24'),(204,4,'logout','2026-07-20','11:55:30',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:55:30','2026-07-20 11:55:30'),(205,2,'login','2026-07-20','11:55:33',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:55:33','2026-07-20 11:55:33'),(206,2,'logout','2026-07-20','11:57:15',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:57:15','2026-07-20 11:57:15'),(207,2,'login','2026-07-20','11:57:16',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:57:16','2026-07-20 11:57:16'),(208,2,'logout','2026-07-20','11:57:42',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:57:42','2026-07-20 11:57:42'),(209,4,'login','2026-07-20','11:57:53',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:57:53','2026-07-20 11:57:53'),(210,4,'module_access_error','2026-07-20','11:57:54',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 11:57:54','2026-07-20 11:57:54'),(211,4,'module_access_error','2026-07-20','12:19:25',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 12:19:25','2026-07-20 12:19:25'),(212,4,'module_access_error','2026-07-20','12:20:18',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents/create',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 12:20:18','2026-07-20 12:20:18'),(213,4,'module_access_error','2026-07-20','12:22:12',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 12:22:12','2026-07-20 12:22:12'),(214,4,'module_access_error','2026-07-20','12:22:44',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 12:22:44','2026-07-20 12:22:44'),(215,4,'module_access_error','2026-07-20','12:25:58',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 12:25:58','2026-07-20 12:25:58'),(216,4,'module_access_error','2026-07-20','12:28:19',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 12:28:19','2026-07-20 12:28:19'),(217,4,'module_access_error','2026-07-20','12:28:27',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 12:28:27','2026-07-20 12:28:27'),(218,4,'module_access_error','2026-07-20','12:28:40',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 12:28:40','2026-07-20 12:28:40'),(219,4,'module_access_error','2026-07-20','13:31:40',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:31:40','2026-07-20 13:31:40'),(220,4,'logout','2026-07-20','13:32:21',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:32:21','2026-07-20 13:32:21'),(221,2,'login','2026-07-20','13:32:27',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:32:27','2026-07-20 13:32:27'),(222,2,'logout','2026-07-20','13:32:41',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:32:41','2026-07-20 13:32:41'),(223,4,'login','2026-07-20','13:33:23',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:33:23','2026-07-20 13:33:23'),(224,4,'module_access_error','2026-07-20','13:33:24',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:33:24','2026-07-20 13:33:24'),(225,4,'module_access_error','2026-07-20','13:34:15',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:34:15','2026-07-20 13:34:15'),(226,4,'logout','2026-07-20','13:34:32',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:34:32','2026-07-20 13:34:32'),(227,2,'login','2026-07-20','13:34:37',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:34:37','2026-07-20 13:34:37'),(228,2,'logout','2026-07-20','13:35:37',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:35:37','2026-07-20 13:35:37'),(229,4,'failed','2026-07-20','13:36:37',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:36:37','2026-07-20 13:36:37'),(230,4,'login','2026-07-20','13:36:50',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:36:50','2026-07-20 13:36:50'),(231,4,'module_access_error','2026-07-20','13:36:51',4,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-20 13:36:51','2026-07-20 13:36:51'),(232,NULL,'failed','2026-07-20','21:13:54',NULL,NULL,'179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-20 21:13:54','2026-07-20 21:13:54'),(233,1,'login','2026-07-20','21:14:15',1,'App\\Models\\Tenant\\User','179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-20 21:14:15','2026-07-20 21:14:15'),(234,1,'logout','2026-07-20','21:14:38',1,'App\\Models\\Tenant\\User','179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-20 21:14:38','2026-07-20 21:14:38'),(235,4,'login','2026-07-20','21:14:45',4,'App\\Models\\Tenant\\User','179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-20 21:14:45','2026-07-20 21:14:45'),(236,4,'module_access_error','2026-07-20','21:14:45',4,'App\\Models\\Tenant\\User','179.6.26.113','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'documents',NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"LMA\",\"region_name\":\"Lima Province\",\"city_name\":\"Lima\",\"latitude\":\"-12.046\",\"longitude\":\"-77.0305\",\"timezone\":\"America\\/Lima\"}','2026-07-20 21:14:45','2026-07-20 21:14:45'),(237,2,'login','2026-07-21','11:55:43',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-21 11:55:43','2026-07-21 11:55:43'),(238,2,'inventory_created','2026-07-21','22:24:41',275,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-21 22:24:41','2026-07-21 22:24:41'),(239,2,'inventory_created','2026-07-21','22:29:55',276,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-21 22:29:55','2026-07-21 22:29:55'),(240,2,'inventory_created','2026-07-21','22:55:58',277,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'inventory/transaction',NULL,NULL,'2026-07-21 22:55:58','2026-07-21 22:55:58'),(241,2,'login','2026-07-23','18:06:33',2,'App\\Models\\Tenant\\User','38.250.154.51','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Guadalupe\",\"latitude\":\"-13.986\",\"longitude\":\"-75.7728\",\"timezone\":\"America\\/Lima\"}','2026-07-23 18:06:33','2026-07-23 18:06:33'),(242,2,'inventory_created','2026-07-23','19:03:08',278,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 19:03:08','2026-07-23 19:03:08'),(243,2,'inventory_created','2026-07-23','19:13:16',279,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 19:13:16','2026-07-23 19:13:16'),(244,2,'inventory_created','2026-07-23','19:27:41',280,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 19:27:41','2026-07-23 19:27:41'),(245,2,'inventory_created','2026-07-23','19:36:41',281,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 19:36:41','2026-07-23 19:36:41'),(246,2,'inventory_created','2026-07-23','19:42:43',282,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 19:42:43','2026-07-23 19:42:43'),(247,2,'inventory_created','2026-07-23','19:55:11',283,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 19:55:11','2026-07-23 19:55:11'),(248,2,'inventory_created','2026-07-23','20:12:19',284,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 20:12:19','2026-07-23 20:12:19'),(249,2,'inventory_created','2026-07-23','20:24:31',285,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 20:24:31','2026-07-23 20:24:31'),(250,2,'inventory_created','2026-07-23','21:14:22',286,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 21:14:22','2026-07-23 21:14:22'),(251,2,'inventory_created','2026-07-23','21:20:10',287,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 21:20:10','2026-07-23 21:20:10'),(252,2,'inventory_created','2026-07-23','21:22:38',288,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 21:22:38','2026-07-23 21:22:38'),(253,2,'inventory_created','2026-07-23','21:24:47',289,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 21:24:47','2026-07-23 21:24:47'),(254,2,'inventory_created','2026-07-23','21:26:48',290,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 21:26:48','2026-07-23 21:26:48'),(255,2,'inventory_created','2026-07-23','21:32:43',291,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 21:32:43','2026-07-23 21:32:43'),(256,2,'inventory_created','2026-07-23','21:41:51',292,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 21:41:51','2026-07-23 21:41:51'),(257,2,'inventory_created','2026-07-23','21:51:29',293,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 21:51:29','2026-07-23 21:51:29'),(258,2,'inventory_created','2026-07-23','21:55:08',294,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-23 21:55:08','2026-07-23 21:55:08'),(259,2,'login','2026-07-24','18:05:21',2,'App\\Models\\Tenant\\User','38.250.154.78','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Ica\",\"latitude\":\"-14.0754\",\"longitude\":\"-75.7342\",\"timezone\":\"America\\/Lima\"}','2026-07-24 18:05:21','2026-07-24 18:05:21'),(260,2,'inventory_created','2026-07-24','18:08:57',295,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'inventory/lotes/22',NULL,NULL,'2026-07-24 18:08:57','2026-07-24 18:08:57'),(261,2,'inventory_created','2026-07-24','18:10:48',296,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 18:10:48','2026-07-24 18:10:48'),(262,2,'inventory_created','2026-07-24','18:30:53',297,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 18:30:53','2026-07-24 18:30:53'),(263,2,'inventory_created','2026-07-24','18:46:13',298,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 18:46:13','2026-07-24 18:46:13'),(264,2,'inventory_created','2026-07-24','19:05:13',299,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 19:05:13','2026-07-24 19:05:13'),(265,2,'inventory_created','2026-07-24','19:26:09',300,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 19:26:09','2026-07-24 19:26:09'),(266,2,'inventory_created','2026-07-24','19:29:40',301,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 19:29:40','2026-07-24 19:29:40'),(267,2,'inventory_created','2026-07-24','22:52:50',302,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 22:52:50','2026-07-24 22:52:50'),(268,2,'inventory_created','2026-07-24','22:54:29',303,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 22:54:29','2026-07-24 22:54:29'),(269,2,'inventory_created','2026-07-24','23:07:58',304,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 23:07:58','2026-07-24 23:07:58'),(270,2,'inventory_created','2026-07-24','23:10:42',305,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 23:10:42','2026-07-24 23:10:42'),(271,2,'inventory_created','2026-07-24','23:13:54',306,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 23:13:54','2026-07-24 23:13:54'),(272,2,'inventory_created','2026-07-24','23:17:34',307,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 23:17:34','2026-07-24 23:17:34'),(273,2,'inventory_created','2026-07-24','23:19:51',308,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-24 23:19:51','2026-07-24 23:19:51'),(274,2,'login','2026-07-25','18:12:02',2,'App\\Models\\Tenant\\User','38.250.154.59','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Parcona\",\"latitude\":\"-14.0415\",\"longitude\":\"-75.6983\",\"timezone\":\"America\\/Lima\"}','2026-07-25 18:12:02','2026-07-25 18:12:02'),(275,2,'login','2026-07-26','19:08:50',2,'App\\Models\\Tenant\\User','38.250.154.59','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Parcona\",\"latitude\":\"-14.0415\",\"longitude\":\"-75.6983\",\"timezone\":\"America\\/Lima\"}','2026-07-26 19:08:50','2026-07-26 19:08:50'),(276,2,'login','2026-07-27','18:26:08',2,'App\\Models\\Tenant\\User','38.250.154.59','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Parcona\",\"latitude\":\"-14.0415\",\"longitude\":\"-75.6983\",\"timezone\":\"America\\/Lima\"}','2026-07-27 18:26:08','2026-07-27 18:26:08'),(277,2,'inventory_created','2026-07-27','21:00:55',309,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-27 21:00:55','2026-07-27 21:00:55'),(278,2,'inventory_created','2026-07-27','21:27:20',310,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-27 21:27:20','2026-07-27 21:27:20'),(279,2,'inventory_created','2026-07-27','21:33:57',311,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-27 21:33:57','2026-07-27 21:33:57'),(280,2,'inventory_created','2026-07-27','21:58:33',312,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-27 21:58:33','2026-07-27 21:58:33'),(281,2,'login','2026-07-28','11:25:30',2,'App\\Models\\Tenant\\User','38.250.154.59','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,NULL,NULL,'{\"country_name\":\"Peru\",\"country_code\":\"PE\",\"region_code\":\"ICA\",\"region_name\":\"Ica\",\"city_name\":\"Parcona\",\"latitude\":\"-14.0415\",\"longitude\":\"-75.6983\",\"timezone\":\"America\\/Lima\"}','2026-07-28 11:25:30','2026-07-28 11:25:30'),(282,2,'inventory_created','2026-07-28','11:35:20',313,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-28 11:35:20','2026-07-28 11:35:20'),(283,2,'inventory_created','2026-07-28','12:24:18',314,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-28 12:24:18','2026-07-28 12:24:18'),(284,2,'inventory_created','2026-07-28','14:49:04',315,'Modules\\Inventory\\Models\\Inventory','172.18.0.1','WebKit','desktop','Windows','10.0','Chrome','150.0.0.0',NULL,'items',NULL,NULL,'2026-07-28 14:49:04','2026-07-28 14:49:04');
COMMIT;

-- Dumped table `system_activity_logs` with 284 row(s)
--

--
-- Table structure for table `system_activity_log_types`
--

CREATE TABLE `system_activity_log_types` (
  `id` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `system_activity_log_types`
--

SET autocommit=0;
INSERT INTO `system_activity_log_types` VALUES ('companies_certificate','Actualización del campo certificado en configuración de empresa'),('companies_name','Actualización del campo nombre en configuración de empresa'),('companies_number','Actualización del campo número en configuración de empresa'),('companies_soap_password','Actualización del campo SOAP Contraseña en configuración de empresa'),('companies_soap_send_id','Actualización del campo SOAP envío en configuración de empresa'),('companies_soap_type_id','Actualización del campo SOAP tipo en configuración de empresa'),('companies_soap_url','Actualización del campo SOAP url envío en configuración de empresa'),('companies_soap_username','Actualización del campo SOAP Usuario en configuración de empresa'),('contract_voided','Anulación de contrato'),('document_voided','Anulación de comprobante (boleta/factura)'),('expense_voided','Anulación de gasto'),('failed','Error de inicio de sesión'),('fixed_asset_purchase_voided','Anulación de compra de activo fijo'),('income_voided','Anulación de ingreso'),('inventory_created','Movimiento/ajuste de inventario'),('inventory_transfer_created','Traslado entre almacenes'),('level_module_access_error','Error de acceso al submódulo (no tiene permiso)'),('login','Iniciar sesión'),('login_lockout','Bloqueo de usuario por exceder límite de intentos permitidos al iniciar sesión'),('logout','Cerrar sesión'),('module_access_error','Error de acceso al módulo (no tiene permiso)'),('order_note_voided','Anulación de nota de pedido'),('payment_method_corrected','Corrección de método de pago'),('purchase_order_voided','Anulación de orden de compra'),('purchase_voided','Anulación de compra'),('quotation_voided','Anulación de cotización'),('sale_note_voided','Anulación de nota de venta');
COMMIT;

-- Dumped table `system_activity_log_types` with 27 row(s)
--

--
-- Table structure for table `tags`
--

CREATE TABLE `tags` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tags`
--

SET autocommit=0;
COMMIT;

-- Dumped table `tags` with 0 row(s)
--

--
-- Table structure for table `tasks`
--

CREATE TABLE `tasks` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `class` varchar(255) NOT NULL,
  `execution_time` time NOT NULL,
  `output` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tasks`
--

SET autocommit=0;
COMMIT;

-- Dumped table `tasks` with 0 row(s)
--

--
-- Table structure for table `technical_services`
--

CREATE TABLE `technical_services` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `soap_type_id` char(2) NOT NULL,
  `establishment_id` int(10) unsigned DEFAULT 0,
  `establishment` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`establishment`)),
  `customer_id` int(10) unsigned NOT NULL,
  `customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`customer`)),
  `currency_type_id` text DEFAULT NULL,
  `payment_condition_id` text DEFAULT NULL,
  `payment_method_type_id` text DEFAULT NULL,
  `seller_id` int(10) unsigned DEFAULT 0,
  `exchange_rate_sale` decimal(13,3) DEFAULT 0.000,
  `total_prepayment` decimal(12,2) DEFAULT 0.00,
  `total_charge` decimal(12,2) DEFAULT 0.00,
  `total_discount` decimal(12,2) DEFAULT 0.00,
  `total_exportation` decimal(12,2) DEFAULT 0.00,
  `total_free` decimal(12,2) DEFAULT 0.00,
  `total_taxed` decimal(12,2) DEFAULT 0.00,
  `total_unaffected` decimal(12,2) DEFAULT 0.00,
  `total_exonerated` decimal(12,2) DEFAULT 0.00,
  `total_igv` decimal(12,2) DEFAULT 0.00,
  `total_igv_free` decimal(12,2) DEFAULT 0.00,
  `total_base_isc` decimal(12,2) DEFAULT 0.00,
  `total_isc` decimal(12,2) DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) DEFAULT 0.00,
  `total_plastic_bag_taxes` decimal(6,2) DEFAULT 0.00,
  `total_taxes` decimal(12,2) DEFAULT 0.00,
  `total_value` decimal(12,2) DEFAULT 0.00,
  `subtotal` decimal(12,2) DEFAULT 0.00,
  `total` decimal(12,2) DEFAULT 0.00,
  `is_editable` tinyint(3) unsigned DEFAULT 0,
  `cellphone` varchar(255) NOT NULL,
  `date_of_issue` date NOT NULL,
  `time_of_issue` time NOT NULL,
  `description` text NOT NULL,
  `state` text NOT NULL,
  `reason` text NOT NULL,
  `serial_number` varchar(255) NOT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `cost` decimal(12,2) NOT NULL DEFAULT 0.00,
  `prepayment` decimal(12,2) NOT NULL DEFAULT 0.00,
  `activities` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `brand` varchar(255) DEFAULT NULL,
  `equipment` varchar(255) DEFAULT NULL,
  `important_note` text DEFAULT NULL,
  `repair` tinyint(1) NOT NULL DEFAULT 0,
  `warranty` tinyint(1) NOT NULL DEFAULT 0,
  `maintenance` tinyint(1) NOT NULL DEFAULT 0,
  `diagnosis` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `technical_services_user_id_foreign` (`user_id`),
  KEY `technical_services_soap_type_id_foreign` (`soap_type_id`),
  KEY `technical_services_customer_id_foreign` (`customer_id`),
  KEY `technical_services_date_of_issue_index` (`date_of_issue`),
  KEY `technical_services_serial_number_index` (`serial_number`),
  CONSTRAINT `technical_services_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `technical_services_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `technical_services_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `technical_services`
--

SET autocommit=0;
COMMIT;

-- Dumped table `technical_services` with 0 row(s)
--

--
-- Table structure for table `technical_service_items`
--

CREATE TABLE `technical_service_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `technical_services_id` int(10) unsigned DEFAULT 0 COMMENT 'Id de technical_services',
  `item_id` int(10) unsigned DEFAULT 0 COMMENT 'Id de item',
  `item` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Json con el contenido de item' CHECK (json_valid(`item`)),
  `quantity` float DEFAULT 0 COMMENT 'Cantidad de item usado',
  `unit_value` float DEFAULT 0 COMMENT 'unit_value',
  `affectation_igv_type_id` longtext DEFAULT NULL COMMENT 'Tipo de afectacion dde igv. cat_affectation_igv_types',
  `total_base_igv` float DEFAULT 0 COMMENT 'Monto base del IGV',
  `percentage_igv` float DEFAULT 0,
  `total_igv` float DEFAULT 0,
  `system_isc_type_id` longtext DEFAULT NULL,
  `total_base_isc` float DEFAULT 0,
  `percentage_isc` float DEFAULT 0,
  `total_isc` float DEFAULT 0,
  `total_base_other_taxes` float DEFAULT 0,
  `percentage_other_taxes` float DEFAULT 0,
  `total_other_taxes` float DEFAULT 0,
  `total_plastic_bag_taxes` float DEFAULT 0,
  `total_taxes` float DEFAULT 0,
  `price_type_id` longtext DEFAULT NULL,
  `unit_price` float DEFAULT 0,
  `total_value` float DEFAULT 0,
  `total_charge` float DEFAULT 0,
  `total_discount` float DEFAULT 0,
  `total` float DEFAULT 0,
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Atributos' CHECK (json_valid(`attributes`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Descuentos' CHECK (json_valid(`discounts`)),
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Cargos' CHECK (json_valid(`charges`)),
  `additional_information` longtext DEFAULT NULL COMMENT 'Informacion adicional',
  `warehouse_id` int(10) unsigned DEFAULT 0 COMMENT 'Id de item',
  `name_product_pdf` longtext DEFAULT NULL COMMENT 'Nombre de producto en el pdf',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `technical_service_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `technical_service_items` with 0 row(s)
--

--
-- Table structure for table `technical_service_payments`
--

CREATE TABLE `technical_service_payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `technical_service_id` int(10) unsigned NOT NULL,
  `date_of_payment` date NOT NULL,
  `payment_method_type_id` char(2) NOT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `change` decimal(12,2) NOT NULL DEFAULT 0.00,
  `payment` decimal(12,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `technical_service_payments_technical_service_id_foreign` (`technical_service_id`),
  KEY `technical_service_payments_payment_method_type_id_foreign` (`payment_method_type_id`),
  CONSTRAINT `technical_service_payments_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `technical_service_payments_technical_service_id_foreign` FOREIGN KEY (`technical_service_id`) REFERENCES `technical_services` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `technical_service_payments`
--

SET autocommit=0;
COMMIT;

-- Dumped table `technical_service_payments` with 0 row(s)
--

--
-- Table structure for table `tips`
--

CREATE TABLE `tips` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `soap_type_id` char(2) NOT NULL,
  `date` date NOT NULL COMMENT 'Fecha de registro',
  `origin_date_of_issue` date NOT NULL COMMENT 'Fecha del documento origen de la propina',
  `origin_id` int(11) NOT NULL,
  `origin_type` varchar(255) NOT NULL,
  `worker_full_name` varchar(255) NOT NULL,
  `total` decimal(12,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `origin_index` (`origin_id`,`origin_type`),
  KEY `tips_soap_type_id_foreign` (`soap_type_id`),
  KEY `tips_date_index` (`date`),
  KEY `tips_origin_date_of_issue_index` (`origin_date_of_issue`),
  KEY `tips_worker_full_name_index` (`worker_full_name`),
  CONSTRAINT `tips_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tips`
--

SET autocommit=0;
COMMIT;

-- Dumped table `tips` with 0 row(s)
--

--
-- Table structure for table `track_api_peru_services`
--

CREATE TABLE `track_api_peru_services` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `service` int(10) unsigned DEFAULT 0 COMMENT 'Tipo de servicio  1 => sunat/dni, 2 => validacion_multiple_cpe, 3 => CPE, 4 => tipo_de_cambio, 5 => printer_ticket',
  `date_of_issue` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `track_api_peru_services`
--

SET autocommit=0;
COMMIT;

-- Dumped table `track_api_peru_services` with 0 row(s)
--

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `payment_link_id` int(10) unsigned NOT NULL,
  `soap_type_id` char(2) DEFAULT NULL,
  `date` date NOT NULL,
  `time` time NOT NULL,
  `uuid` char(36) NOT NULL,
  `description` varchar(255) NOT NULL,
  `payment_id` varchar(255) DEFAULT NULL,
  `amount` decimal(16,2) NOT NULL,
  `transaction_state_id` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `transactions_uuid_unique` (`uuid`),
  KEY `transactions_payment_link_id_foreign` (`payment_link_id`),
  KEY `transactions_transaction_state_id_foreign` (`transaction_state_id`),
  KEY `transactions_date_index` (`date`),
  KEY `transactions_time_index` (`time`),
  KEY `transactions_description_index` (`description`),
  KEY `transactions_payment_id_index` (`payment_id`),
  KEY `transactions_amount_index` (`amount`),
  KEY `transactions_soap_type_id_foreign` (`soap_type_id`),
  CONSTRAINT `transactions_payment_link_id_foreign` FOREIGN KEY (`payment_link_id`) REFERENCES `payment_links` (`id`),
  CONSTRAINT `transactions_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `transactions_transaction_state_id_foreign` FOREIGN KEY (`transaction_state_id`) REFERENCES `transaction_states` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transactions`
--

SET autocommit=0;
COMMIT;

-- Dumped table `transactions` with 0 row(s)
--

--
-- Table structure for table `transaction_queries`
--

CREATE TABLE `transaction_queries` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `time` time NOT NULL,
  `response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`response`)),
  `transaction_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transaction_queries_transaction_id_foreign` (`transaction_id`),
  CONSTRAINT `transaction_queries_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transaction_queries`
--

SET autocommit=0;
COMMIT;

-- Dumped table `transaction_queries` with 0 row(s)
--

--
-- Table structure for table `transaction_states`
--

CREATE TABLE `transaction_states` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `success` tinyint(1) NOT NULL,
  `status` varchar(255) NOT NULL,
  `status_detail` varchar(255) NOT NULL,
  `original_message` varchar(255) NOT NULL,
  `user_message` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `transaction_states_name_index` (`name`),
  KEY `transaction_states_success_index` (`success`),
  KEY `transaction_states_status_index` (`status`),
  KEY `transaction_states_status_detail_index` (`status_detail`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transaction_states`
--

SET autocommit=0;
INSERT INTO `transaction_states` VALUES ('00','Rechazado (Error desconocido)',0,'other','other','Error desconocido','Lo sentimos, ocurrió un error inesperado.'),('01','Aceptado',1,'approved','accredited','¡Listo! Se acreditó tu pago. En tu resumen verás el cargo de amount como statement_descriptor.','¡Listo! Se acreditó tu pago. En tu resumen verás el cargo del pago.'),('02','En proceso',1,'in_process','pending_contingency','Estamos procesando tu pago. No te preocupes, menos de 2 días hábiles te avisaremos por e-mail si se acreditó.','Estamos procesando tu pago. No te preocupes, en menos de 2 días hábiles te avisaremos por e-mail si se acreditó.'),('03','En proceso',1,'in_process','pending_review_manual','Estamos procesando tu pago. No te preocupes, menos de 2 días hábiles te avisaremos por e-mail si se acreditó o si necesitamos más información.','Estamos procesando tu pago. No te preocupes, en menos de 2 días hábiles te avisaremos por e-mail si se acreditó o si necesitamos más información.'),('04','Rechazado',0,'rejected','cc_rejected_bad_filled_card_number','Revisa el número de tarjeta.','Lo sentimos, ocurrió un inconveniente. Revisa el número de tarjeta.'),('05','Rechazado',0,'rejected','cc_rejected_bad_filled_date','Revisa la fecha de vencimiento.','Lo sentimos, ocurrió un inconveniente. Revisa la fecha de vencimiento.'),('06','Rechazado',0,'rejected','cc_rejected_bad_filled_other','Revisa los datos.','Lo sentimos, ocurrió un inconveniente. Revisa los datos.'),('07','Rechazado',0,'rejected','cc_rejected_bad_filled_security_code','Revisa el código de seguridad de la tarjeta.','Lo sentimos, ocurrió un inconveniente. Revisa el código de seguridad de la tarjeta.'),('08','Rechazado',0,'rejected','cc_rejected_blacklist','No pudimos procesar tu pago.','Lo sentimos, ocurrió un inconveniente. No pudimos procesar tu pago.'),('09','Rechazado',0,'rejected','cc_rejected_call_for_authorize','Debes autorizar ante payment_method_id el pago de amount.','Debes autorizar ante el medio de pago, el pago a realizar.'),('10','Rechazado',0,'rejected','cc_rejected_card_disabled','Llama a payment_method_id para activar tu tarjeta o usa otro medio de pago. El teléfono está al dorso de tu tarjeta.','Llama a la entidad para activar tu tarjeta o usa otro medio de pago. El teléfono está al dorso de tu tarjeta.'),('11','Rechazado',0,'rejected','cc_rejected_card_error','No pudimos procesar tu pago.','Lo sentimos, ocurrió un inconveniente. No pudimos procesar tu pago.'),('12','Rechazado',0,'rejected','cc_rejected_duplicated_payment','Ya hiciste un pago por ese valor. Si necesitas volver a pagar usa otra tarjeta u otro medio de pago.','Ya hiciste un pago por ese valor. Si necesitas volver a pagar usa otra tarjeta u otro medio de pago.'),('13','Rechazado',0,'rejected','cc_rejected_high_risk','Tu pago fue rechazado. Elige otro de los medios de pago, te recomendamos con medios en efectivo.','Tu pago fue rechazado. Elige otro de los medios de pago, te recomendamos con medios en efectivo.'),('14','Rechazado',0,'rejected','cc_rejected_insufficient_amount','Tu payment_method_id no tiene fondos suficientes.','Lo sentimos, ocurrió un inconveniente. Tu medio de pago no tiene fondos suficientes.'),('15','Rechazado',0,'rejected','cc_rejected_invalid_installments','payment_method_id no procesa pagos en installments cuotas.','Para el medio de pago ingresado, no se puede procesar los pagos en la cantidad de cuotas seleccionadas.'),('16','Rechazado',0,'rejected','cc_rejected_max_attempts','Llegaste al límite de intentos permitidos. Elige otra tarjeta u otro medio de pago.','Llegaste al límite de intentos permitidos. Elige otra tarjeta u otro medio de pago.'),('17','Rechazado',0,'rejected','cc_rejected_other_reason','payment_method_id no procesó el pago.','Lo sentimos, ocurrió un inconveniente. El pago no pudo ser procesado por el medio usado');
COMMIT;

-- Dumped table `transaction_states` with 18 row(s)
--

--
-- Table structure for table `transfer_account_payments`
--

CREATE TABLE `transfer_account_payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `origin_id` int(10) unsigned DEFAULT 0 COMMENT 'id Cuenta de origen',
  `origin_type` text DEFAULT NULL COMMENT 'Modelo de origen',
  `destiny_id` int(10) unsigned DEFAULT 0 COMMENT 'id Cuenta de destino',
  `destiny_type` text DEFAULT NULL COMMENT 'Modelo de destino',
  `amount` decimal(9,2) DEFAULT 0.00 COMMENT 'Monto a transferir',
  `date_of_movement` datetime DEFAULT NULL COMMENT 'Fecha de movimiento',
  `user_id` int(10) unsigned DEFAULT 0 COMMENT 'Usuario que realiza el movimiento',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transfer_account_payments`
--

SET autocommit=0;
COMMIT;

-- Dumped table `transfer_account_payments` with 0 row(s)
--

--
-- Table structure for table `transports`
--

CREATE TABLE `transports` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `plate_number` varchar(50) NOT NULL,
  `model` varchar(255) NOT NULL,
  `brand` varchar(255) NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transports`
--

SET autocommit=0;
COMMIT;

-- Dumped table `transports` with 0 row(s)
--

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

SET autocommit=0;
COMMIT;

-- Dumped table `users` with 4 row(s)
--

--
-- Table structure for table `user_commissions`
--

CREATE TABLE `user_commissions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `amount` decimal(8,2) NOT NULL,
  `type` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_commissions_user_id_foreign` (`user_id`),
  CONSTRAINT `user_commissions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_commissions`
--

SET autocommit=0;
COMMIT;

-- Dumped table `user_commissions` with 0 row(s)
--

--
-- Table structure for table `user_default_document_types`
--

CREATE TABLE `user_default_document_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `document_type_id` varchar(255) NOT NULL,
  `series_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_default_document_types_user_id_foreign` (`user_id`),
  KEY `user_default_document_types_document_type_id_foreign` (`document_type_id`),
  KEY `user_default_document_types_series_id_foreign` (`series_id`),
  CONSTRAINT `user_default_document_types_document_type_id_foreign` FOREIGN KEY (`document_type_id`) REFERENCES `cat_document_types` (`id`),
  CONSTRAINT `user_default_document_types_series_id_foreign` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`),
  CONSTRAINT `user_default_document_types_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_default_document_types`
--

SET autocommit=0;
COMMIT;

-- Dumped table `user_default_document_types` with 0 row(s)
--

--
-- Table structure for table `user_mobile_establishments`
--

CREATE TABLE `user_mobile_establishments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ume_user_establishment_unique` (`user_id`,`establishment_id`),
  KEY `user_mobile_establishments_establishment_id_foreign` (`establishment_id`),
  CONSTRAINT `user_mobile_establishments_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_mobile_establishments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_mobile_establishments`
--

SET autocommit=0;
COMMIT;

-- Dumped table `user_mobile_establishments` with 0 row(s)
--

--
-- Table structure for table `user_rel_suscription_plans`
--

CREATE TABLE `user_rel_suscription_plans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT 0 COMMENT 'Relacion con usuario',
  `suscription_plan_id` int(10) unsigned DEFAULT 0 COMMENT 'Relacion con planes de suscripcion',
  `cat_period_id` int(10) unsigned DEFAULT 0 COMMENT 'Relacion con el periodo de tiempo',
  `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'Pega los items relacionados a modo de standar' CHECK (json_valid(`items`)),
  `editable` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Si ya ha sido adquirido, no puede ser modificado',
  `deletable` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Si ya ha sido adquirido, no puede ser borrado',
  `start_date` date DEFAULT NULL COMMENT 'Fecha de inicio',
  `sale_notes` text DEFAULT NULL,
  `documents` text DEFAULT NULL,
  `dates_of_documents` text DEFAULT NULL,
  `automatic_date_of_issue` date DEFAULT NULL,
  `customer_id` int(10) unsigned DEFAULT 0,
  `customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`customer`)),
  `parent_customer_id` int(10) unsigned DEFAULT 0,
  `parent_customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`parent_customer`)),
  `children_customer_id` int(10) unsigned DEFAULT 0,
  `children_customer` longtext DEFAULT NULL,
  `quantity_period` int(10) unsigned DEFAULT 0,
  `apply_concurrency` int(10) unsigned NOT NULL DEFAULT 0,
  `enabled_concurrency` int(10) unsigned NOT NULL DEFAULT 1 COMMENT 'Se pasará a nota de ventas como activo',
  `currency_type_id` varchar(255) DEFAULT NULL,
  `payment_method_type_id` varchar(255) DEFAULT NULL,
  `exchange_rate_sale` float DEFAULT 0,
  `total_prepayment` float DEFAULT 0,
  `total_charge` float DEFAULT 0,
  `total_discount` float DEFAULT 0,
  `total_exportation` float DEFAULT 0,
  `total_free` float DEFAULT 0,
  `total_taxed` float DEFAULT 0,
  `total_unaffected` float DEFAULT 0,
  `total_exonerated` float DEFAULT 0,
  `total_igv` float DEFAULT 0,
  `total_igv_free` float DEFAULT 0,
  `total_base_isc` float DEFAULT 0,
  `total_isc` float DEFAULT 0,
  `total_base_other_taxes` float DEFAULT 0,
  `total_other_taxes` float DEFAULT 0,
  `total_taxes` float DEFAULT 0,
  `total_value` float DEFAULT 0,
  `total` decimal(12,2) DEFAULT 0.00,
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `attributes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attributes`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `prepayments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`prepayments`)),
  `related` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`related`)),
  `perception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`perception`)),
  `detraction` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`detraction`)),
  `legends` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`legends`)),
  `terms_condition` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `grade` text DEFAULT NULL COMMENT 'Grado designado - utilizado en matricula',
  `section` text DEFAULT NULL COMMENT 'Seccion designado - utilizado en matricula',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_rel_suscription_plans`
--

SET autocommit=0;
COMMIT;

-- Dumped table `user_rel_suscription_plans` with 0 row(s)
--

--
-- Table structure for table `vet_appointments`
--

CREATE TABLE `vet_appointments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `owner_id` int(10) unsigned DEFAULT NULL,
  `veterinarian_id` int(10) unsigned DEFAULT NULL,
  `establishment_id` int(10) unsigned DEFAULT NULL,
  `scheduled_at` datetime NOT NULL,
  `duration_minutes` smallint(5) unsigned NOT NULL DEFAULT 30,
  `title` varchar(255) DEFAULT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'scheduled',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_appointments_veterinarian_id_scheduled_at_index` (`veterinarian_id`,`scheduled_at`),
  KEY `vet_appointments_pet_id_index` (`pet_id`),
  KEY `vet_appointments_owner_id_index` (`owner_id`),
  KEY `vet_appointments_veterinarian_id_index` (`veterinarian_id`),
  KEY `vet_appointments_scheduled_at_index` (`scheduled_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_appointments`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_appointments` with 0 row(s)
--

--
-- Table structure for table `vet_boardings`
--

CREATE TABLE `vet_boardings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` int(10) unsigned NOT NULL,
  `owner_id` int(10) unsigned DEFAULT NULL,
  `establishment_id` int(10) unsigned DEFAULT NULL,
  `check_in` date NOT NULL,
  `check_out` date DEFAULT NULL,
  `kennel` varchar(255) DEFAULT NULL,
  `daily_rate` decimal(10,2) NOT NULL DEFAULT 0.00,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `notes` text DEFAULT NULL,
  `document_id` int(10) unsigned DEFAULT NULL,
  `sale_note_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_boardings_status_check_in_index` (`status`,`check_in`),
  KEY `vet_boardings_pet_id_index` (`pet_id`),
  KEY `vet_boardings_owner_id_index` (`owner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_boardings`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_boardings` with 0 row(s)
--

--
-- Table structure for table `vet_breeds`
--

CREATE TABLE `vet_breeds` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `species_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(255) 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 `vet_breeds_species_id_index` (`species_id`),
  KEY `vet_breeds_active_index` (`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_breeds`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_breeds` with 0 row(s)
--

--
-- Table structure for table `vet_consultations`
--

CREATE TABLE `vet_consultations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` int(10) unsigned NOT NULL,
  `veterinarian_id` int(10) unsigned DEFAULT NULL,
  `establishment_id` int(10) unsigned DEFAULT NULL,
  `consultation_date` date NOT NULL,
  `type` varchar(20) NOT NULL DEFAULT 'consulta',
  `reason` varchar(255) DEFAULT NULL,
  `weight` decimal(8,2) DEFAULT NULL,
  `temperature` decimal(5,2) DEFAULT NULL,
  `heart_rate` varchar(20) DEFAULT NULL,
  `resp_rate` varchar(20) DEFAULT NULL,
  `general_state` varchar(191) DEFAULT NULL,
  `diarrhea` tinyint(1) DEFAULT NULL,
  `diarrhea_note` varchar(191) DEFAULT NULL,
  `vaccination_status` varchar(20) DEFAULT NULL,
  `deworming_status` varchar(20) DEFAULT NULL,
  `anamnesis` text DEFAULT NULL,
  `diagnosis_text` text DEFAULT NULL,
  `prescription_cie10_id` int(10) unsigned DEFAULT NULL,
  `treatment` text DEFAULT NULL,
  `observations` text DEFAULT NULL,
  `document_id` int(10) unsigned DEFAULT NULL,
  `sale_note_id` int(10) unsigned DEFAULT NULL,
  `appointment_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_consultations_pet_id_consultation_date_index` (`pet_id`,`consultation_date`),
  KEY `vet_consultations_pet_id_index` (`pet_id`),
  KEY `vet_consultations_veterinarian_id_index` (`veterinarian_id`),
  KEY `vet_consultations_prescription_cie10_id_index` (`prescription_cie10_id`),
  KEY `vet_consultations_appointment_id_index` (`appointment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_consultations`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_consultations` with 0 row(s)
--

--
-- Table structure for table `vet_consultation_attachments`
--

CREATE TABLE `vet_consultation_attachments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `consultation_id` int(10) unsigned NOT NULL,
  `name` varchar(191) NOT NULL,
  `path` varchar(255) NOT NULL,
  `mime` varchar(100) DEFAULT NULL,
  `kind` varchar(20) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_consultation_attachments_consultation_id_index` (`consultation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_consultation_attachments`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_consultation_attachments` with 0 row(s)
--

--
-- Table structure for table `vet_consultation_procedures`
--

CREATE TABLE `vet_consultation_procedures` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `consultation_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned NOT NULL,
  `name` varchar(191) NOT NULL,
  `quantity` decimal(12,2) NOT NULL DEFAULT 1.00,
  `unit_price` decimal(12,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_consultation_procedures_consultation_id_index` (`consultation_id`),
  KEY `vet_consultation_procedures_item_id_index` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_consultation_procedures`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_consultation_procedures` with 0 row(s)
--

--
-- Table structure for table `vet_memberships`
--

CREATE TABLE `vet_memberships` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `owner_id` int(10) unsigned NOT NULL,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `plan_name` varchar(255) NOT NULL,
  `price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `period` varchar(255) NOT NULL DEFAULT 'monthly',
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `status` varchar(255) NOT NULL DEFAULT 'active',
  `benefits` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `document_id` int(10) unsigned DEFAULT NULL,
  `sale_note_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_memberships_status_end_date_index` (`status`,`end_date`),
  KEY `vet_memberships_owner_id_index` (`owner_id`),
  KEY `vet_memberships_pet_id_index` (`pet_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_memberships`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_memberships` with 0 row(s)
--

--
-- Table structure for table `vet_notification_log`
--

CREATE TABLE `vet_notification_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` int(10) unsigned DEFAULT NULL,
  `owner_id` int(10) unsigned DEFAULT NULL,
  `channel` varchar(20) NOT NULL,
  `destination` varchar(191) NOT NULL,
  `subject` varchar(191) DEFAULT NULL,
  `body` text NOT NULL,
  `ref_type` varchar(40) DEFAULT NULL,
  `ref_id` int(10) unsigned DEFAULT NULL,
  `status` varchar(20) NOT NULL,
  `error` text DEFAULT NULL,
  `sent_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_notification_log_ref_type_ref_id_index` (`ref_type`,`ref_id`),
  KEY `vet_notification_log_status_index` (`status`),
  KEY `vet_notification_log_pet_id_index` (`pet_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_notification_log`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_notification_log` with 0 row(s)
--

--
-- Table structure for table `vet_pets`
--

CREATE TABLE `vet_pets` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `owner_id` int(10) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `species` varchar(60) DEFAULT NULL,
  `species_id` int(10) unsigned DEFAULT NULL,
  `breed` varchar(120) DEFAULT NULL,
  `breed_id` int(10) unsigned DEFAULT NULL,
  `sex` varchar(20) DEFAULT NULL,
  `birthdate` date DEFAULT NULL,
  `weight` decimal(8,2) DEFAULT NULL,
  `color` varchar(60) DEFAULT NULL,
  `microchip` varchar(60) DEFAULT NULL,
  `sterilized` tinyint(1) DEFAULT NULL,
  `photo` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `allergies` text DEFAULT NULL,
  `chronic_conditions` text 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 `vet_pets_owner_id_active_index` (`owner_id`,`active`),
  KEY `vet_pets_owner_id_index` (`owner_id`),
  KEY `vet_pets_species_id_index` (`species_id`),
  KEY `vet_pets_breed_id_index` (`breed_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_pets`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_pets` with 0 row(s)
--

--
-- Table structure for table `vet_prescriptions`
--

CREATE TABLE `vet_prescriptions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` int(10) unsigned NOT NULL,
  `owner_id` int(10) unsigned DEFAULT NULL,
  `veterinarian_id` int(10) unsigned DEFAULT NULL,
  `consultation_id` int(10) unsigned DEFAULT NULL,
  `prescription_date` date NOT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_prescriptions_pet_id_prescription_date_index` (`pet_id`,`prescription_date`),
  KEY `vet_prescriptions_pet_id_index` (`pet_id`),
  KEY `vet_prescriptions_owner_id_index` (`owner_id`),
  KEY `vet_prescriptions_veterinarian_id_index` (`veterinarian_id`),
  KEY `vet_prescriptions_consultation_id_index` (`consultation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_prescriptions`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_prescriptions` with 0 row(s)
--

--
-- Table structure for table `vet_prescription_items`
--

CREATE TABLE `vet_prescription_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `prescription_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `dosage` varchar(255) DEFAULT NULL,
  `route` varchar(255) DEFAULT NULL,
  `frequency` varchar(255) DEFAULT NULL,
  `duration` varchar(255) DEFAULT NULL,
  `instructions` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_prescription_items_prescription_id_index` (`prescription_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_prescription_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_prescription_items` with 0 row(s)
--

--
-- Table structure for table `vet_quotes`
--

CREATE TABLE `vet_quotes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` int(10) unsigned NOT NULL,
  `owner_id` int(10) unsigned DEFAULT NULL,
  `veterinarian_id` int(10) unsigned DEFAULT NULL,
  `quote_date` date NOT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'draft',
  `notes` text DEFAULT NULL,
  `total` decimal(12,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_quotes_pet_id_quote_date_index` (`pet_id`,`quote_date`),
  KEY `vet_quotes_pet_id_index` (`pet_id`),
  KEY `vet_quotes_owner_id_index` (`owner_id`),
  KEY `vet_quotes_veterinarian_id_index` (`veterinarian_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_quotes`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_quotes` with 0 row(s)
--

--
-- Table structure for table `vet_quote_items`
--

CREATE TABLE `vet_quote_items` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `quote_id` int(10) unsigned NOT NULL,
  `item_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `quantity` decimal(12,2) NOT NULL DEFAULT 1.00,
  `unit_price` 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 `vet_quote_items_quote_id_index` (`quote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_quote_items`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_quote_items` with 0 row(s)
--

--
-- Table structure for table `vet_species`
--

CREATE TABLE `vet_species` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) 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 `vet_species_active_index` (`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_species`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_species` with 0 row(s)
--

--
-- Table structure for table `vet_vaccination_records`
--

CREATE TABLE `vet_vaccination_records` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pet_id` int(10) unsigned NOT NULL,
  `type` varchar(20) NOT NULL DEFAULT 'vaccine',
  `item_id` int(10) unsigned DEFAULT NULL,
  `vaccine_name` varchar(255) NOT NULL,
  `applied_date` date DEFAULT NULL,
  `lot_code` varchar(60) DEFAULT NULL,
  `next_dose_date` date DEFAULT NULL,
  `veterinarian_id` int(10) unsigned DEFAULT NULL,
  `document_id` int(10) unsigned DEFAULT NULL,
  `sale_note_id` int(10) unsigned DEFAULT NULL,
  `observations` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_vaccination_records_pet_id_applied_date_index` (`pet_id`,`applied_date`),
  KEY `vet_vaccination_records_pet_id_index` (`pet_id`),
  KEY `vet_vaccination_records_item_id_index` (`item_id`),
  KEY `vet_vaccination_records_next_dose_date_index` (`next_dose_date`),
  KEY `vet_vaccination_records_veterinarian_id_index` (`veterinarian_id`),
  KEY `vet_vaccination_records_type_index` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_vaccination_records`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_vaccination_records` with 0 row(s)
--

--
-- Table structure for table `vet_vaccine_protocols`
--

CREATE TABLE `vet_vaccine_protocols` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `species_id` int(10) unsigned NOT NULL,
  `type` varchar(20) NOT NULL DEFAULT 'vaccine',
  `dose_name` varchar(191) NOT NULL,
  `offset_value` int(11) NOT NULL,
  `offset_unit` varchar(10) NOT NULL DEFAULT 'weeks',
  `offset_from` varchar(10) NOT NULL DEFAULT 'birth',
  `sort_order` int(11) 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 `vet_vaccine_protocols_species_id_sort_order_index` (`species_id`,`sort_order`),
  KEY `vet_vaccine_protocols_species_id_index` (`species_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_vaccine_protocols`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_vaccine_protocols` with 0 row(s)
--

--
-- Table structure for table `vet_veterinarians`
--

CREATE TABLE `vet_veterinarians` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `cmp` varchar(255) DEFAULT NULL,
  `specialty` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `work_days` varchar(20) DEFAULT NULL,
  `work_start` time DEFAULT NULL,
  `work_end` time DEFAULT NULL,
  `slot_minutes` int(10) unsigned DEFAULT 30,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vet_veterinarians_active_index` (`active`),
  KEY `vet_veterinarians_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vet_veterinarians`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vet_veterinarians` with 0 row(s)
--

--
-- Table structure for table `vital_signs_parameters`
--

CREATE TABLE `vital_signs_parameters` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `specialty_id` int(10) unsigned NOT NULL,
  `paramter_name` varchar(255) NOT NULL,
  `unit` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `is_optional` tinyint(1) DEFAULT NULL,
  `order` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vsp_specialty_id` (`specialty_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vital_signs_parameters`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vital_signs_parameters` with 0 row(s)
--

--
-- Table structure for table `vital_signs_values`
--

CREATE TABLE `vital_signs_values` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `appointment_id` int(10) unsigned NOT NULL,
  `vital_sign_id` int(10) unsigned NOT NULL,
  `value` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `vsv_appointment_id` (`appointment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `vital_signs_values`
--

SET autocommit=0;
COMMIT;

-- Dumped table `vital_signs_values` with 0 row(s)
--

--
-- Table structure for table `voided`
--

CREATE TABLE `voided` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `external_id` char(36) NOT NULL,
  `soap_type_id` char(2) NOT NULL,
  `state_type_id` char(2) NOT NULL,
  `ubl_version` varchar(255) NOT NULL,
  `date_of_issue` date NOT NULL,
  `date_of_reference` date NOT NULL,
  `identifier` varchar(255) NOT NULL,
  `filename` varchar(255) NOT NULL,
  `ticket` varchar(255) DEFAULT NULL,
  `has_ticket` tinyint(1) NOT NULL DEFAULT 0,
  `has_cdr` tinyint(1) NOT NULL DEFAULT 0,
  `soap_shipping_response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`soap_shipping_response`)),
  `send_to_pse` tinyint(1) NOT NULL DEFAULT 0,
  `response_signature_pse` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_signature_pse`)),
  `response_send_cdr_pse` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_send_cdr_pse`)),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `voided_user_id_foreign` (`user_id`),
  KEY `voided_soap_type_id_foreign` (`soap_type_id`),
  KEY `voided_state_type_id_foreign` (`state_type_id`),
  CONSTRAINT `voided_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `voided_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `voided_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `voided`
--

SET autocommit=0;
COMMIT;

-- Dumped table `voided` with 0 row(s)
--

--
-- Table structure for table `voided_documents`
--

CREATE TABLE `voided_documents` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `voided_id` int(10) unsigned NOT NULL,
  `document_id` int(10) unsigned NOT NULL,
  `description` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `voided_documents_voided_id_foreign` (`voided_id`),
  KEY `voided_documents_document_id_foreign` (`document_id`),
  CONSTRAINT `voided_documents_document_id_foreign` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`),
  CONSTRAINT `voided_documents_voided_id_foreign` FOREIGN KEY (`voided_id`) REFERENCES `voided` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `voided_documents`
--

SET autocommit=0;
COMMIT;

-- Dumped table `voided_documents` with 0 row(s)
--

--
-- Table structure for table `waiters`
--

CREATE TABLE `waiters` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `waiters`
--

SET autocommit=0;
COMMIT;

-- Dumped table `waiters` with 0 row(s)
--

--
-- Table structure for table `warehouses`
--

CREATE TABLE `warehouses` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `establishment_id` int(10) unsigned NOT NULL,
  `description` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `warehouses_establishment_id_foreign` (`establishment_id`),
  CONSTRAINT `warehouses_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `warehouses`
--

SET autocommit=0;
INSERT INTO `warehouses` VALUES (1,1,'Almacén Oficina Principal','2026-07-02 11:24:41','2026-07-02 11:24:41');
COMMIT;

-- Dumped table `warehouses` with 1 row(s)
--

--
-- Table structure for table `web_platforms`
--

CREATE TABLE `web_platforms` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `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;

--
-- Dumping data for table `web_platforms`
--

SET autocommit=0;
INSERT INTO `web_platforms` VALUES (1,'Saga Falabella',NULL,NULL),(2,'Mercado Libre ',NULL,NULL),(3,'Linio',NULL,NULL);
COMMIT;

-- Dumped table `web_platforms` with 3 row(s)
--

--
-- Table structure for table `workers`
--

CREATE TABLE `workers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `identity_document_type_id` varchar(255) NOT NULL,
  `number` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `birth_date` date NOT NULL,
  `admission_date` date NOT NULL,
  `occupation` varchar(255) NOT NULL,
  `address` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `telephone` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `workers_identity_document_type_id_foreign` (`identity_document_type_id`),
  KEY `workers_number_index` (`number`),
  KEY `workers_name_index` (`name`),
  CONSTRAINT `workers_identity_document_type_id_foreign` FOREIGN KEY (`identity_document_type_id`) REFERENCES `cat_identity_document_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `workers`
--

SET autocommit=0;
COMMIT;

-- Dumped table `workers` with 0 row(s)
--

--
-- Table structure for table `zones`
--

CREATE TABLE `zones` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `zones`
--

SET autocommit=0;
COMMIT;

-- Dumped table `zones` with 0 row(s)
--


