COMMIT;

-- Dumped table `system_activity_logs` with 755 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'),('failed','Error de inicio de sesión'),('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)');
COMMIT;

-- Dumped table `system_activity_log_types` with 14 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`)
) 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` double(12,4) DEFAULT 0.0000 COMMENT 'Cantidad de item usado',
  `unit_value` double(16,6) DEFAULT 0.000000 COMMENT 'unit_value',
  `affectation_igv_type_id` longtext DEFAULT NULL COMMENT 'Tipo de afectacion dde igv. cat_affectation_igv_types',
  `total_base_igv` double(12,2) DEFAULT 0.00 COMMENT 'Monto base del IGV',
  `percentage_igv` double(12,2) DEFAULT 0.00,
  `total_igv` double(12,2) DEFAULT 0.00,
  `system_isc_type_id` longtext DEFAULT NULL,
  `total_base_isc` double(12,2) DEFAULT 0.00,
  `percentage_isc` double(12,2) DEFAULT 0.00,
  `total_isc` double(12,2) DEFAULT 0.00,
  `total_base_other_taxes` double(12,2) DEFAULT 0.00,
  `percentage_other_taxes` double(12,2) DEFAULT 0.00,
  `total_other_taxes` double(12,2) DEFAULT 0.00,
  `total_plastic_bag_taxes` double(6,2) DEFAULT 0.00,
  `total_taxes` double(12,2) DEFAULT 0.00,
  `price_type_id` longtext DEFAULT NULL,
  `unit_price` double(16,6) DEFAULT 0.000000,
  `total_value` double(12,2) DEFAULT 0.00,
  `total_charge` double(12,2) DEFAULT 0.00,
  `total_discount` double(12,2) DEFAULT 0.00,
  `total` double(12,2) DEFAULT 0.00,
  `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`)
) 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`)
) 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`)
) 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`)
) 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 5 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`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

SET autocommit=0;
INSERT INTO `user_commissions` VALUES (1,2,10.00,'percentage','2024-11-12 19:59:03','2024-11-12 19:59:03');
COMMIT;

-- Dumped table `user_commissions` with 1 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`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

SET autocommit=0;
INSERT INTO `user_default_document_types` VALUES (17,2,'80',10,'2024-11-18 17:06:17','2024-11-18 17:06:17'),(18,2,'01',1,'2024-11-18 17:06:17','2024-11-18 17:06:17'),(19,2,'03',2,'2024-11-18 17:06:17','2024-11-18 17:06:17'),(50,4,'80',10,'2025-01-13 09:54:05','2025-01-13 09:54:05'),(51,4,'03',2,'2025-01-13 09:54:05','2025-01-13 09:54:05'),(52,4,'01',1,'2025-01-13 09:54:05','2025-01-13 09:54:05'),(53,3,'01',1,'2025-02-07 09:00:25','2025-02-07 09:00:25'),(54,3,'03',2,'2025-02-07 09:00:25','2025-02-07 09:00:25'),(55,3,'80',10,'2025-02-07 09:00:25','2025-02-07 09:00:25');
COMMIT;

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

--
-- Table structure for table `user_rel_subscription_plans`
--

CREATE TABLE `user_rel_subscription_plans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT 0 COMMENT 'Relacion con usuario',
  `subscription_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` double(13,3) DEFAULT 0.000,
  `total_prepayment` double(12,2) DEFAULT 0.00,
  `total_charge` double(12,2) DEFAULT 0.00,
  `total_discount` double(12,2) DEFAULT 0.00,
  `total_exportation` double(12,2) DEFAULT 0.00,
  `total_free` double(12,2) DEFAULT 0.00,
  `total_taxed` double(12,2) DEFAULT 0.00,
  `total_unaffected` double(12,2) DEFAULT 0.00,
  `total_exonerated` double(12,2) DEFAULT 0.00,
  `total_igv` double(12,2) DEFAULT 0.00,
  `total_igv_free` double(12,2) DEFAULT 0.00,
  `total_base_isc` double(12,2) DEFAULT 0.00,
  `total_isc` double(12,2) DEFAULT 0.00,
  `total_base_other_taxes` double(12,2) DEFAULT 0.00,
  `total_other_taxes` double(12,2) DEFAULT 0.00,
  `total_taxes` double(12,2) DEFAULT 0.00,
  `total_value` double(12,2) DEFAULT 0.00,
  `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_subscription_plans`
--

SET autocommit=0;
COMMIT;

-- Dumped table `user_rel_subscription_plans` 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`)
) 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`)
) 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`)
) ENGINE=InnoDB AUTO_INCREMENT=3 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','2024-11-10 15:18:50','2024-11-10 15:18:50');
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`)
) 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 AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

SET autocommit=0;
INSERT INTO `zones` VALUES (1,'BAMBAMARCA'),(2,'CHOTA');
COMMIT;

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


