-- Active: 1754444322322@@dev.io@3306@nucleo_base
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 15-12-2025 a las 22:19:54
-- Versión del servidor: 8.0.44-0ubuntu0.24.04.2
-- Versión de PHP: 8.3.28

START TRANSACTION;



--
-- Base de datos: `nucleo_base`
----------------------------------------------

--
-- Estructura de tabla para la tabla `ai_categories`
--

CREATE TABLE `ai_categories` (
  `ai_cat_id` int NOT NULL,
  `ai_cat_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ai_cat_ent_id` int NOT NULL,
  `ai_cat_state` int DEFAULT '0' COMMENT '0=active, 1=archived, 2=deleted',
  `ai_cat_create_user_id` int DEFAULT NULL COMMENT 'Usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `ai_categories`
--

INSERT INTO `ai_categories` (`ai_cat_id`, `ai_cat_name`, `ai_cat_ent_id`, `ai_cat_state`, `ai_cat_create_user_id`) VALUES
(1, 'support', 1, 0, NULL),
(2, 'sales', 1, 0, NULL),
(3, 'inventory', 1, 0, NULL),
(4, 'other', 1, 0, NULL);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `ai_categorys`
--

CREATE TABLE `ai_categorys` (
  `ai_cat_id` int NOT NULL,
  `ai_cat_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ai_cat_ent_id` int NOT NULL,
  `ai_cat_state` int DEFAULT '0' COMMENT '0=active, 1=archived, 2=deleted',
  `ai_cat_create_user_id` int DEFAULT NULL COMMENT 'Usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `ai_keys`
--

CREATE TABLE `ai_keys` (
  `ai_key_id` int NOT NULL,
  `ai_key_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ai_key_value` varbinary(255) NOT NULL,
  `ai_key_provider` enum('OpenAI','Azure','Google','Other') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'OpenAI',
  `ai_key_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ai_key_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ai_key_ent_id` int NOT NULL,
  `ai_key_state` int DEFAULT '0' COMMENT '0=active, 1=archived, 2=deleted',
  `ai_key_create_user_id` int DEFAULT NULL COMMENT 'Usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `ai_logs`
--

CREATE TABLE `ai_logs` (
  `ai_log_id` int NOT NULL,
  `ai_log_user_id` int DEFAULT NULL,
  `ai_log_prompt_id` int NOT NULL,
  `ai_log_response_id` int NOT NULL,
  `ai_log_execution_time` float DEFAULT NULL,
  `ai_log_status` enum('success','error','pending') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'success',
  `ai_log_error_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `ai_log_request_metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `ai_log_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ai_log_ent_id` int NOT NULL,
  `ai_log_state` int DEFAULT '0' COMMENT '0=active, 1=archived, 2=deleted'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `ai_module_relations`
--

CREATE TABLE `ai_module_relations` (
  `ai_mod_rel_id` int NOT NULL,
  `ai_mod_rel_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ai_mod_rel_feature` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ai_mod_rel_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ai_mod_rel_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ai_mod_rel_mod_id` int NOT NULL,
  `ai_mod_rel_ent_id` int NOT NULL,
  `ai_mod_rel_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `ai_mod_rel_state` int DEFAULT '0' COMMENT '0=active, 1=archived, 2=deleted',
  `ai_mod_rel_create_user_id` int DEFAULT NULL COMMENT 'Usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `ai_prompts`
--

CREATE TABLE `ai_prompts` (
  `ai_prt_id` int NOT NULL,
  `ai_prt_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ai_prt_cat_id` int NOT NULL,
  `ai_prt_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ai_prt_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ai_prt_ent_id` int NOT NULL,
  `ai_prt_state` int DEFAULT '0' COMMENT '0=active, 1=archived, 2=deleted',
  `ai_prt_create_user_id` int DEFAULT NULL COMMENT 'Usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `ai_prompts`
--

INSERT INTO `ai_prompts` (`ai_prt_id`, `ai_prt_text`, `ai_prt_cat_id`, `ai_prt_created_at`, `ai_prt_updated_at`, `ai_prt_ent_id`, `ai_prt_state`, `ai_prt_create_user_id`) VALUES
(1, 'Actúa como un escritor de un periódico líder en periodismo digital, con un estilo similar al de Jorge Ramos (México). Reescribe el siguiente titular con un enfoque atractivo y efectivo para aumentar el tráfico y la interacción en nuestro sitio web.\n\nRequisitos:\n	•	Mantén el tono profesional, confiable y riguroso de un medio de noticias de primer nivel.\n	•	Crea títulos con ganchos llamativos que despierten curiosidad, sin perder precisión ni caer en la exageración.\n	•	Adapta el lenguaje para un público digital, asegurando claridad, rapidez e interés visual.\n	•	Destaca la relevancia de la noticia y su impacto en la audiencia, sin descontextualizar la información.\n	•	Asegura que la llamada a la acción motive al usuario a hacer clic e interactuar.\n\nTitular original: {{_TITLE}}\n\nGenera 5 opciones que cumplan con estos criterios, válido con la siguiente estructura: \"{\"respuesta 1\",\"respuesta 2\",\"respuesta 3\",\"respuesta 4\",\"respuesta 5\"}\"', 0, '2025-03-20 00:13:51', '2025-03-20 21:06:16', 1, 1, 1),
(2, 'Actúa como un periodista de un medio digital de primer nivel, con un estilo similar al de Jorge Ramos (México). Resume la siguiente nota de manera atractiva y efectiva para aumentar el tráfico y la interacción en nuestro sitio web.\n\nRequisitos:\n•Tono profesional y riguroso, asegurando la confiabilidad del medio.\n•Resumen conciso y llamativo, sin perder precisión ni contexto.\n•Lenguaje adaptado para el público digital, asegurando claridad e impacto.\n•Enfoque en la relevancia de la noticia, destacando su importancia para la audiencia.\n•Mantener el interés del lector, asegurando que quiera seguir explorando la información.\n\nTitulo original: {{_TITLE}}\nResumen original: {{_SUMMARY}}\n\nGenera 3 opciones de resumen que cumplan con estos criterios, devuélveme un JSON válido con la siguiente estructura:\n{\"respuesta 1\",\"respuesta 2\",\"respuesta 3\"}', 0, '2025-03-20 16:41:24', '2025-03-20 21:05:48', 1, 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `ai_responses`
--

CREATE TABLE `ai_responses` (
  `ai_rsp_id` int NOT NULL,
  `ai_rsp_prompt_id` int NOT NULL,
  `ai_rsp_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ai_rsp_model_used` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'GPT-4',
  `ai_rsp_confidence_score` decimal(5,2) DEFAULT NULL,
  `ai_rsp_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ai_rsp_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ai_rsp_ent_id` int NOT NULL,
  `ai_rsp_state` int DEFAULT '0' COMMENT '0=active, 1=archived, 2=deleted',
  `ai_rsp_create_user_id` int DEFAULT NULL COMMENT 'Usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Disparadores `ai_responses`
--
DELIMITER $$
CREATE TRIGGER `ai_responses_delete` AFTER DELETE ON `ai_responses` FOR EACH ROW BEGIN
    INSERT INTO ai_responses_history
    SELECT OLD.*, 'DELETE', NOW();
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `ai_responses_insert` AFTER INSERT ON `ai_responses` FOR EACH ROW BEGIN
    INSERT INTO ai_responses_history
    SELECT NEW.*, 'INSERT', NOW();
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `ai_responses_update` AFTER UPDATE ON `ai_responses` FOR EACH ROW BEGIN
    INSERT INTO ai_responses_history
    SELECT NEW.*, 'UPDATE', NOW();
END
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `ai_responses_history`
--

CREATE TABLE `ai_responses_history` (
  `ai_rsp_id` int NOT NULL,
  `ai_rsp_prompt_id` int NOT NULL,
  `ai_rsp_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ai_rsp_model_used` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'GPT-4',
  `ai_rsp_confidence_score` decimal(5,2) DEFAULT NULL,
  `ai_rsp_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ai_rsp_updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `ai_rsp_ent_id` int NOT NULL,
  `ai_rsp_state` int DEFAULT '0',
  `operation_type` enum('INSERT','UPDATE','DELETE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `operation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `blocks`
--

CREATE TABLE `blocks` (
  `block_id` int NOT NULL,
  `block_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `block_class` varchar(44) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `block_order` int DEFAULT NULL,
  `block_parent_id` int NOT NULL,
  `block_ent_id` int NOT NULL DEFAULT '0',
  `block_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `blocks`
--

INSERT INTO `blocks` (`block_id`, `block_name`, `block_class`, `block_order`, `block_parent_id`, `block_ent_id`, `block_state`) VALUES
(1, 'Header', 'headerPage', 1, 0, 1, 1),
(2, 'Body', 'bodyPage', 2, 0, 1, 1),
(3, 'Footer', 'footerPage', 3, 0, 1, 1),
(4, 'Aside', 'asidePage', 2, 2, 1, 0),
(9, 'Aside Fluid', 'asideFluid', 1, 4, 1, 0);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `categorys`
--

CREATE TABLE `categorys` (
  `cat_id` int NOT NULL,
  `cat_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cat_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cat_pathurl` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cat_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `cat_order` int DEFAULT NULL,
  `cat_parent_id` int DEFAULT '0',
  `cat_related` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cat_icon` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cat_color` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cat_img` int DEFAULT NULL,
  `cat_banner` int DEFAULT NULL,
  `cat_ent_id` int DEFAULT NULL,
  `cat_configpath` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cat_cls` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cat_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `cat_state_collapse` int NOT NULL DEFAULT '1',
  `cat_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `categorys`
--

INSERT INTO `categorys` (`cat_id`, `cat_name`, `cat_path`, `cat_pathurl`, `cat_description`, `cat_order`, `cat_parent_id`, `cat_related`, `cat_icon`, `cat_color`, `cat_img`, `cat_banner`, `cat_ent_id`, `cat_configpath`, `cat_cls`, `cat_json`, `cat_state_collapse`, `cat_state`) VALUES
(1, 'Home', 'home', 'home', '', 0, 0, '', '', '', 0, 0, 1, '', '', '', 1, 1),
(3, 'Contact', 'contact', 'contact', 'Contact category', 4, 0, '', '', '', 0, 0, 1, '', '', '', 1, 1),
(2, 'Productos', 'productos', 'productos', '', 1, 0, '', '', '', 0, 0, 1, '', '', '', 1, 1),
(4, 'Dormitorio', 'dormitorio', 'dormitorio', '', 1, 2, '', '', '', 0, 0, 1, '', '', '', 1, 1),
(5, 'Cocina', 'cocina', 'cocina', '', 2, 2, '', '', '', 0, 0, 1, '', '', '', 1, 1),
(6, 'Oficina', 'oficina', 'oficina', '', 3, 2, '', '', '', 0, 0, 1, '', '', '', 1, 1),
(7, 'Tecnología', 'tecnologia', 'tecnologia', '', 4, 2, '', '', '', 0, 0, 1, '', '', '', 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `categorys_files`
--

CREATE TABLE `categorys_files` (
  `cat_file_file_id` int NOT NULL,
  `cat_file_cat_id` int NOT NULL,
  `cat_file_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `contents`
--

CREATE TABLE `contents` (
  `cont_id` int NOT NULL,
  `cont_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `cont_pathurl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `cont_summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `cont_tags` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cont_img` int DEFAULT NULL,
  `cont_body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `cont_author` int DEFAULT NULL,
  `cont_register_date` datetime DEFAULT NULL,
  `cont_user_id` int DEFAULT NULL COMMENT 'user register',
  `cont_notitle` int DEFAULT '0',
  `cont_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cont_btn_title` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cont_icon` varchar(21) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cont_target` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '_blank',
  `cont_cls` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'css class',
  `cont_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `cont_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `contents_categorys`
--

CREATE TABLE `contents_categorys` (
  `cont_cat_cont_id` int NOT NULL,
  `cont_cat_cat_id` int NOT NULL,
  `cont_cat_ent_id` int DEFAULT NULL,
  `cont_cat_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `contents_files`
--

CREATE TABLE `contents_files` (
  `cont_file_cont_id` int NOT NULL,
  `cont_file_file_id` int NOT NULL,
  `cont_file_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `cont_file_summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `cont_file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `cont_file_btn_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cont_file_icon` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cont_file_target` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '_blank',
  `cont_file_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `contents_pubs`
--

CREATE TABLE `contents_pubs` (
  `cont_pub_cont_id` int NOT NULL,
  `cont_pub_pub_id` int NOT NULL,
  `cont_pub_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `docs`
--

CREATE TABLE `docs` (
  `doc_id` int NOT NULL,
  `doc_file_id` int DEFAULT NULL,
  `doc_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `doc_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `doc_tags` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `doc_img` int NOT NULL DEFAULT '0' COMMENT 'customized',
  `doc_date` datetime DEFAULT NULL,
  `doc_register_date` datetime DEFAULT NULL,
  `doc_user_id` int NOT NULL DEFAULT '0',
  `doc_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `doc_ent_id` int DEFAULT NULL,
  `doc_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `docs_categorys`
--

CREATE TABLE `docs_categorys` (
  `doc_cat_doc_id` int NOT NULL,
  `doc_cat_cat_id` int NOT NULL,
  `doc_cat_order` int NOT NULL,
  `doc_cat_ent_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `files`
--

CREATE TABLE `files` (
  `file_id` int NOT NULL,
  `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `file_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `file_pathurl` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `file_embed` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `file_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `file_btn_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `file_target` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '_self',
  `file_ext` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `file_alt` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `file_filename_md5` binary(255) DEFAULT NULL,
  `file_datatime` datetime DEFAULT NULL,
  `file_ent_id` int DEFAULT NULL,
  `file_state` int DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `files`
--

INSERT INTO `files` (`file_id`, `file_name`, `file_description`, `file_pathurl`, `file_embed`, `file_title`, `file_btn_title`, `file_url`, `file_target`, `file_ext`, `file_alt`, `file_filename_md5`, `file_datatime`, `file_ent_id`, `file_state`) VALUES
(2, 'logo-wappcom_20251129_2333', '', 'files/sliders/logo-wappcom_20251129_2333.png', NULL, NULL, NULL, NULL, '_self', 'png', NULL, 0x[BLOB], '2025-11-29 23:33:02', 1, 1),
(3, 'link', '', 'files/sliders/link.png', NULL, NULL, NULL, NULL, '_self', 'png', NULL, 0x[BLOB], '2025-11-30 16:18:54', 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `forms`
--

CREATE TABLE `forms` (
  `form_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del formulario',
  `form_title` varchar(255) NOT NULL COMMENT 'Título del formulario',
  `form_slug` varchar(255) DEFAULT NULL COMMENT 'Slug/identificador legible',
  `form_description` text COMMENT 'Descripción del formulario',
  `form_settings` text COMMENT 'JSON/text con opciones: confirmation, notifications, redirect, etc',
  `form_notify_email` varchar(255) DEFAULT NULL COMMENT 'Email para notificaciones',
  `form_user_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Usuario creador',
  `form_ent_id` int UNSIGNED DEFAULT NULL COMMENT 'ID de la entidad',
  `form_site_id` int NOT NULL DEFAULT '1' COMMENT 'ID del sitio',
  `form_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `form_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización',
  `form_status` int DEFAULT '1' COMMENT 'Estado (1=activo, 0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Definición de Formularios (Maestro)';

--
-- Volcado de datos para la tabla `forms`
--

INSERT INTO `forms` (`form_id`, `form_title`, `form_slug`, `form_description`, `form_settings`, `form_notify_email`, `form_user_id`, `form_ent_id`, `form_site_id`, `form_created_at`, `form_updated_at`, `form_status`) VALUES
(1, 'Formulario de contacto', 'contacto', 'Formulario de contacto básico', NULL, NULL, NULL, 1, 1, '2025-12-09 19:12:13', '2025-12-09 19:12:13', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `forms_entries`
--

CREATE TABLE `forms_entries` (
  `form_entry_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del envío/entrada',
  `form_entry_form_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al formulario (form_id)',
  `form_entry_ent_id` int UNSIGNED DEFAULT NULL COMMENT 'ID de la entidad',
  `form_entry_site_id` int NOT NULL DEFAULT '1' COMMENT 'ID del sitio',
  `form_entry_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha del envío',
  `form_entry_ip` varchar(45) DEFAULT NULL COMMENT 'IP del remitente',
  `form_entry_user_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Usuario asociado (si aplica)',
  `form_entry_meta` text COMMENT 'Metadatos adicionales (JSON)',
  `form_entry_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `form_entry_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización',
  `form_entry_status` int DEFAULT '1' COMMENT 'Estado (1=activo,0=eliminado)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Entradas/Envios generados por los formularios';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `forms_fields`
--

CREATE TABLE `forms_fields` (
  `form_fld_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del campo',
  `form_fld_form_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al formulario (form_id)',
  `form_fld_ent_id` int UNSIGNED DEFAULT NULL COMMENT 'ID de la entidad',
  `form_fld_site_id` int NOT NULL DEFAULT '1' COMMENT 'ID del sitio',
  `form_fld_name` varchar(255) NOT NULL COMMENT 'Nombre interno del campo (ej: email)',
  `form_fld_label` varchar(255) DEFAULT NULL COMMENT 'Etiqueta visible para UI',
  `form_fld_type` varchar(50) DEFAULT 'text' COMMENT 'Tipo de campo (text, textarea, email, select, checkbox, file, etc)',
  `form_fld_options` text COMMENT 'Opciones para select/checkbox (JSON o CSV)',
  `form_fld_required` tinyint(1) DEFAULT '0' COMMENT '1=obligatorio,0=opcional',
  `form_fld_order` int DEFAULT '0' COMMENT 'Orden de visualización',
  `form_fld_placeholder` varchar(255) DEFAULT NULL COMMENT 'Placeholder para el input',
  `form_fld_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `form_fld_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización',
  `form_fld_status` int DEFAULT '1' COMMENT 'Estado del campo (1=activo,0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Campos pertenecientes a cada formulario';

--
-- Volcado de datos para la tabla `forms_fields`
--

INSERT INTO `forms_fields` (`form_fld_id`, `form_fld_form_id`, `form_fld_ent_id`, `form_fld_site_id`, `form_fld_name`, `form_fld_label`, `form_fld_type`, `form_fld_options`, `form_fld_required`, `form_fld_order`, `form_fld_placeholder`, `form_fld_created_at`, `form_fld_updated_at`, `form_fld_status`) VALUES
(1, 1, NULL, 1, 'name', 'Nombre', 'text', NULL, 1, 1, 'Tu nombre', '2025-12-09 19:12:13', '2025-12-09 19:12:13', 1),
(2, 1, NULL, 1, 'email', 'Correo electrónico', 'email', NULL, 1, 2, 'tu@correo.com', '2025-12-09 19:12:13', '2025-12-09 19:12:13', 1),
(3, 1, NULL, 1, 'message', 'Mensaje', 'textarea', NULL, 1, 3, 'Escribe tu mensaje', '2025-12-09 19:12:13', '2025-12-09 19:12:13', 1),
(4, 1, NULL, 1, 'attachment', 'Adjunto', 'file', NULL, 0, 4, NULL, '2025-12-09 19:12:13', '2025-12-09 19:12:13', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `forms_files`
--

CREATE TABLE `forms_files` (
  `form_file_entry_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al envío (form_entry_id)',
  `form_file_file_id` bigint UNSIGNED NOT NULL COMMENT 'ID del archivo en el sistema de archivos/tabla de archivos',
  `form_file_ent_id` int UNSIGNED DEFAULT NULL COMMENT 'ID de la entidad',
  `form_file_site_id` int NOT NULL DEFAULT '1' COMMENT 'ID del sitio',
  `form_file_field` varchar(255) DEFAULT NULL COMMENT 'Nombre del campo al que pertenece el archivo',
  `form_file_name` varchar(255) DEFAULT NULL COMMENT 'Nombre original del archivo',
  `form_file_size` int DEFAULT NULL COMMENT 'Tamaño en bytes',
  `form_file_mime` varchar(100) DEFAULT NULL COMMENT 'Tipo MIME'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Mapeo de archivos subidos por entrada';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `forms_values`
--

CREATE TABLE `forms_values` (
  `form_val_entry_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al envío (form_entry_id)',
  `form_val_field_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al campo (form_fld_id)',
  `form_val_ent_id` int UNSIGNED DEFAULT NULL COMMENT 'ID de la entidad',
  `form_val_site_id` int NOT NULL DEFAULT '1' COMMENT 'ID del sitio',
  `form_val_value` text COMMENT 'Valor almacenado (texto, json, etc)',
  `form_val_file_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Si el campo es archivo, referencia al id del archivo externo',
  `form_val_order` int DEFAULT '0' COMMENT 'Orden (si aplica)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Valores por campo de cada entrada (EAV simple)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `groups`
--

CREATE TABLE `groups` (
  `group_id` int NOT NULL,
  `group_ent_id` int DEFAULT '1' COMMENT 'ID de la entidad/empresa',
  `group_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Nombre del grupo',
  `group_description` text COLLATE utf8mb4_unicode_ci COMMENT 'Descripción del grupo',
  `group_state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0=Inactivo, 1=Activo',
  `group_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `group_updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Grupos de usuarios y archivos';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `groups_files`
--

CREATE TABLE `groups_files` (
  `group_file_group_id` int NOT NULL COMMENT 'ID del grupo',
  `group_file_file_id` int NOT NULL COMMENT 'ID del archivo',
  `group_file_order` int NOT NULL DEFAULT '0' COMMENT 'Orden del archivo en el grupo'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Asignación de archivos a grupos';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `groups_users`
--

CREATE TABLE `groups_users` (
  `group_user_group_id` int NOT NULL COMMENT 'ID del grupo',
  `group_user_user_id` int NOT NULL COMMENT 'ID del usuario'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Asignación de usuarios a grupos';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `links`
--

CREATE TABLE `links` (
  `lnk_id` int NOT NULL,
  `lnk_title` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lnk_description` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lnk_tags` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lnk_url` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '#',
  `lnk_target` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '_blank',
  `lnk_icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lnk_attr` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lnk_cls` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lnk_alt` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lnk_img` int DEFAULT NULL,
  `lnk_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `lnk_ent_id` int DEFAULT NULL,
  `lnk_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `links_categorys`
--

CREATE TABLE `links_categorys` (
  `lnk_cat_cat_id` int NOT NULL,
  `lnk_cat_lnk_id` int NOT NULL,
  `lnk_cat_order` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `links_pubs`
--

CREATE TABLE `links_pubs` (
  `lnk_pub_pub_id` int NOT NULL,
  `lnk_pub_lnk_id` int NOT NULL,
  `lnk_pub_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `media_categorys`
--

CREATE TABLE `media_categorys` (
  `media_cat_file_id` int NOT NULL,
  `media_cat_cat_id` int NOT NULL,
  `media_cat_order` int NOT NULL,
  `media_cat_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `media_cat_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `media_cat_ent_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `menus`
--

CREATE TABLE `menus` (
  `menu_id` int NOT NULL,
  `menu_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Nombre del menú',
  `menu_description` text COLLATE utf8mb4_unicode_ci COMMENT 'Descripción del menú',
  `menu_site_id` int DEFAULT NULL COMMENT 'ID del sitio web al que pertenece',
  `menu_ent_id` int DEFAULT '1' COMMENT 'ID de la entidad/empresa',
  `menu_state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0=Inactivo, 1=Activo',
  `menu_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `menu_updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Menús principales del sistema';

--
-- Volcado de datos para la tabla `menus`
--

INSERT INTO `menus` (`menu_id`, `menu_name`, `menu_description`, `menu_site_id`, `menu_ent_id`, `menu_state`, `menu_created_at`, `menu_updated_at`) VALUES
(1, 'Menú Principal', 'Menú de navegación principal del sitio', NULL, 1, 1, '2025-12-08 15:56:11', '2025-12-08 15:56:11'),
(2, 'pie de pagina', '', NULL, 1, 1, '2025-12-08 23:10:52', '2025-12-08 23:10:52');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `menus_items`
--

CREATE TABLE `menus_items` (
  `menu_item_id` int NOT NULL,
  `menu_item_menu_id` int NOT NULL COMMENT 'ID del menú al que pertenece',
  `menu_item_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Etiqueta de navegación',
  `menu_item_description` text COLLATE utf8mb4_unicode_ci COMMENT 'Descripción del item',
  `menu_item_pathurl` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'URL del enlace',
  `menu_item_target` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '_self' COMMENT 'Target del enlace: _self, _blank, etc.',
  `menu_item_parent_id` int DEFAULT '0' COMMENT 'ID del item padre (0 = item raíz)',
  `menu_item_level` tinyint NOT NULL DEFAULT '0' COMMENT 'Nivel de profundidad (0=raíz, 1=hijo, 2=nieto, etc.)',
  `menu_item_order` int NOT NULL DEFAULT '0' COMMENT 'Orden de visualización',
  `menu_item_icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Clase del icono o URL de imagen',
  `menu_item_img` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'URL de imagen (alternativa al icono)',
  `menu_item_html_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'ID HTML personalizado',
  `menu_item_css_class` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Clases CSS adicionales',
  `menu_item_cat_id` int DEFAULT NULL COMMENT 'ID de categoría asociada',
  `menu_item_cat_active` tinyint(1) DEFAULT '0' COMMENT 'Si la categoría está activa',
  `menu_item_data` text COLLATE utf8mb4_unicode_ci COMMENT 'Datos JSON adicionales',
  `menu_item_state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0=Inactivo, 1=Activo',
  `menu_item_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `menu_item_updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Items de menú con soporte jerárquico';

--
-- Volcado de datos para la tabla `menus_items`
--

INSERT INTO `menus_items` (`menu_item_id`, `menu_item_menu_id`, `menu_item_name`, `menu_item_description`, `menu_item_pathurl`, `menu_item_target`, `menu_item_parent_id`, `menu_item_level`, `menu_item_order`, `menu_item_icon`, `menu_item_img`, `menu_item_html_id`, `menu_item_css_class`, `menu_item_cat_id`, `menu_item_cat_active`, `menu_item_data`, `menu_item_state`, `menu_item_created_at`, `menu_item_updated_at`) VALUES
(235, 1, 'Home', NULL, '/', '_self', 0, 0, 0, 'icon-home', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(236, 1, '', NULL, '', '_self', 0, 0, 1, '', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(237, 1, 'Products', NULL, '/products', '_self', 0, 0, 2, 'icon-box', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(238, 1, 'Books', NULL, '/products/categories/books', '_self', 237, 1, 3, 'icon-book', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(239, 1, 'Electronics', NULL, '/products/categories/electronics', '_self', 237, 1, 4, 'icon-cpu', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(240, 1, 'Categories', NULL, '/products/categories', '_self', 237, 1, 5, 'icon-folder', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(241, 1, 'About Us', NULL, '/about', '_self', 240, 2, 6, 'icon-info', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(242, 1, 'prueba menu', NULL, '', '_self', 0, 0, 7, '', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(243, 1, 'Featured', NULL, '/products/featured', '_self', 0, 0, 8, 'icon-star', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(244, 1, 'Contact', NULL, '/contact', '_self', 243, 1, 9, 'icon-mail', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(245, 1, 'Clothing', NULL, '/products/categories/clothing', '_self', 243, 1, 10, 'icon-shirt', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(246, 1, 'All Products', NULL, '/products/all', '_self', 0, 0, 11, 'icon-list', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46'),
(250, 2, 'prueba 2', NULL, '', '_self', 0, 0, 0, '', '', '', '', NULL, 0, '', 1, '2025-12-08 23:11:01', '2025-12-08 23:11:01'),
(251, 2, 'About Us', NULL, '', '_self', 250, 1, 1, '', '', '', '', NULL, 0, '', 1, '2025-12-08 23:11:01', '2025-12-08 23:11:01'),
(252, 2, 'Books', NULL, '', '_self', 251, 2, 2, '', '', '', '', NULL, 0, '', 1, '2025-12-08 23:11:01', '2025-12-08 23:11:01');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `modules`
--

CREATE TABLE `modules` (
  `mod_id` int NOT NULL,
  `mod_name` varchar(255) DEFAULT NULL,
  `mod_description` tinytext,
  `mod_pathurl` varchar(255) DEFAULT NULL,
  `mod_path` varchar(500) DEFAULT NULL,
  `mod_code` varchar(11) DEFAULT NULL,
  `mod_icon` varchar(255) DEFAULT NULL,
  `mod_color` varchar(10) DEFAULT NULL,
  `mod_parent_id` int DEFAULT NULL,
  `mod_indexjs` varchar(400) NOT NULL,
  `mod_css` varchar(255) NOT NULL,
  `mod_db` varchar(255) NOT NULL COMMENT 'database',
  `mod_prefix_db` varchar(255) NOT NULL,
  `mod_relations_db` text NOT NULL,
  `mod_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Volcado de datos para la tabla `modules`
--

INSERT INTO `modules` (`mod_id`, `mod_name`, `mod_description`, `mod_pathurl`, `mod_path`, `mod_code`, `mod_icon`, `mod_color`, `mod_parent_id`, `mod_indexjs`, `mod_css`, `mod_db`, `mod_prefix_db`, `mod_relations_db`, `mod_state`) VALUES
(1, 'systems', NULL, 'systems', 'modules/systems/', 'SYS1', 'icon icon-systems', '#99C14C', 0, 'components/sistems.js', 'assets/css/dist/systems.css', 'systems', 'sys_', '', 0),
(2, 'modules', NULL, 'modules', 'modules/modules/', 'MOD1', 'icon icon-box-close', '#99C14C', 0, 'components/modules.js', 'assets/css/dist/modules.css', 'modules', 'mod_', 'modules_categorys:mod_cat_mod_id,systems_modules:sys_mod_mod_id', 0),
(3, 'sites', NULL, 'sites', 'modules/websites/', 'SIT1', 'icon icon-blocks', '#8900ff', 0, 'components/sites.js', 'assets/css/dist/sites.css', 'sites', 'site_', '', 0),
(4, 'Hojas de Trabajo', NULL, 'worksheets', 'modules/websites/', 'WS1', 'icon icon-worksheets', '#26fff6', 0, 'components/worksheets.js', 'assets/css/dist/worksheets.css', 'worksheets', 'ws_', '', 1),
(5, 'Bloques', NULL, 'blocks', 'modules/websites/', 'BL1', 'icon icon-blocks-web', '#FEBF10', 0, 'components/blocks.js', 'assets/css/dist/blocks.css', 'blocks', 'block_', '', 1),
(6, 'Publicaciones', NULL, 'publications', 'modules/websites/', 'PUB1', 'icon icon-webpart', '#FEBF10', 0, 'components/publications.js', 'assets/css/dist/publications.css', 'publications', 'pub_', '', 1),
(10, 'Dashboard WebSites', NULL, 'websites', 'modules/websites/', 'WEB1', 'icon icon-dashboard', '#99C14C', 0, 'components/websites.js', 'assets/css/dist/websites.min.css', '', '', '', 1),
(11, 'Contenidos', NULL, 'contents', 'modules/websites/', 'CON1', 'icon icon-content', '#1ff4ed', 0, 'components/contents.js', 'assets/css/dist/contents.min.css', 'contents', 'cont_', 'contents_categorys:cont_cat_cont_id,contents_files:cont_file_cont_id', 1),
(12, 'Categorias', NULL, 'categorys', 'modules/websites/', 'CAT1', 'icon icon-category', '#dd4b4d', 0, 'components/categorys.js', 'assets/css/dist/categorys.min.css', '', '', '', 1),
(13, 'Media', NULL, 'media', 'modules/websites/', 'MED1', 'icon icon-media', '#f04f04', 0, 'components/media.js', 'assets/css/dist/media.min.css', '', '', '', 1),
(14, 'Documentos', NULL, 'docs', 'modules/websites/', 'DOC1', 'icon icon-folder', '#FEBF10', 0, 'components/docs.js', 'assets/css/dist/docs.min.css', '', '', '', 1),
(15, 'Posts', NULL, 'posts', 'modules/websites/', 'POST1', 'icon icon-news', '#37ff2c', 0, 'components/posts.js', 'assets/css/dist/posts.min.css', '', '', '', 1),
(16, 'Sliders', NULL, 'sliders', 'modules/websites/', 'SLD1', 'icon icon-slider', '#8900ff', 0, 'components/sliders.js', 'assets/css/dist/sliders.min.css', '', '', '', 1),
(17, 'Menus', NULL, 'menus', 'modules/websites/', 'MENU1', 'icon icon-list', '#26fff6', 0, 'components/menus.js', 'assets/css/dist/menus.min.css', '', '', '', 1),
(18, 'Formularios', NULL, 'formularies', 'modules/websites/', 'SLD1', 'icon icon-unchecked', '#8aec49ff', 0, 'components/formularies.js', 'assets/css/dist/formularies.min.css', '', '', '', 1),
(19, 'Popups', NULL, 'popups', 'modules/websites/', 'POP1', 'icon icon-copy', '#468de9ff', 0, 'components/popups.js', 'assets/css/dist/popups.min.css', '', '', '', 1),
(200, 'Dashboard RRHH', NULL, 'rrhh', 'modules/rrhh/', 'RRHH', 'icon icon-category', '#99C14C', 0, 'components/rrhh.js', 'assets/css/dist/rrhh.min.css', '', '', '', 0),
(210, 'kardex', NULL, 'kardex', 'modules/rrhh/', 'KDX', 'icon icon-users', '#FEBF10', 0, 'components/kardex.js', '', '', '', '', 0),
(220, 'Organigrama', NULL, 'organizationChart', 'modules/rrhh/', 'KDX', 'icon icon-users', '#FEBF10', 0, 'components/organizationChart.js', 'assets/css/dist/organizationChart', '', '', '', 0),
(400, 'Dashboard Inventario', NULL, 'inventory', 'modules/inventory/', 'INV', 'icon icon-dashboard', '#FEBF10', 0, 'components/inventory.js', 'assets/css/dist/inventory.css', '', '', '', 1),
(401, 'Productos', NULL, 'products', 'modules/inventory/', 'PRO', 'icon icon-box', '#CCC', 0, 'components/products.js', 'assets/css/dist/products.css', 'mod_products', 'mod_prod_', '', 1),
(402, 'Stock', NULL, 'stock', 'modules/inventory/', 'STC', 'icon icon-unchecked', '#99C14C', 0, 'components/stock.js', 'assets/css/dist/stock.css', '', '', '', 1),
(403, 'Lista de Precios', NULL, 'pricelist', 'modules/inventory/', 'STC', 'icon icon-coin', '#99C14C', 0, 'components/pricelist.js', 'assets/css/dist/pricelist.css', '', '', '', 1),
(500, 'Dashboard Contabilidad', NULL, 'accounting', 'modules/accounting/', 'ACC', 'icon icon-dashboard', '#99C14C', 0, 'components/accounting.js', 'assets/css/dist/accounting.css', '', '', '', 1),
(600, 'Dashboard Consejeria', NULL, 'counseling', 'modules/counseling/', NULL, 'icon icon-dashboard', '#99C14C', 0, 'components/counseling.js', '', '', '', '', 1),
(601, 'Aconsejados', NULL, 'advised', 'modules/counseling/', NULL, 'icon icon-users', '#FEBF10', 0, 'components/advised.js', '', '', '', '', 1),
(602, 'Agenda', NULL, 'calendarAdvised', 'modules/counseling/', NULL, 'icon icon-calendar', '#FEBF10', 0, 'components/calendarAdvised.js', 'assets/css/dist/calendarAdvised.css', '', '', '', 1),
(603, 'Reportes', NULL, 'reportsCounseling', 'modules/counseling/', NULL, 'icon icon-table-check', '#FEBF10', 0, 'components/reportCounseling.js', 'assets/css/dist/reportCounseling.css', '', '', '', 1),
(700, 'Dashboard Ventas', NULL, 'sales', 'modules/sales/', 'PVD', 'icon icon-dashboard', '#fcc54e', 0, 'components/sales.js', 'assets/css/dist/sales.css', '', '', '', 1),
(701, 'Punto de Venta Tickets', NULL, 'salesPointTickets', 'modules/sales/', 'PVT', 'icon icon-cash-register', '#fcc54e', 0, 'components/salesPointTickets.js', 'assets/css/dist/salesPointTickets.css', '', '', '', 1),
(800, 'Dashboard Brokers', NULL, 'brokers', 'modules/brokers/', 'PV', 'icon icon-dashboard', '#fcc54e', 0, 'components/brokers.js', 'assets/css/dist/brokers.css', '', '', '', 1),
(801, 'Clientes', NULL, 'brokersCustomers', 'modules/brokers/', 'PV', 'icon icon-users', '#fcc54e', 0, 'components/brokersCustomers.js', 'assets/css/dist/brokersCustomers.css', '', '', '', 1),
(1000, 'Dashboard Suscripciones', NULL, 'suscriptions', 'core/accounts/', 'SC1', 'icon icon-dashboard', '#99C14', 0, 'components/subscriptions.js', 'assets/css/dist/subscriptions.css', '', '', '', 1),
(1001, 'Cuentas de Usuarios', NULL, 'accountsUsers', 'core/accounts/', 'ACC1', 'icon icon-user', '#8900ff', 0, 'components/accountsUsers.js', 'assets/css/dist/subscriptions.css', '', '', '', 1),
(1002, 'Cuentas de Clientes', NULL, 'customers', 'core/accounts/', 'CS1', 'icon icon-folder-open', '#07c472', 0, 'components/customers.js', 'assets/css/dist/customers.css', '', '', '', 1),
(1200, 'Dashboard FLS', NULL, 'fls', 'modules/fls/', 'FLS', 'icon icon-dashboard', '#fcc54e', 0, 'components/fls.js', 'assets/css/dist/fls.css', '', '', '', 1),
(1201, 'Clientes', NULL, 'flsCustomers', 'modules/fls/', 'PV', 'icon icon-users', '#fcc54e', 0, 'components/flsCustomers.js', 'assets/css/dist/flsCustomers.css', '', '', '', 1),
(1300, 'Dashboard Boletería', NULL, 'tickets', 'modules/tickets/', 'TKS', 'icon icon-dashboard', '#fcc54e', 0, 'components/tickets.js', 'assets/css/dist/tickets.min.css', '', '', '', 1),
(1301, 'Eventos', NULL, 'ticketingEvents', 'modules/tickets/', 'EVTKS', 'icon icon-tag', '#fcc54e', 0, 'components/ticketingEvents.js', 'assets/css/dist/ticketingEvents.min.css', 'mod_events', 'mod_eve_', '', 1),
(1400, 'Dashboard Rehabilitación', NULL, 'rehabilitation', 'modules/rehabilitation/', 'RHB', 'icon icon-dashboard', '#fcc54e', 0, 'components/rehabilitation.js', 'assets/css/dist/rehabilitation.min.css', '', '', '', 1),
(1401, 'Registro', NULL, 'rehabilitationRegistry', 'modules/rehabilitation/', 'RHBR', 'icon icon-user', '#fcc54e', 0, 'components/rehabilitationRegistry.js', 'assets/css/dist/rehabilitationRegistry.min.css', '', '', '', 1),
(1500, 'Dashboard Ads', NULL, 'ads', 'modules/ads/', 'ADS1', 'icon icon-dashboard', '#8900ff', 0, 'components/ads.js', 'assets/css/dist/ads.css', '', '', '', 1),
(1501, 'Lugares', NULL, 'places', 'modules/ads/', 'ADS1', 'icon icon-pointer', '#07c472', 0, 'components/places.js', 'assets/css/dist/places.min.css', '', '', '', 0),
(1502, 'Display', NULL, 'displayAds', 'modules/ads/', 'ADS1', 'icon icon-copy', '#07c472', 0, 'components/displayAds.js', 'assets/css/dist/displayAds.min.css', '', '', '', 1),
(1503, 'Avisos', NULL, 'advertisements', 'modules/ads/', 'ADS1', 'icon icon-blocks', '#073472', 0, 'components/advertisements.js', 'assets/css/dist/advertisements.min.css', '', '', '', 1),
(1600, 'Dashboard LMS', NULL, 'lms', 'modules/lms/', 'ADS1', 'icon icon-dashboard', '#8900ff', 0, 'components/lms.js', 'assets/css/dist/lms.min.css', '', '', '', 1),
(1601, 'Plan de Estudios', NULL, 'syllabus', 'modules/lms/', 'SB1', 'icon icon-category-r', '#8900ff', 0, 'components/syllabus.js', 'assets/css/dist/syllabus.min.css', '', '', '', 1),
(1700, 'Dashboard Activo Fijo', NULL, 'fixedassets', 'modules/fixedassets/', 'AF1', 'icon icon-dashboard', '#8900ff', 0, 'components/fixedassets.js', 'assets/css/dist/fixedassets.min.css', '', '', '', 1),
(1701, 'Activos', NULL, 'assets', 'modules/fixedassets/', 'ASS1', 'icon icon-tag-qr', '#8900ff', 0, 'components/assets.js', 'assets/css/dist/assets.min.css', '', '', '', 1),
(1800, 'Dashboard Operaciones', NULL, 'operations', 'modules/operations/', 'OP1', 'icon icon-dashboard', '#8900ff', 0, 'components/operations.js', 'assets/css/dist/operations.min.css', '', '', '', 1),
(1900, 'Dashboard CRM', NULL, 'crm', 'modules/crm/', 'CRM1', 'icon icon-dashboard', '#8900ff', 0, 'components/crm.js', 'assets/css/dist/crm.min.css', '', '', '', 1),
(1901, 'Contactos', NULL, 'contacts', 'modules/crm/', 'CNT1', 'icon icon-user-plus', '#3b82f6', 0, 'components/contacts.js', 'assets/css/dist/contacts.min.css', 'mod_contacts', 'mod_con_', '', 1),
(1902, 'Clientes', NULL, 'customersCrm', 'modules/crm/', 'CS1', 'icon icon-folder-open', '#8900ff', 0, 'components/customersCrm.js', 'assets/css/dist/customersCrm.min.css', '', '', '', 1),
(1903, 'Suscripciones', NULL, 'suscriptionsCrm', 'modules/crm/', 'SC1', 'icon icon-bell', '#99C144', 0, 'components/subscriptionsCrm.js', 'assets/css/dist/suscriptionsCrm.min.css', '', '', '', 1),
(2000, 'Dashboard', NULL, 'restaurants', 'modules/restaurants/', 'RST1', 'icon icon-dashboard', '#8900ff', 0, 'components/restaurants.js', 'assets/css/dist/restaurants.min.css', '', '', '', 1),
(2001, 'Ordenes', NULL, 'commands', 'modules/restaurants/', 'CS1', 'icon icon-command', '#8900ff', 0, 'components/commands.js', 'assets/css/dist/commands.min.css', '', '', '', 1),
(2100, 'Dashboard', NULL, 'externaldocuments', 'modules/externaldocuments/', 'EXD1', 'icon icon-dashboard', '#8900ff', 0, 'components/externaldocuments.js', 'assets/css/dist/externaldocuments.min.css', '', '', '', 1),
(2101, 'Bandeja de Entrada', NULL, 'inboxEd', 'modules/externaldocuments/', 'IBX1', 'icon icon-inbox', '#8900ff', 0, 'components/inboxEd.js', 'assets/css/dist/inboxEd.min.css', '', '', '', 1),
(2102, 'Plantillas', NULL, 'templatesEd', 'modules/externaldocuments/', 'TMP-ED1', 'icon icon-news', '#ff9000', 0, 'components/templatesEd.js', 'assets/css/dist/templatesEd.min.css', '', '', '', 1),
(2103, 'Traking', NULL, 'trakingEd', 'modules/externaldocuments/', 'TRK-ED1', 'icon icon-pointer', '#ff9040', 0, 'components/trakingEd.js', 'assets/css/dist/trakingEd.min.css', '', '', '', 1),
(2200, 'Dashboard Geolocalización', NULL, 'geolocation', 'modules/geolocation/', 'GEO-1', 'icon icon-dashboard', '#ff9040', 0, 'components/geolocation.js', 'assets/css/dist/geolocation.min.css', '', '', '', 1),
(2201, 'Lugares', NULL, 'places', 'modules/geolocation/', 'GEO-2', 'icon icon-pointer', '#E74745', 0, 'components/places.js', 'assets/css/dist/places.min.css', '', '', '', 1),
(2300, 'Dashboard Deportes', NULL, 'sports', 'modules/sports/', 'GEO-1', 'icon icon-dashboard', '#ff9040', 0, 'components/sports.js', 'assets/css/dist/sports.min.css', '', '', '', 1),
(2301, 'Futbol', NULL, 'futbol', 'modules/sports/', 'GEO-2', 'icon icon-futbol', '#E74745', 0, 'components/futbol.js', 'assets/css/dist/futbol.min.css', '', '', '', 1),
(2400, 'Dashboard Concursos', NULL, 'competitions', 'modules/competitions/', 'GEO-1', 'icon icon-dashboard', '#ff9040', 0, 'components/competitions.js', 'assets/css/dist/competitions.min.css', '', '', '', 1),
(3600, 'Dashboard', NULL, 'ganadorapp', 'modules/ganadorapp/', 'GAPP-1', 'icon icon-dashboard', '#E74745', 0, 'components/ganadorapp.js', 'assets/css/dist/ganadorapp.min.css', '', '', '', 1),
(3690, 'Proyectos', NULL, 'proyectosGA', 'modules/ganadorapp/', 'PAPP-1', 'icon icon-tag', '#E74745', 0, 'components/proyectosga.js', 'assets/css/dist/proyectosga.min.css', '', '', '', 1),
(3691, 'Neoganaderos', NULL, 'neoganaderos', 'modules/ganadorapp/', 'GNG-1', 'icon icon-users', '#E74745', 0, 'components/neoganaderos.js', 'assets/css/dist/neoganadores.min.css', '', '', '', 1),
(3692, 'Ganaderos', NULL, 'ganaderos', 'modules/ganadorapp/', 'GAN-1', 'icon icon-dashboard', '#E74745', 0, 'components/ganaderos.js', 'assets/css/dist/ganaderos.min.css', '', '', '', 1),
(3700, 'Dashboard', NULL, 'app_tributo', 'modules/app_tributo/', 'TAPP-1', 'icon icon-dashboard', '#E74745', 0, 'components/app_tributo.js', 'assets/css/dist/app_tributo.min.css', '', '', '', 1),
(3701, 'Selección', NULL, 'app_tributo_selection', 'modules/app_tributo/', 'TAPP-2', 'icon icon-tag', '#E74745', 0, 'components/app_tributo_selection.js', 'assets/css/dist/app_tributo_selection.min.css', '', '', '', 1),
(3702, 'Clientes', NULL, 'app_tributo_clients', 'modules/app_tributo/', 'TAPP-3', 'icon icon-users', '#E74745', 0, 'components/app_tributo_clients.js', 'assets/css/dist/app_tributo_clients.min.css', '', '', '', 1),
(3800, 'Dashboard Finance', 'Panel principal de gestión financiera y contabilidad', 'finance', 'modules/finance/', 'FIN-1', 'icon icon-dashboard', '#10b981', 0, 'components/finance.js', 'assets/css/dist/finance.min.css', '', '', '', 1),
(3801, 'Cuentas Contables', 'Catálogo de cuentas contables (Chart of Accounts)', 'glAccounts', 'modules/finance/', 'FIN-2', 'icon icon-category', '#10b981', 0, 'components/glAccounts.js', 'assets/css/dist/glAccounts.min.css', 'mod_gl_accounts', 'mod_gl_', '', 1),
(3802, 'Transacciones', 'Registro de transacciones y asientos contables', 'glTransactions', 'modules/finance/', 'FIN-3', 'icon icon-table-check', '#10b981', 0, 'components/glTransactions.js', 'assets/css/dist/glTransactions.min.css', 'mod_gl_transactions', 'mod_gt_', '', 1),
(3900, 'Dashboard', NULL, 'rems', 'modules/rems/', 'RAPP-1', 'icon icon-dashboard', '#E74745', 0, 'components/rems.js', 'assets/css/dist/rems.min.css', '', '', '', 1),
(3901, 'Proyectos', NULL, 'rems_projects', 'modules/rems/', 'PAPP-2', 'icon icon-operations', '#E74745', 0, 'components/rems_projects.js', 'assets/css/dist/rems_projects.min.css', '', '', '', 1),
(3902, 'Lotes', NULL, 'rems_lots', 'modules/rems/', 'LAPP-2', 'icon icon-blocks', '#E74745', 0, 'components/rems_lots.js', 'assets/css/dist/rems_lots.min.css', '', '', '', 1),
(3903, 'Fases', NULL, 'rems_phases', 'modules/rems/', 'FAPP-2', 'icon icon-list', '#E74745', 0, 'components/rems_phases.js', 'assets/css/dist/rems_phases.min.css', '', '', '', 1),
(3904, 'Contactos', NULL, 'rems_contacts', 'modules/rems/', 'CAPP-3', 'icon icon-users', '#E74745', 0, 'components/rems_contacts.js', 'assets/css/dist/rems_contacts.min.css', '', '', '', 1),
(3905, 'Documentos', NULL, 'rems_documents', 'modules/rems/', 'DAPP-4', 'icon icon-folder', '#E74745', 0, 'components/rems_documents.js', 'assets/css/dist/rems_documents.min.css', '', '', '', 1),
(3906, 'Campañas', NULL, 'rems_campaigns', 'modules/rems/', 'CAMAPP-5', 'icon icon-loudspeaker', '#E74745', 0, 'components/rems_campaigns.js', 'assets/css/dist/rems_campaigns.min.css', '', '', '', 1),
(3907, 'Leads', NULL, 'rems_leads', 'modules/rems/', 'LEAPP-6', 'icon icon-user', '#E74745', 0, 'components/rems_leads.js', 'assets/css/dist/rems_leads.min.css', '', '', '', 1),
(3908, 'Propiedades', NULL, 'rems_properties', 'modules/rems/', 'PROAPP-7', 'icon icon-fixed-assets', '#E74745', 0, 'components/rems_properties.js', 'assets/css/dist/rems_properties.min.css', '', '', '', 1),
(3909, 'Unidades', NULL, 'rems_units', 'modules/rems/', 'UNAPP-8', 'icon icon-checked', '#E74745', 0, 'components/rems_units.js', 'assets/css/dist/rems_units.min.css', '', '', '', 1),
(3910, 'Reservas', NULL, 'rems_reservations', 'modules/rems/', 'RESAPP-9', 'icon icon-tag', '#E74745', 0, 'components/rems_reservations.js', 'assets/css/dist/rems_reservations.min.css', '', '', '', 1),
(3911, 'Ventas', NULL, 'rems_sales', 'modules/rems/', 'SAAPP-10', 'icon icon-cash-register', '#E74745', 0, 'components/rems_sales.js', 'assets/css/dist/rems_sales.min.css', '', '', '', 1),
(3912, 'Transferencias', NULL, 'rems_property_transfers', 'modules/rems/', 'TRAPP-11', 'icon icon-sort', '#E74745', 0, 'components/rems_property_transfers.js', 'assets/css/dist/rems_property_transfers.min.css', '', '', '', 1),
(3913, 'Incidentes', NULL, 'rems_incidents', 'modules/rems/', 'INCAPP-12', 'icon icon-square-minus', '#E74745', 0, 'components/rems_incidents.js', 'assets/css/dist/rems_incidents.min.css', '', '', '', 1),
(3914, 'Pagos', NULL, 'rems_payments', 'modules/rems/', 'PAYAPP-13', 'icon icon-coin', '#E74745', 0, 'components/rems_payments.js', 'assets/css/dist/rems_payments.min.css', '', '', '', 1),
(3915, 'Reportes', NULL, 'rems_reports', 'modules/rems/', 'REPAPP-10', 'icon icon-doc', '#E74745', 0, 'components/rems_reports.js', 'assets/css/dist/rems_reports.min.css', '', '', '', 1),
(3916, 'Configuración', NULL, 'rems_config', 'modules/rems/', 'CONFAPP-11', 'icon icon-settings', '#E74745', 0, 'components/rems_config.js', 'assets/css/dist/rems_config.min.css', '', '', '', 1),
(4000, 'Dashboard PIM', 'Panel de gestión de información de productos', 'pim', 'modules/pim/', 'PIM-1', 'icon icon-dashboard', '#f59e0b', 0, 'components/pim.js', 'assets/css/dist/pim.min.css', '', '', '', 1),
(4001, 'Productos', 'Catálogo de productos base (entidad lógica)', 'pimProducts', 'modules/pim/', 'PIM-3', 'icon icon-box', '#f59e0b', 0, 'components/pimProducts.js', 'assets/css/dist/pimProducts.min.css', 'mod_pim_products', 'mod_pp_', '', 1),
(4002, 'Colecciones', 'Gestión de colecciones de productos', 'pimCollections', 'modules/pim/', 'PIM-2', 'icon icon-tag', '#f59e0b', 0, 'components/pimCollections.js', 'assets/css/dist/pimCollections.min.css', 'mod_pim_collections', 'mod_pcol_', '', 1),
(4003, 'SKUs', 'Variantes de producto - Unidad transaccional/inventario', 'pimSkus', 'modules/pim/', 'PIM-4', 'icon icon-tag', '#f59e0b', 0, 'components/pimSkus.js', 'assets/css/dist/pimSkus.min.css', 'mod_pim_skus', 'mod_ps_', '', 1),
(4100, 'Dashboard WMS', 'Panel de gestión de almacenes e inventario', 'wms', 'modules/wms/', 'WMS-1', 'icon icon-dashboard', '#06b6d4', 0, 'components/wms.js', 'assets/css/dist/wms.min.css', '', '', '', 1),
(4101, 'Almacenes', 'Maestro de almacenes y centros de distribución', 'warehouses', 'modules/wms/', 'WMS-2', 'icon icon-warehouse', '#06b6d4', 0, 'components/warehouses.js', 'assets/css/dist/warehouses.min.css', 'mod_wms_warehouses', 'mod_ww_', '', 1),
(4102, 'Stock', 'Balance de inventario por SKU y ubicación', 'wmsStock', 'modules/wms/', 'WMS-3', 'icon icon-box', '#06b6d4', 0, 'components/wmsStock.js', 'assets/css/dist/wmsStock.min.css', 'mod_wms_stock', 'mod_ws_', '', 1),
(4200, 'Dashboard OMS', 'Panel de gestión de órdenes y fulfillment', 'oms', 'modules/oms/', 'OMS-1', 'icon icon-dashboard', '#ef4444', 0, 'components/oms.js', 'assets/css/dist/oms.min.css', '', '', '', 1),
(4201, 'Órdenes', 'Gestión de órdenes de cliente (cabecera y detalle)', 'orders', 'modules/oms/', 'OMS-2', 'icon icon-sales', '#ef4444', 0, 'components/orders.js', 'assets/css/dist/orders.min.css', 'mod_oms_orders', 'mod_oo_', '', 1),
(4202, 'Fulfillments', 'Unidades de cumplimiento y asignación de almacenes', 'fulfillments', 'modules/oms/', 'OMS-3', 'icon icon-box', '#ef4444', 0, 'components/fulfillments.js', 'assets/css/dist/fulfillments.min.css', 'mod_oms_fulfillments', 'mod_of_', '', 1),
(4203, 'Envíos', 'Tracking de envíos y gestión de paquetería', 'shipments', 'modules/oms/', 'OMS-4', 'icon icon-pointer', '#ef4444', 0, 'components/shipments.js', 'assets/css/dist/shipments.min.css', 'mod_oms_shipments', 'mod_os_', '', 1),
(4204, 'Devoluciones', 'Gestión de devoluciones y reembolsos', 'returns', 'modules/oms/', 'OMS-5', 'icon icon-return', '#ef4444', 0, 'components/returns.js', 'assets/css/dist/returns.min.css', 'mod_oms_returns', 'mod_or_', '', 1),
(4300, 'Dashboard FSS', 'Panel de liquidación financiera a vendedores', 'fss', 'modules/fss/', 'FSS-1', 'icon icon-dashboard', '#14b8a6', 0, 'components/fss.js', 'assets/css/dist/fss.min.css', '', '', '', 1),
(4301, 'Pagos a Vendors', 'Transferencias y liquidaciones a vendedores', 'payouts', 'modules/fss/', 'FSS-2', 'icon icon-coin', '#14b8a6', 0, 'components/payouts.js', 'assets/css/dist/payouts.min.css', 'mod_fss_payouts', 'mod_fp_', '', 1),
(4400, 'Dashboard CCM', 'Panel de gestión de clientes y comunicación', 'ccm', 'modules/ccm/', 'CCM-1', 'icon icon-dashboard', '#ec4899', 0, 'components/ccm.js', 'assets/css/dist/ccm.min.css', '', '', '', 1),
(4401, 'Reseñas', 'Reseñas y ratings de productos por clientes', 'reviews', 'modules/ccm/', 'CCM-2', 'icon icon-star', '#ec4899', 0, 'components/reviews.js', 'assets/css/dist/reviews.min.css', 'mod_ccm_reviews', 'mod_cr_', '', 1),
(4402, 'Tickets Soporte', 'Sistema de tickets y atención al cliente', 'supportTickets', 'modules/ccm/', 'CCM-3', 'icon icon-tag', '#ec4899', 0, 'components/supportTickets.js', 'assets/css/dist/supportTickets.min.css', 'mod_ccm_tickets', 'mod_ct_', '', 1),
(4500, 'Dashboard BI', 'Panel de análisis y business intelligence', 'bi', 'modules/bi/', 'BI-1', 'icon icon-dashboard', '#6366f1', 0, 'components/bi.js', 'assets/css/dist/bi.min.css', '', '', '', 1),
(4501, 'Dimensiones', 'Dimensiones de tiempo, vendedores y clientes', 'biDimensions', 'modules/bi/', 'BI-2', 'icon icon-category', '#6366f1', 0, 'components/biDimensions.js', 'assets/css/dist/biDimensions.min.css', '', '', '', 1),
(4502, 'Ventas Analytics', 'Análisis de ventas, GMV y métricas del marketplace', 'biSales', 'modules/bi/', 'BI-3', 'icon icon-table-check', '#6366f1', 0, 'components/biSales.js', 'assets/css/dist/biSales.min.css', 'mod_bi_fact_sales', 'mod_bfs_', '', 1),
(4600, 'Dashboard VMS', 'Panel de gestión de vendedores del marketplace', 'vms', 'modules/vms/', 'VMS-1', 'icon icon-dashboard', '#8b5cf6', 0, 'components/vms.js', 'assets/css/dist/vms.min.css', '', '', '', 1),
(4601, 'Vendedores', 'Registro y gestión de vendedores (Vendors)', 'vendors', 'modules/vms/', 'VMS-2', 'icon icon-users', '#8b5cf6', 0, 'components/vendors.js', 'assets/css/dist/vendors.min.css', 'mod_vms_vendors', 'mod_vv_', '', 1),
(4602, 'Comisiones', 'Reglas y cálculo de comisiones del marketplace', 'commissionRules', 'modules/vms/', 'VMS-3', 'icon icon-coin', '#8b5cf6', 0, 'components/commissionRules.js', 'assets/css/dist/commissionRules.min.css', 'mod_vms_commission_rules', 'mod_vcr_', '', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `modules_categorys`
--

CREATE TABLE `modules_categorys` (
  `mod_cat_mod_id` int NOT NULL,
  `mod_cat_cat_id` int NOT NULL,
  `mod_cat_ent_id` int NOT NULL,
  `mod_cat_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_accounting_plan`
--

CREATE TABLE `mod_accounting_plan` (
  `mod_acp_id` int NOT NULL,
  `mod_acp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_acp_descripcion` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_acp_parent_id` int DEFAULT NULL,
  `mod_acp_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_acp_level` int DEFAULT NULL,
  `mod_acp_coin` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_acp_has_referral_code` int NOT NULL DEFAULT '0' COMMENT 'tiene codigo de referido',
  `mod_acp_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_accounts_addresses`
--

CREATE TABLE `mod_accounts_addresses` (
  `mod_acu_add_acu_id` int NOT NULL,
  `mod_acu_add_add_id` int NOT NULL,
  `mod_acu_add_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_accounts_ads`
--

CREATE TABLE `mod_accounts_ads` (
  `mod_aca_id` int NOT NULL,
  `mod_aca_cen_id` int NOT NULL,
  `mod_aca_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_aca_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_aca_code` int DEFAULT NULL,
  `mod_aca_ent_id` int DEFAULT NULL,
  `mod_aca_state` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_accounts_invoices_data`
--

CREATE TABLE `mod_accounts_invoices_data` (
  `mod_acu_invd_id` int NOT NULL,
  `mod_acu_invd_acu_id` int NOT NULL,
  `mod_acu_invd_razon_social` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_acu_invd_nit` int NOT NULL,
  `mod_acu_invd_order` int NOT NULL,
  `mod_acu_invd_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_accounts_plans`
--

CREATE TABLE `mod_accounts_plans` (
  `mod_ap_id` int NOT NULL,
  `mod_ap_name` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_ap_description` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_ap_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_ap_level` int DEFAULT NULL,
  `mod_ap_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_ap_cost` decimal(10,2) DEFAULT NULL,
  `mod_ap_coin` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Bs',
  `mod_ap_mode` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'monthly',
  `mod_ap_last` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_ap_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_ap_ent_id` int DEFAULT NULL,
  `mod_ap_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_accounts_plans`
--

INSERT INTO `mod_accounts_plans` (`mod_ap_id`, `mod_ap_name`, `mod_ap_description`, `mod_ap_code`, `mod_ap_level`, `mod_ap_details`, `mod_ap_cost`, `mod_ap_coin`, `mod_ap_mode`, `mod_ap_last`, `mod_ap_json`, `mod_ap_ent_id`, `mod_ap_state`) VALUES
(1, 'Test', 'Limitado a una sola presentación', 'TBS1', 1, '<p>Hasta 20 Facturas de compras en 1 Mes</p>\n<p>Hasta 10 Facturas Emitidas de Ventas</p>\n<p>Hasta 30 Facturas para el Formulario Trimestral (Formulario 610)</p>\n<p>Sin declaraciones</p>\n<p> - - - </p>\n<p> - - - </p>', 0.00, 'Bs', 'monthly', NULL, '{\n\"limiteFacturasComprasMes\": 30,\n\"limiteFacturasEmitidasVentas\":10,\n\"limiteFacturasForm610Trimestral\":30,\n\"declaracionMensualForm200\":true,\n\"declaracionMensualForm400\":true,\n\"declaracionMensualForm600\":true, \"\n}', 1, 1),
(2, 'Básico', '(Recomendado)', 'BBS1', 1, '<p>Hasta 20 Facturas de compras en 1 Mes</p>\n<p>Hasta 10 Facturas Emitidas de Ventas</p>\n<p>Hasta 30 Facturas para el Formulario Trimestral (Formulario 610)</p>\n<p>Declaracion Mensual del Formulario 200</p>\n<p>Declaracion Mensual del Formulario 400</p>\n<p>Declaracion Trimestral del Formulario 610</p>', 150.00, 'Bs', 'monthly', 'Antes 200Bs', '{\n    \"limiteFacturasComprasMes\": 50,\n    \"limiteFacturasEmitidasVentas\":20,\n    \"limiteFacturasForm610Trimestral\":60,\n    \"declaracionMensualForm200\":true,\n    \"declaracionMensualForm400\":true,\n    \"declaracionMensualForm600\":true,\n    \"modes\":[{\n            \"mode\": \"quarterly\",\n            \"title\": \"Trimestralmente\",\n            \"last\": \"antes\",\n            \"cost\": \"\",\n            \"description\": \"Bs. al mes\",\n            \"detail\": \"Ahorras 5%\"\n        },{\n            \"mode\": \"semi-annually\",\n            \"title\": \"Semestralmente\",\n            \"last\": \"antes\",\n            \"cost\": \"\",\n            \"description\": \" Bs. al mes\",\n            \"detail\": \"Ahorras 5%\"\n        },{\n            \"title\": \"yearly\",\n            \"last\": \"antes\",\n            \"cost\": \"\",\n            \"description\": \"Bs. al mes\",\n            \"detail\": \"Ahorras 5%\"\n        }\n        ]\n    }', 1, 1),
(3, 'Avanzado', NULL, 'ABS1', 1, '<p>Hasta 50 Facturas de compras en 1 Mes</p>\n<p>Hasta 20 Facturas Emitidas de Ventas</p>\n<p>Hasta 60 Facturas para el Formulario Trimestral (Formulario 610)</p>\n<p>Declaracion Mensual del Formulario 200</p>\n<p>Declaracion Mensual del Formulario 400</p>\n<p>Declaracion Trimestral del Formulario 610 </p>', 250.00, 'Bs', 'monthly', NULL, '{\n\"limiteFacturasComprasMes\": 50,\n\"limiteFacturasEmitidasVentas\":20,\n\"limiteFacturasForm610Trimestral\":60,\n\"declaracionMensualForm200\":true,\n\"declaracionMensualForm400\":true,\n\"declaracionMensualForm600\":true,\n}', 1, 1),
(4, 'Premium', NULL, 'PBS1', 1, '<p>Hasta 100 Facturas de compras en 1 Mes</p>\n<p>Hasta 50 Facturas Emitidas de Ventas</p>\n<p>Hasta 100 Facturas para el Formulario Trimestral (Formulario 610)</p>\n<p>Declaracion Mensual del Formulario 200</p>\n<p>Declaracion Mensual del Formulario 400</p>\n<p>Declaracion Trimestral del Formulario 610 </p>', 350.00, 'Bs', 'monthly', NULL, '{\n\"limiteFacturasComprasMes\": 50,\n\"limiteFacturasEmitidasVentas\":20,\n\"limiteFacturasForm610Trimestral\":60,\n\"declaracionMensualForm200\":true,\n\"declaracionMensualForm400\":true,\n\"declaracionMensualForm600\":true,\n\"modes\":[{\n        \"mode\": \"quarterly\",\n        \"title\": \"Trimestralmente\",\n        \"last\": \"antes\",\n        \"cost\": \"430.00\",\n        \"description\": \"Bs. al mes\",\n        \"detail\": \"Ahorras 5%\"\n    },{\n        \"mode\": \"semi-annually\",\n        \"title\": \"Semestralmente\",\n        \"last\": \"antes\",\n        \"cost\": \"\",\n        \"description\": \" s. al mes\",\n        \"detail\": \"Ahorras 5%\"\n    },{\n        \"title\": \"yearly\",\n        \"last\": \"antes\",\n        \"cost\": \"\",\n        \"description\": \"Bs. al mes\",\n        \"detail\": \"Ahorras 5%\"\n    }\n    ]\n}', 1, 1),
(5, 'Premium+', NULL, 'PPBS1', 1, '<p>Hasta 200 Facturas de compras en 1 Mes</p>\n<p>Hasta 100 Facturas Emitidas de Ventas</p>\n<p>Hasta 200 Facturas para el Formulario Trimestral (Formulario 610)</p>\n<p>Declaracion Mensual del Formulario 200</p>\n<p>Declaracion Mensual del Formulario 400</p>\n<p>Declaracion Trimestral del Formulario 610 </p>', 500.00, 'Bs', 'monthly', NULL, '{\n\"limiteFacturasComprasMes\": 200,\n\"limiteFacturasEmitidasVentas\":100,\n\"limiteFacturasForm610Trimestral\":200,\n\"declaracionMensualForm200\":true,\n\"declaracionMensualForm400\":true,\n\"declaracionMensualForm600\":true,\n}', 1, 1),
(6, 'Asociada CAMEBOL', NULL, 'PC1', 1, '<p>Hasta 20 Facturas de compras en 1 Mes</p>\n<p>Hasta 10 Facturas Emitidas de Ventas</p>\n<p>Hasta 30 Facturas para el Formulario Trimestral (Formulario 610)</p>\n<p>Declaracion Mensual del Formulario 200</p>\n<p>Declaracion Mensual del Formulario 400</p>\n<p>Declaracion Trimestral del Formulario 610</p>', 125.00, 'Bs', 'monthly', 'Antes 200Bs', '{\n    \"limiteFacturasComprasMes\": 50,\n    \"limiteFacturasEmitidasVentas\":20,\n    \"limiteFacturasForm610Trimestral\":60,\n    \"declaracionMensualForm200\":true,\n    \"declaracionMensualForm400\":true,\n    \"declaracionMensualForm600\":true,\n    \"modes\":[{\n            \"mode\": \"quarterly\",\n            \"title\": \"Trimestralmente\",\n            \"last\": \"antes\",\n            \"cost\": \"\",\n            \"description\": \"Bs. al mes\",\n            \"detail\": \"Ahorras 5%\"\n        },{\n            \"mode\": \"semi-annually\",\n            \"title\": \"Semestralmente\",\n            \"last\": \"antes\",\n            \"cost\": \"\",\n            \"description\": \" Bs. al mes\",\n            \"detail\": \"Ahorras 5%\"\n        },{\n            \"title\": \"yearly\",\n            \"last\": \"antes\",\n            \"cost\": \"\",\n            \"description\": \"Bs. al mes\",\n            \"detail\": \"Ahorras 5%\"\n        }\n        ]\n    }', 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_accounts_roles`
--

CREATE TABLE `mod_accounts_roles` (
  `mod_acu_rol_id` int NOT NULL,
  `mod_acu_rol_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_acu_rol_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_acu_rol_parent_id` int DEFAULT NULL,
  `mod_acu_rol_redirection_url` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_acu_rol_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_acu_rol_state` int DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_accounts_roles`
--

INSERT INTO `mod_accounts_roles` (`mod_acu_rol_id`, `mod_acu_rol_name`, `mod_acu_rol_description`, `mod_acu_rol_parent_id`, `mod_acu_rol_redirection_url`, `mod_acu_rol_json`, `mod_acu_rol_state`) VALUES
(1, 'temp', NULL, 0, NULL, NULL, 1),
(2, 'suscriptor', NULL, 0, NULL, NULL, 0);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_accounts_services`
--

CREATE TABLE `mod_accounts_services` (
  `mod_acu_sv_sv_id` int NOT NULL,
  `mod_acu_sv_acu_id` int NOT NULL,
  `mod_acu_sv_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_accounts_users_plans`
--

CREATE TABLE `mod_accounts_users_plans` (
  `mod_acu_ap_acu_id` int NOT NULL,
  `mod_acu_ap_ap_id` int NOT NULL,
  `mod_acu_ap_mode` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_acu_ap_date_register` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_accounts_users_plans`
--

INSERT INTO `mod_accounts_users_plans` (`mod_acu_ap_acu_id`, `mod_acu_ap_ap_id`, `mod_acu_ap_mode`, `mod_acu_ap_date_register`) VALUES
(1, 2, '', '2025-04-09 20:23:38');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_accounts_users_roles`
--

CREATE TABLE `mod_accounts_users_roles` (
  `mod_acu_user_rol_acu_id` int NOT NULL,
  `mod_acu_user_rol_rol_id` int NOT NULL,
  `mod_acu_user_rol_ent_id` int NOT NULL,
  `mod_acu_user_rol_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_accounts_users_roles`
--

INSERT INTO `mod_accounts_users_roles` (`mod_acu_user_rol_acu_id`, `mod_acu_user_rol_rol_id`, `mod_acu_user_rol_ent_id`, `mod_acu_user_rol_order`) VALUES
(0, 1, 1, 0),
(1, 1, 1, 0),
(3, 1, 1, 0),
(4, 1, 1, 0);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_actions`
--

CREATE TABLE `mod_actions` (
  `mod_act_id` int NOT NULL,
  `mod_act_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_act_summary` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_act_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_act_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_actions_register`
--

CREATE TABLE `mod_actions_register` (
  `mod_act_reg_act_id` int NOT NULL COMMENT 'mod_actions',
  `mod_act_reg_cpa_id` int NOT NULL COMMENT 'mod_campaigns_ads',
  `mod_act_reg_aca_id` int NOT NULL COMMENT 'mod_accounts_ads',
  `mod_act_reg_acu_id` int NOT NULL COMMENT 'mod_accounts_user',
  `mod_act_reg_plc_id` int NOT NULL COMMENT 'mod_places',
  `mod_act_reg_value` int NOT NULL,
  `mod_act_reg_register_date` datetime NOT NULL,
  `mod_act_reg_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_acuse`
--

CREATE TABLE `mod_acuse` (
  `mod_ac_id` int NOT NULL,
  `mod_ac_date` datetime NOT NULL,
  `mod_ac_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_addresses`
--

CREATE TABLE `mod_addresses` (
  `mod_add_id` int NOT NULL,
  `mod_add_name` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_add_alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_add_description` varchar(700) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_add_coord` varchar(700) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_add_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_addresses_logistics_distribution_zone`
--

CREATE TABLE `mod_addresses_logistics_distribution_zone` (
  `mod_add_ldz_add_id` int NOT NULL,
  `mod_add_ldz_ldz_id` int NOT NULL,
  `mod_add_ldz_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ads`
--

CREATE TABLE `mod_ads` (
  `mod_ads_id` int NOT NULL COMMENT 'Id único del anuncio',
  `mod_ads_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del anuncio',
  `mod_ads_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Detalles o descripción del anuncio',
  `mod_ads_display_id` int DEFAULT NULL COMMENT 'ID del Display (relacionado con mod_ads_display)',
  `mod_ads_campaign_id` int DEFAULT NULL COMMENT 'ID de la campaña (relacionado con mod_ads_campaigns)',
  `mod_ads_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_ads_attribute` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_ads_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'JSON con los datos del anuncio',
  `mod_ads_user_id` int DEFAULT NULL COMMENT 'ID del usuario que creó el anuncio',
  `mod_ads_start_date` datetime DEFAULT NULL,
  `mod_ads_end_date` datetime DEFAULT NULL,
  `mod_ads_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del anuncio (0: inactivo, 1: activo)'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ads_campaigns`
--

CREATE TABLE `mod_ads_campaigns` (
  `mod_ads_campaign_id` int NOT NULL COMMENT 'Id único de la campaña',
  `mod_ads_campaign_cen_id` int NOT NULL COMMENT 'Id de la empresa que crea la campaña (relacionado con mod_customers_enterprises)',
  `mod_ads_campaign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre de la campaña',
  `mod_ads_campaign_objective` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Objetivo de la campaña (ejemplo: leads, ventas)',
  `mod_ads_campaign_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active' COMMENT 'Estado de la campaña (active, paused, completed)',
  `mod_ads_campaign_start_date` datetime NOT NULL COMMENT 'Fecha de inicio de la campaña',
  `mod_ads_campaign_end_date` datetime DEFAULT NULL COMMENT 'Fecha de finalización de la campaña',
  `mod_ads_campaign_budget_id` int NOT NULL COMMENT 'Id del presupuesto asociado',
  `mod_ads_campaign_ent_id` int NOT NULL COMMENT 'Id de la entidad asociada (relacionado con mod_customers_enterprises)',
  `mod_ads_campaign_state` int NOT NULL DEFAULT '1' COMMENT 'Estado del registro (1: activo, 0: inactivo)',
  `mod_ads_campaign_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación de la campaña',
  `mod_ads_campaign_created_user_id` int DEFAULT NULL COMMENT 'Id del usuario que creó la campaña',
  `mod_ads_campaign_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización de la campaña',
  `mod_ads_campaign_updated_user_id` int DEFAULT NULL COMMENT 'Id del usuario que actualizó la campaña',
  `mod_ads_campaign_deleted_at` timestamp NULL DEFAULT NULL COMMENT 'Fecha de eliminación de la campaña',
  `mod_ads_campaign_deleted_user_id` int DEFAULT NULL COMMENT 'Id del usuario que eliminó la campaña',
  `mod_ads_campaign_deleted_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Motivo de eliminación de la campaña'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_ads_campaigns`
--

INSERT INTO `mod_ads_campaigns` (`mod_ads_campaign_id`, `mod_ads_campaign_cen_id`, `mod_ads_campaign_name`, `mod_ads_campaign_objective`, `mod_ads_campaign_status`, `mod_ads_campaign_start_date`, `mod_ads_campaign_end_date`, `mod_ads_campaign_budget_id`, `mod_ads_campaign_ent_id`, `mod_ads_campaign_state`, `mod_ads_campaign_created_at`, `mod_ads_campaign_created_user_id`, `mod_ads_campaign_updated_at`, `mod_ads_campaign_updated_user_id`, `mod_ads_campaign_deleted_at`, `mod_ads_campaign_deleted_user_id`, `mod_ads_campaign_deleted_reason`) VALUES
(1, 1, 'IOL', 'posicionamiento', 'completado', '2025-04-08 00:00:00', '2025-04-12 00:00:00', 10, 1, 1, '0000-00-00 00:00:00', 1, '2025-04-14 03:57:25', NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ads_devices`
--

CREATE TABLE `mod_ads_devices` (
  `mod_ads_device_id` int NOT NULL COMMENT 'Id único del dispositivo',
  `mod_ads_device_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del dispositivo (ejemplo: móvil, desktop)',
  `mod_ads_device_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del dispositivo',
  `mod_ads_device_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización del dispositivo'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ads_display`
--

CREATE TABLE `mod_ads_display` (
  `mod_ads_dsp_id` int NOT NULL,
  `mod_ads_dsp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_ads_dsp_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_ads_dsp_site_id` int DEFAULT NULL,
  `mod_ads_dsp_pub_id` int DEFAULT NULL,
  `mod_ads_dsp_file_id` int DEFAULT NULL,
  `mod_ads_dsp_ent_id` int DEFAULT NULL,
  `mod_ads_dsp_type` int DEFAULT NULL COMMENT 'Tipo de ubicación (1: encabezado, 2: pie de página, 3: lateral)',
  `mod_ads_dsp_state` int NOT NULL DEFAULT '0',
  `mod_ads_dsp_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ads_displays`
--

CREATE TABLE `mod_ads_displays` (
  `mod_ads_dsp_dsp_id` int NOT NULL COMMENT 'Id único de la posición del anuncio',
  `mod_ads_dsp_campaign_id` int DEFAULT NULL COMMENT 'ID de la empresa asociada con la posición del anuncio',
  `mod_ads_dsp_ads_id` int DEFAULT NULL COMMENT 'ID del anuncio asociado con la posición del anuncio',
  `mod_ads_dsp_file_id` int DEFAULT NULL COMMENT 'ID del archivo multimedia asociado con la posición del anuncio',
  `mod_ads_dsp_type` enum('desktop','laptop','tablet','mobile') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de dispositivo para la posición del anuncio',
  `mod_ads_dsp_state` int NOT NULL DEFAULT '0' COMMENT 'Estado de la posición del anuncio (0: inactivo, 1: activo)',
  `mod_ads_dsp_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_ads_dsp_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Enlace para la visualización del anuncio'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ads_display_files`
--

CREATE TABLE `mod_ads_display_files` (
  `mod_ads_dsp_file_dsp_id` int NOT NULL,
  `mod_ads_dsp_file_file_id` int NOT NULL,
  `mod_ads_dsp_file_order` int DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ads_locations`
--

CREATE TABLE `mod_ads_locations` (
  `mod_ads_location_id` int NOT NULL COMMENT 'Id único de la ubicación',
  `mod_ads_location_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre de la ubicación',
  `mod_ads_location_country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'País de la ubicación',
  `mod_ads_location_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación de la ubicación',
  `mod_ads_location_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización de la ubicación'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ads_performance_metrics`
--

CREATE TABLE `mod_ads_performance_metrics` (
  `mod_ads_metric_id` int NOT NULL COMMENT 'Id único de la métrica',
  `mod_ads_metric_ads_id` int NOT NULL COMMENT 'Id del anuncio asociado (relacionado con mod_ads)',
  `mod_ads_metric_site_id` int NOT NULL COMMENT 'Id del sitio donde se mostró el anuncio (relacionado con mod_ads_sites)',
  `mod_ads_metric_clicks` int DEFAULT '0' COMMENT 'Número de clics',
  `mod_ads_metric_impressions` int DEFAULT '0' COMMENT 'Número de impresiones',
  `mod_ads_metric_conversions` int DEFAULT '0' COMMENT 'Número de conversiones',
  `mod_ads_metric_cost_per_click` decimal(10,2) DEFAULT NULL COMMENT 'Costo por clic',
  `mod_ads_metric_cost_per_conversion` decimal(10,2) DEFAULT NULL COMMENT 'Costo por conversión',
  `mod_ads_metric_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación de la métrica',
  `mod_ads_metric_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización de la métrica'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ads_types`
--

CREATE TABLE `mod_ads_types` (
  `mod_ads_type_id` int NOT NULL COMMENT 'Id único del tipo de anuncio',
  `mod_ads_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del tipo de anuncio (ejemplo: display, video)',
  `mod_ads_type_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del tipo de anuncio',
  `mod_ads_type_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del tipo de anuncio',
  `mod_ads_type_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización del tipo de anuncio'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_calendars`
--

CREATE TABLE `mod_advised_calendars` (
  `mod_adv_cal_id` int NOT NULL,
  `mod_adv_cal_acu_id` int DEFAULT NULL,
  `mod_adv_cal_cou_id` int DEFAULT NULL,
  `mod_adv_cal_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'appointment',
  `mod_adv_cal_date_start` datetime DEFAULT NULL,
  `mod_adv_cal_date_end` datetime DEFAULT NULL,
  `mod_adv_cal_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_cal_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_adv_cal_place` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_cal_reason_cancel` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_cal_reschedule` int DEFAULT NULL,
  `mod_adv_cal_flags` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_cal_ent_id` int DEFAULT NULL,
  `mod_adv_cal_user_id` int DEFAULT NULL,
  `mod_adv_cal_date_register` datetime DEFAULT NULL,
  `mod_adv_cal_state` int NOT NULL DEFAULT '0' COMMENT '0. Eliminado, 1. Activo, 2. cancelado, 3. reagendado, 4. Atendido'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_calendars_blocked`
--

CREATE TABLE `mod_advised_calendars_blocked` (
  `mod_adv_cb_id` int NOT NULL,
  `mod_adv_cb_date_start` datetime NOT NULL,
  `mod_adv_cb_date_end` datetime DEFAULT NULL,
  `mod_adv_cb_ent_id` int DEFAULT NULL,
  `mod_adv_cb_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_counselors`
--

CREATE TABLE `mod_advised_counselors` (
  `mod_adv_cou_acu_id` int NOT NULL,
  `mod_adv_cou_cou_id` int NOT NULL,
  `mod_adv_cou_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_counselors_fields`
--

CREATE TABLE `mod_advised_counselors_fields` (
  `mod_adv_fds_user_id` int NOT NULL,
  `mod_adv_fds_fds_id` int NOT NULL,
  `mod_adv_fds_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_history`
--

CREATE TABLE `mod_advised_history` (
  `mod_adv_his_id` int NOT NULL,
  `mod_adv_his_acu_id` int DEFAULT NULL,
  `mod_adv_his_user_id` int DEFAULT NULL,
  `mod_adv_his_fds_id` int DEFAULT NULL,
  `mod_adv_his_comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_adv_his_date_registration` datetime DEFAULT NULL,
  `mod_adv_his_date_init` datetime DEFAULT NULL,
  `mod_adv_his_date_end` datetime DEFAULT NULL,
  `mod_adv_his_place` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_his_type` int NOT NULL DEFAULT '0' COMMENT '0. normal 1.Fuera de Hora',
  `mod_adv_his_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_history_calendars`
--

CREATE TABLE `mod_advised_history_calendars` (
  `mod_adv_his_cal_cal_id` int NOT NULL,
  `mod_adv_his_cal_his_id` int NOT NULL,
  `mod_adv_his_cal_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_options`
--

CREATE TABLE `mod_advised_options` (
  `mod_adv_opt_id` int NOT NULL,
  `mod_adv_opt_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_adv_opt_value` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_adv_opt_autoload` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'yes'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_schedules`
--

CREATE TABLE `mod_advised_schedules` (
  `mod_adv_sch_id` int NOT NULL,
  `mod_adv_sch_cou_id` int NOT NULL,
  `mod_adv_sch_day` int NOT NULL,
  `mod_adv_sch_hour_start` time NOT NULL,
  `mod_adv_sch_hour_end` time NOT NULL,
  `mod_adv_sch_count` int NOT NULL,
  `mod_adv_sch_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_types_appointments`
--

CREATE TABLE `mod_advised_types_appointments` (
  `mod_adv_tya_id` int NOT NULL,
  `mod_adv_tya_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_tya_summary` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_tya_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_tya_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_tya_color` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_tya_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_adv_tya_ent_id` int DEFAULT NULL,
  `mod_adv_tya_state` int DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_advised_types_appointments`
--

INSERT INTO `mod_advised_types_appointments` (`mod_adv_tya_id`, `mod_adv_tya_name`, `mod_adv_tya_summary`, `mod_adv_tya_type`, `mod_adv_tya_path`, `mod_adv_tya_color`, `mod_adv_tya_json`, `mod_adv_tya_ent_id`, `mod_adv_tya_state`) VALUES
(1, 'Consejeria', NULL, NULL, NULL, NULL, '{\r\n \"listUsers\",\"selectDay\"\r\n}', 1, 1),
(2, 'Otra Actividad', NULL, NULL, NULL, NULL, '{\r\n \"title\",\"selectDates\"\r\n}', 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_advised_user`
--

CREATE TABLE `mod_advised_user` (
  `mod_adv_id` int NOT NULL,
  `mod_adv_fullname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_adv_comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_adv_acu_id` int DEFAULT NULL,
  `mod_adv_fds_id` int DEFAULT NULL,
  `mod_adv_civil_state` int DEFAULT NULL COMMENT '1.Soltero/a 2.Casado/a 3.Divorciado 4.Concuvinato 5. Unión Libre  6. Otro',
  `mod_adv_dependents` int DEFAULT NULL,
  `mod_adv_telf_fax` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_address` varchar(550) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_coordinates` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_labor_status` int DEFAULT NULL COMMENT '1. Dependiente 2.Independiente. 3. Jubilado/rentista. 4.Estudiante 5. Desempleado',
  `mod_adv_company_work` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_address_work` varchar(550) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_work_area` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_profession` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_position` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_fullname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_gender` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_ci` int DEFAULT NULL,
  `mod_adv_spouse_ext` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_birthday` date DEFAULT NULL,
  `mod_adv_spouse_nationality` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_telf_fax` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_cellphone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_labor_status` int DEFAULT NULL,
  `mod_adv_spouse_company_work` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_address_work` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_work_area` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_profession` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_adv_spouse_position` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_appointments_calendars`
--

CREATE TABLE `mod_appointments_calendars` (
  `mod_apt_cal_id` int NOT NULL COMMENT 'Id único de la cita',
  `mod_apt_cal_cpe_id` int NOT NULL COMMENT 'Id customer persona (cliente)',
  `mod_apt_cal_person_id` int NOT NULL COMMENT 'Id de la persona asociada a la cita',
  `mod_apt_cal_acu_id` int NOT NULL COMMENT 'Id persona que se registra',
  `mod_apt_cal_provider_id` int NOT NULL COMMENT 'Id proveedor (cuenta relacionada con el servicio)',
  `mod_apt_cal_srv_id` int NOT NULL COMMENT 'Id del servicio relacionado',
  `mod_apt_cal_sch_id` int NOT NULL COMMENT 'Id del horario asociado',
  `mod_apt_cal_date_start` datetime DEFAULT NULL,
  `mod_apt_cal_date_end` datetime DEFAULT NULL,
  `mod_apt_cal_reschedule` int DEFAULT NULL,
  `mod_apt_cal_reason_cancel` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_apt_cal_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_apt_cal_all_day` tinyint(1) DEFAULT '0' COMMENT 'Indica si la cita es todo el día (0: No, 1: Sí)',
  `mod_apt_cal_place` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Lugar donde se llevará a cabo la cita',
  `mod_apt_cal_guests` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Lista de invitados (almacenados como JSON)',
  `mod_apt_cal_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'pending' COMMENT 'Estado de la cita (pending, confirmed, completed, cancelled)',
  `mod_apt_cal_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Tipo de cita (ejemplo: consulta, revisión, seguimiento)',
  `mod_apt_cal_ent_id` int DEFAULT NULL,
  `mod_apt_cal_user_id` int DEFAULT NULL,
  `mod_apt_cal_flags` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Banderas o indicadores especiales asociados a la cita',
  `mod_apt_cal_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Comentarios o descripción adicional del evento',
  `mod_apt_cal_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación de la cita',
  `mod_apt_cal_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización de la cita',
  `mod_apt_cal_state` int DEFAULT '0' COMMENT 'Estado lógico de la cita (0: inactivo, 1: activo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_appointments_calendars_blocked`
--

CREATE TABLE `mod_appointments_calendars_blocked` (
  `mod_apt_cb_id` int NOT NULL,
  `mod_apt_cb_date_start` datetime NOT NULL,
  `mod_apt_cb_date_end` datetime DEFAULT NULL,
  `mod_apt_cb_ent_id` int DEFAULT NULL,
  `mod_apt_cb_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_appointments_exceptions`
--

CREATE TABLE `mod_appointments_exceptions` (
  `mod_apt_exc_id` int NOT NULL,
  `mod_apt_exc_provider_id` int NOT NULL COMMENT 'Id del proveedor',
  `mod_apt_exc_user_id` int NOT NULL COMMENT 'Id del usuario',
  `mod_apt_exc_date` date NOT NULL COMMENT 'Fecha de la excepción',
  `mod_apt_exc_reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Razón de la excepción',
  `mod_apt_exc_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `mod_apt_exc_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_appointments_logs`
--

CREATE TABLE `mod_appointments_logs` (
  `mod_apt_log_id` int NOT NULL,
  `mod_apt_log_apt_id` int NOT NULL COMMENT 'Id de la cita',
  `mod_apt_log_action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Acción realizada (crear, modificar, cancelar, etc.)',
  `mod_apt_log_changed_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora del cambio',
  `mod_apt_log_changed_by` int NOT NULL COMMENT 'Id del usuario o administrador que realizó el cambio'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_appointments_options`
--

CREATE TABLE `mod_appointments_options` (
  `mod_apt_opt_id` int NOT NULL,
  `mod_apt_opt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_apt_opt_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_apt_opt_autoload` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'yes',
  `mod_apt_opt_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_appointments_payments`
--

CREATE TABLE `mod_appointments_payments` (
  `mod_apt_pay_id` int NOT NULL COMMENT 'Id del pago',
  `mod_apt_pay_apt_id` int NOT NULL,
  `mod_apt_pay_amount` decimal(10,2) NOT NULL,
  `mod_apt_pay_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_apt_pay_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Método de pago credit_card,paypal,stripe,efectivo,qr..',
  `mod_apt_pay_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'pending,failed,completed',
  `mod_apt_pay_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_appointments_reviews`
--

CREATE TABLE `mod_appointments_reviews` (
  `mod_apt_rev_id` int NOT NULL COMMENT 'Id único de la reseña',
  `mod_apt_rev_apt_id` int NOT NULL COMMENT 'Id de la cita asociada',
  `mod_apt_rev_cpe_id` int NOT NULL COMMENT 'Id del cliente que realiza la reseña',
  `mod_apt_rev_provider_id` int NOT NULL COMMENT 'Id del proveedor asociado a la reseña',
  `mod_apt_rev_rating` int DEFAULT NULL COMMENT 'Calificación dada por el cliente (1-5)',
  `mod_apt_rev_comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Comentario opcional del cliente',
  `mod_apt_rev_register_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de registro de la reseña',
  `mod_apt_rev_state` int DEFAULT '0' COMMENT 'Estado de la reseña (activo/inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_appointments_schedules`
--

CREATE TABLE `mod_appointments_schedules` (
  `mod_apt_sch_id` int NOT NULL,
  `mod_apt_sch_provider_id` int NOT NULL COMMENT 'Id del proveedor',
  `mod_apt_sch_user_id` int NOT NULL COMMENT 'Id del usuario',
  `mod_apt_sch_day` tinyint(1) NOT NULL COMMENT 'Día de la semana (1: Lunes, 2: Martes, ..., 7: Domingo)',
  `mod_apt_sch_hour_start` time NOT NULL COMMENT 'Hora de inicio',
  `mod_apt_sch_hour_end` time NOT NULL COMMENT 'Hora de finalización',
  `mod_apt_sch_state` int DEFAULT '0' COMMENT 'Estado (0: Inactivo, 1: Activo)',
  `mod_apt_sch_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `mod_apt_sch_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_appointments_types`
--

CREATE TABLE `mod_appointments_types` (
  `mod_apt_type_id` int NOT NULL COMMENT 'ID único para el tipo de cita',
  `mod_apt_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del tipo de cita',
  `mod_apt_type_summary` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción breve del tipo de cita',
  `mod_apt_type_kind` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Categoría/clasificación del tipo de cita',
  `mod_apt_type_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta asociada a este tipo de cita',
  `mod_apt_type_bg_color` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código de color de fondo para la representación visual de este tipo',
  `mod_apt_type_text_color` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código de color del texto para la representación visual de este tipo',
  `mod_apt_type_border_color` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código de color del borde para la representación visual de este tipo',
  `mod_apt_type_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Configuración adicional en formato JSON',
  `mod_apt_type_ent_id` int DEFAULT NULL COMMENT 'ID de entidad asociada a este tipo de cita',
  `mod_apt_type_state` int DEFAULT '0' COMMENT 'Estado del tipo de cita (0: inactivo, 1: activo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_bi_dim_date`
--

CREATE TABLE `mod_bi_dim_date` (
  `mod_bd_key` int NOT NULL COMMENT 'Clave subrogada (YYYYMMDD)',
  `mod_bd_full_date` date NOT NULL COMMENT 'Fecha completa',
  `mod_bd_day_of_week` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Día de la semana',
  `mod_bd_month_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del mes',
  `mod_bd_year` int DEFAULT NULL COMMENT 'Año'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Dimensión de Tiempo (Usada en Fact Tables)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_bi_dim_vendor`
--

CREATE TABLE `mod_bi_dim_vendor` (
  `mod_bv_key` int NOT NULL COMMENT 'Clave subrogada para la Dimensión de Vendor',
  `mod_bv_vv_id_oltp` int UNSIGNED NOT NULL COMMENT 'ID del Vendor en el sistema transaccional (mod_vv_id)',
  `mod_bv_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del Vendor',
  `mod_bv_current_score` decimal(5,4) DEFAULT NULL COMMENT 'Snapshot del Scorecard de rendimiento (SCD Type 1)',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de carga inicial'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Dimensión de Vendors (Analytics)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_bi_fact_sales`
--

CREATE TABLE `mod_bi_fact_sales` (
  `mod_bfs_id` bigint UNSIGNED NOT NULL COMMENT 'Clave primaria subrogada para rendimiento OLAP',
  `mod_bfs_bd_key` int NOT NULL COMMENT 'Referencia a Dim_Date (mod_bd_key)',
  `mod_bfs_bv_key` int NOT NULL COMMENT 'Referencia a Dim_Vendor (mod_bv_key)',
  `mod_bfs_cc_key` bigint UNSIGNED NOT NULL COMMENT 'Referencia a Dim_Customer/OLTP ID',
  `mod_bfs_ps_key` bigint UNSIGNED NOT NULL COMMENT 'Referencia a Dim_Product/SKU (ID del SKU)',
  `mod_bfs_oi_id_oltp` bigint UNSIGNED NOT NULL COMMENT 'Referencia al Order_Item original (mod_oi_id) para Drill-down',
  `mod_bfs_quantity` int NOT NULL COMMENT 'Cantidad vendida',
  `mod_bfs_gmv` decimal(15,4) NOT NULL COMMENT 'Gross Merchandise Value (Valor Bruto de la venta)',
  `mod_bfs_commission` decimal(15,4) NOT NULL COMMENT 'Comisión retenida por el Marketplace',
  `mod_bfs_net_margin` decimal(15,4) DEFAULT NULL COMMENT 'Margen de ganancia neto',
  `mod_bfs_fulfillment_days` int DEFAULT NULL COMMENT 'Días transcurridos hasta el envío (KPI)',
  `mod_bfs_is_cancelled` tinyint(1) DEFAULT '0' COMMENT 'Flag: 1 si la venta fue cancelada o devuelta'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Fact Table para análisis de GMV y Ventas del Marketplace';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_brands`
--

CREATE TABLE `mod_brands` (
  `mod_brd_id` int NOT NULL,
  `mod_brd_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_brd_img` int DEFAULT NULL,
  `mod_brd_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_campaigns_actions`
--

CREATE TABLE `mod_campaigns_actions` (
  `mod_cpa_act_cpa_id` int NOT NULL,
  `mod_cpa_act_act_id` int NOT NULL,
  `mod_cpa_act_rew` int DEFAULT NULL,
  `mod_cpa_act_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_campaigns_ads`
--

CREATE TABLE `mod_campaigns_ads` (
  `mod_cpa_id` int NOT NULL,
  `mod_cpa_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cpa_description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_cpa_acu_id` int DEFAULT NULL COMMENT 'mod_account_users',
  `mod_cpa_aca_id` int DEFAULT NULL COMMENT '//mod_accounts_ads',
  `mod_cpa_type_customer` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cpa_cpe_id` int DEFAULT NULL,
  `mod_cpa_cen_id` int NOT NULL,
  `mod_cpa_target_init_age` int DEFAULT NULL,
  `mod_cpa_target_end_age` int DEFAULT NULL,
  `mod_cpa_target_gender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cpa_init_date` datetime DEFAULT NULL,
  `mod_cpa_end_date` datetime DEFAULT NULL,
  `mod_cpa_register_date` datetime DEFAULT NULL,
  `mod_cpa_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_cpa_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_candire_campaigns`
--

CREATE TABLE `mod_candire_campaigns` (
  `mod_cnd_cp_id` int NOT NULL,
  `mod_cnd_cp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cnd_cp_description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_cnd_cp_tags` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cnd_cp_acu_id` int DEFAULT NULL COMMENT 'mod_account_users',
  `mod_cnd_cp_type_customer` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cnd_cp_cpe_id` int DEFAULT NULL,
  `mod_cnd_cp_cen_id` int NOT NULL,
  `mod_cnd_cp_target_init_age` int DEFAULT NULL,
  `mod_cnd_cp_target_end_age` int DEFAULT NULL,
  `mod_cnd_cp_target_gender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cnd_cp_init_date` datetime DEFAULT NULL,
  `mod_cnd_cp_end_date` datetime DEFAULT NULL,
  `mod_cnd_cp_register_date` datetime DEFAULT NULL,
  `mod_cnd_cp_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_cnd_cp_user_id` int DEFAULT NULL,
  `mod_cnd_cp_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_carts`
--

CREATE TABLE `mod_carts` (
  `mod_cart_id` int NOT NULL,
  `mod_cart_date` datetime DEFAULT NULL,
  `mod_cart_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cart_acu_id` int NOT NULL,
  `mod_cart_add_id` int DEFAULT NULL,
  `mod_cart_ldz_id` int DEFAULT NULL,
  `mod_cart_details` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cart_payment_method` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cart_invoice_id` int DEFAULT NULL,
  `mod_cart_code_receipts` int DEFAULT NULL COMMENT 'Codigo de Recaudación\r\n',
  `mod_cart_transaction_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cart_gateway_url_payment` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cart_gateway_payment` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cart_gateway_url_invoice` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cart_gateway_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_cart_state` int NOT NULL DEFAULT '0' COMMENT '0 Creada 1 Registrada 2. Pagada 3. Revertida 4. Anulada 4.Eliminada\r\n'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_carts_products`
--

CREATE TABLE `mod_carts_products` (
  `mod_cart_prod_cart_id` int NOT NULL,
  `mod_cart_prod_prod_id` int NOT NULL,
  `mod_cart_prod_price` decimal(20,2) DEFAULT NULL,
  `mod_cart_prod_order` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ccm_messages`
--

CREATE TABLE `mod_ccm_messages` (
  `mod_cm_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del mensaje',
  `mod_cm_thread_id` bigint UNSIGNED NOT NULL COMMENT 'ID de la conversación a la que pertenece',
  `mod_cm_sender_id` bigint UNSIGNED NOT NULL COMMENT 'ID del remitente (Cliente o Vendor/Empleado)',
  `mod_cm_receiver_id` bigint UNSIGNED NOT NULL COMMENT 'ID del receptor (Cliente o Vendor/Empleado)',
  `mod_cm_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Contenido del mensaje',
  `mod_cm_sent_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Marca de tiempo del envío',
  `mod_cm_is_read` tinyint(1) DEFAULT '0' COMMENT 'Indicador de si el mensaje ha sido leído'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Registro detallado de mensajes/chats';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ccm_reviews`
--

CREATE TABLE `mod_ccm_reviews` (
  `mod_cr_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único de la reseña',
  `mod_cr_ps_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID del SKU reseñado (mod_ps_id)',
  `mod_cr_cc_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID del cliente (mod_cc_id)',
  `mod_cr_rating` tinyint(1) DEFAULT NULL COMMENT 'Puntuación (Rating) de 1 a 5',
  `mod_cr_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Contenido de la reseña',
  `mod_cr_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de publicación',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `mod_status` int DEFAULT '1' COMMENT 'Estado (1=aprobada/visible, 0=moderada)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Reseñas y ratings de productos';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ccm_tickets`
--

CREATE TABLE `mod_ccm_tickets` (
  `mod_ct_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del ticket de soporte',
  `mod_ct_cc_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID del cliente (mod_cc_id)',
  `mod_ct_he_id` int UNSIGNED DEFAULT NULL COMMENT 'Referencia al ID del empleado/agente asignado (mod_he_id)',
  `mod_ct_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Categoría del problema (Ej: Logística, Facturación)',
  `mod_ct_subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Asunto del ticket',
  `mod_ct_status` enum('OPEN','IN_PROGRESS','RESOLVED','CLOSED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Estado del ticket',
  `mod_ct_priority` enum('LOW','MEDIUM','HIGH') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Prioridad del ticket',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de apertura',
  `mod_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Sistema de gestión de tickets de soporte';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_classification_info`
--

CREATE TABLE `mod_classification_info` (
  `mod_clsi_id` int NOT NULL,
  `mod_clsi_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_clsi_description` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_clsi_color` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_clsi_file_id` int DEFAULT NULL,
  `mod_clsi_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_competitions`
--

CREATE TABLE `mod_competitions` (
  `mod_cmp_id` int NOT NULL,
  `mod_cmp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_cmp_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cmp_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_cmp_date_init` datetime DEFAULT CURRENT_TIMESTAMP,
  `mod_cmp_date_end` datetime DEFAULT CURRENT_TIMESTAMP,
  `mod_cmp_ent_id` int DEFAULT NULL,
  `mod_cmp_status` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_competitions_accounts`
--

CREATE TABLE `mod_competitions_accounts` (
  `mod_cmp_cmp_id` int NOT NULL,
  `mod_cmp_acu_id` int NOT NULL,
  `mod_cmp_rel` int DEFAULT NULL,
  `mod_cmp_date_register` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_competitions_mira`
--

CREATE TABLE `mod_competitions_mira` (
  `mod_cmp_mira_id` int NOT NULL,
  `mod_cmp_mira_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cmp_mira_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cmp_mira_acu_id` int NOT NULL,
  `mod_cmp_mira_cumple` date DEFAULT NULL,
  `mod_cmp_mira_typeid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de identificación: CI/DNI/Otro',
  `mod_cmp_mira_num_id` varchar(44) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Número de identificación',
  `mod_cmp_mira_nacionalidad` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cmp_mira_direccion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cmp_mira_ciudad` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cmp_mira_pais` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cmp_mira_websocial` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_cmp_mira_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'individual,grupo/colectiva',
  `mod_cmp_mira_nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre artístico / Nombre del colectivo y participante',
  `mod_cmp_mira_incluye` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'si-link\r\nsi-file\r\nno\r\nartista-emergente\r\n',
  `mod_cmp_mira_link_portafolio` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cmp_mira_file_portafolio` int DEFAULT NULL,
  `mod_cmp_mira_titulo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cmp_mira_tipo_proyecto` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '(Fotografía, video, performance, instalación, objeto, escultura, pintura, etc.)',
  `mod_cmp_mira_sintesis` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_cmp_mira_espacio` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '(Tipología, características y dimensiones. Max. 500 caracteres)',
  `mod_cmp_mira_file_id` int DEFAULT NULL COMMENT 'Imágenes, videos y pdf complementario',
  `mod_cmp_mira_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'link video',
  `mod_cmp_mira_file_declaracion` int DEFAULT NULL,
  `mod_cmp_mira_file_ci` int DEFAULT NULL,
  `mod_cmp_mira_informacion` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_cmp_mira_date_register` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_cmp_mira_state` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_contacts`
--

CREATE TABLE `mod_contacts` (
  `mod_con_id` int NOT NULL COMMENT 'ID único del contacto',
  `mod_con_type` enum('lead','prospect','customer','partner','employee','supplier','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'lead' COMMENT 'Tipo de contacto: lead=prospecto nuevo, prospect=prospecto calificado, customer=cliente, partner=socio, employee=empleado, supplier=proveedor',
  `mod_con_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Nombre del contacto',
  `mod_con_lastname_father` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Apellido paterno',
  `mod_con_lastname_mother` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Apellido materno',
  `mod_con_email_primary` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Correo electrónico principal',
  `mod_con_email_secondary` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Correo electrónico secundario',
  `mod_con_dial_code_phone_primary` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Código de país para teléfono principal',
  `mod_con_phone_primary` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Teléfono principal',
  `mod_con_dial_code_phone_secondary` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Código de país para teléfono secundario',
  `mod_con_phone_secondary` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Teléfono secundario',
  `mod_con_company` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Nombre de la empresa donde trabaja el contacto',
  `mod_con_position` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Cargo o posición que ocupa en la empresa',
  `mod_con_avatar_id` int DEFAULT NULL COMMENT 'ID del avatar del contacto',
  `mod_con_website` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Sitio web personal o de la empresa',
  `mod_con_linkedin_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'URL del perfil de LinkedIn del contacto',
  `mod_con_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Dirección física completa',
  `mod_con_city` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Ciudad de residencia',
  `mod_con_country` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'BO' COMMENT 'Código de país ISO 3166-1 alpha-2 (BO=Bolivia)',
  `mod_con_postal_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Código postal',
  `mod_con_source` enum('web','phone','email','referral','social','event','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Fuente de origen del contacto: web=sitio web, phone=llamada telefónica, email=correo, referral=referido, social=redes sociales, event=evento',
  `mod_con_referred_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Nombre de la persona que refirió al contacto (solo si source=referral)',
  `mod_con_status` enum('new','contacted','qualified','converted','lost','active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'new' COMMENT 'Estado del contacto en el CRM: new=nuevo, contacted=contactado, qualified=calificado, converted=convertido a cliente, lost=perdido, active=activo, inactive=inactivo',
  `mod_con_score` tinyint UNSIGNED DEFAULT '0' COMMENT 'Puntuación del lead (0-100) para priorización de seguimiento',
  `mod_con_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Notas y comentarios adicionales sobre el contacto',
  `mod_con_assigned_user_id` int DEFAULT NULL COMMENT 'ID del usuario asignado para dar seguimiento (FK a users)',
  `mod_con_cpe_id` int DEFAULT NULL COMMENT 'ID de cliente persona si fue convertido (FK a mod_customers_persons)',
  `mod_con_cen_id` int DEFAULT NULL COMMENT 'ID de cliente empresa si fue convertido (FK a mod_customers_enterprises)',
  `mod_con_metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'Datos adicionales en formato JSON para campos personalizados',
  `mod_con_last_contact_date` datetime DEFAULT NULL COMMENT 'Fecha de último contacto con el prospecto',
  `mod_con_conversion_date` datetime DEFAULT NULL COMMENT 'Fecha en que el contacto se convirtió en cliente',
  `mod_con_ent_id` int NOT NULL COMMENT 'ID de la entidad/empresa a la que pertenece este contacto',
  `mod_con_state` tinyint DEFAULT '0' COMMENT 'Estado del registro: 0=inactivo, 1=activo, 2=eliminado',
  `mod_con_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora de creación del registro',
  `mod_con_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha y hora de última actualización',
  `mod_con_deleted_by` int DEFAULT NULL COMMENT 'ID del usuario que eliminó el contacto',
  `mod_con_deleted_at` timestamp NULL DEFAULT NULL COMMENT 'Fecha y hora de eliminación del contacto',
  `mod_con_create_user_id` int DEFAULT NULL COMMENT 'ID del usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_crm_activities`
--

CREATE TABLE `mod_crm_activities` (
  `mod_crm_act_id` int NOT NULL COMMENT 'ID único de la actividad',
  `mod_crm_act_type` enum('call','email','meeting','task','note','deadline') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Tipo: call=llamada, email=correo, meeting=reunión, task=tarea, note=nota, deadline=fecha límite',
  `mod_crm_act_subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Asunto o título de la actividad',
  `mod_crm_act_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Descripción detallada de la actividad',
  `mod_crm_act_status` enum('pending','completed','cancelled','overdue') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'pending' COMMENT 'Estado: pending=pendiente, completed=completada, cancelled=cancelada, overdue=vencida',
  `mod_crm_act_priority` enum('low','medium','high','urgent') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'medium' COMMENT 'Prioridad: low=baja, medium=media, high=alta, urgent=urgente',
  `mod_crm_act_due_date` datetime DEFAULT NULL COMMENT 'Fecha y hora de vencimiento de la actividad',
  `mod_crm_act_completed_date` datetime DEFAULT NULL COMMENT 'Fecha y hora en que se completó la actividad',
  `mod_crm_act_duration` smallint UNSIGNED DEFAULT NULL COMMENT 'Duración estimada o real en minutos',
  `mod_crm_act_related_type` enum('contact','opportunity','customer') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Tipo de entidad relacionada: contact, opportunity o customer',
  `mod_crm_act_related_id` int DEFAULT NULL COMMENT 'ID de la entidad relacionada según el tipo',
  `mod_crm_act_assigned_user_id` int DEFAULT NULL COMMENT 'ID del usuario asignado a la actividad (FK a users)',
  `mod_crm_act_reminder` datetime DEFAULT NULL COMMENT 'Fecha y hora para enviar recordatorio',
  `mod_crm_act_ent_id` int NOT NULL COMMENT 'ID de la entidad/empresa propietaria',
  `mod_crm_act_state` tinyint DEFAULT '0' COMMENT 'Estado del registro: 0=activo, 1=archivado, 2=eliminado',
  `mod_crm_act_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora de creación',
  `mod_crm_act_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha y hora de última actualización',
  `mod_crm_act_create_user_id` int DEFAULT NULL COMMENT 'ID del usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_crm_contact_tags`
--

CREATE TABLE `mod_crm_contact_tags` (
  `mod_crm_cta_id` int NOT NULL COMMENT 'ID único de la relación',
  `mod_crm_cta_con_id` int NOT NULL COMMENT 'ID del contacto (FK a mod_contacts)',
  `mod_crm_cta_tag_id` int NOT NULL COMMENT 'ID de la etiqueta (FK a mod_crm_tags)',
  `mod_crm_cta_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora en que se asignó la etiqueta',
  `mod_crm_cta_create_user_id` int DEFAULT NULL COMMENT 'ID del usuario que asignó la etiqueta'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_crm_customers`
--

CREATE TABLE `mod_crm_customers` (
  `mod_cc_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del cliente',
  `mod_cc_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Correo electrónico del cliente',
  `mod_cc_first_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Primer nombre',
  `mod_cc_last_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Apellido',
  `mod_cc_registration_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de registro del cliente',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `mod_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización',
  `mod_status` int DEFAULT '1' COMMENT 'Estado (1=activo, 0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Registro de Clientes (Consumidores Finales)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_crm_custom_fields`
--

CREATE TABLE `mod_crm_custom_fields` (
  `mod_crm_cfi_id` int NOT NULL COMMENT 'ID único del campo personalizado',
  `mod_crm_cfi_entity_type` enum('contact','opportunity','activity') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Tipo de entidad: contact, opportunity o activity',
  `mod_crm_cfi_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Nombre interno del campo (sin espacios, snake_case)',
  `mod_crm_cfi_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Etiqueta visible del campo para el usuario',
  `mod_crm_cfi_type` enum('text','number','date','select','multiselect','checkbox','textarea','email','url','phone') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Tipo de campo',
  `mod_crm_cfi_options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'Opciones disponibles para campos tipo select/multiselect en formato JSON',
  `mod_crm_cfi_required` tinyint(1) DEFAULT '0' COMMENT 'Indica si el campo es obligatorio',
  `mod_crm_cfi_order` smallint UNSIGNED DEFAULT '0' COMMENT 'Orden de visualización del campo en formularios',
  `mod_crm_cfi_validation_rules` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'Reglas de validación adicionales en formato JSON',
  `mod_crm_cfi_ent_id` int NOT NULL COMMENT 'ID de la entidad/empresa propietaria',
  `mod_crm_cfi_state` tinyint DEFAULT '0' COMMENT 'Estado del registro: 0=activo, 1=archivado, 2=eliminado',
  `mod_crm_cfi_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora de creación',
  `mod_crm_cfi_create_user_id` int DEFAULT NULL COMMENT 'ID del usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_crm_custom_field_values`
--

CREATE TABLE `mod_crm_custom_field_values` (
  `mod_crm_cfv_id` int NOT NULL COMMENT 'ID único del valor',
  `mod_crm_cfv_cfi_id` int NOT NULL COMMENT 'ID del campo personalizado (FK a mod_crm_custom_fields)',
  `mod_crm_cfv_entity_id` int NOT NULL COMMENT 'ID de la entidad (contacto, oportunidad o actividad según el tipo de campo)',
  `mod_crm_cfv_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Valor almacenado del campo personalizado',
  `mod_crm_cfv_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora de creación',
  `mod_crm_cfv_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha y hora de última actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_crm_documents`
--

CREATE TABLE `mod_crm_documents` (
  `mod_crm_doc_id` bigint NOT NULL COMMENT 'ID único del documento',
  `mod_crm_doc_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Nombre del archivo',
  `mod_crm_doc_file_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Ruta del archivo en el sistema',
  `mod_crm_doc_file_size` bigint UNSIGNED DEFAULT NULL COMMENT 'Tamaño del archivo en bytes',
  `mod_crm_doc_mime_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Tipo MIME del archivo',
  `mod_crm_doc_related_type` enum('contact','opportunity','activity') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Tipo de entidad relacionada',
  `mod_crm_doc_related_id` int NOT NULL COMMENT 'ID de la entidad relacionada',
  `mod_crm_doc_description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Descripción del documento',
  `mod_crm_doc_user_id` int NOT NULL COMMENT 'ID del usuario que subió el documento (FK a users)',
  `mod_crm_doc_ent_id` int NOT NULL COMMENT 'ID de la entidad/empresa propietaria',
  `mod_crm_doc_state` tinyint DEFAULT '0' COMMENT 'Estado del registro: 0=activo, 1=archivado, 2=eliminado',
  `mod_crm_doc_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora de creación'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_crm_email_templates`
--

CREATE TABLE `mod_crm_email_templates` (
  `mod_crm_emt_id` int NOT NULL COMMENT 'ID único de la plantilla',
  `mod_crm_emt_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Nombre identificador de la plantilla',
  `mod_crm_emt_subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Asunto del email (puede incluir variables como {{first_name}})',
  `mod_crm_emt_body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Cuerpo del email en HTML (puede incluir variables)',
  `mod_crm_emt_variables` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'Lista de variables disponibles en formato JSON (ej: {"first_name": "Nombre del contacto"})',
  `mod_crm_emt_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Categoría de la plantilla (ej: leads, seguimiento, propuestas)',
  `mod_crm_emt_usage_count` int UNSIGNED DEFAULT '0' COMMENT 'Contador de veces que se ha usado la plantilla',
  `mod_crm_emt_ent_id` int NOT NULL COMMENT 'ID de la entidad/empresa propietaria',
  `mod_crm_emt_state` tinyint DEFAULT '0' COMMENT 'Estado del registro: 0=activo, 1=archivado, 2=eliminado',
  `mod_crm_emt_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora de creación',
  `mod_crm_emt_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha y hora de última actualización',
  `mod_crm_emt_create_user_id` int DEFAULT NULL COMMENT 'ID del usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Volcado de datos para la tabla `mod_crm_email_templates`
--

INSERT INTO `mod_crm_email_templates` (`mod_crm_emt_id`, `mod_crm_emt_name`, `mod_crm_emt_subject`, `mod_crm_emt_body`, `mod_crm_emt_variables`, `mod_crm_emt_category`, `mod_crm_emt_usage_count`, `mod_crm_emt_ent_id`, `mod_crm_emt_state`, `mod_crm_emt_created_at`, `mod_crm_emt_updated_at`, `mod_crm_emt_create_user_id`) VALUES
(1, 'Bienvenida Lead', 'Bienvenido {{first_name}} - {{company_name}}', '<p>Hola {{first_name}},</p><p>Gracias por tu interés en nuestros servicios. En {{company_name}} estamos comprometidos con brindarte la mejor solución para tus necesidades.</p><p>Un representante de nuestro equipo se pondrá en contacto contigo pronto.</p><p>Saludos cordiales,<br>{{user_name}}<br>{{user_position}}</p>', '{\"user_name\": \"Nombre del usuario\", \"first_name\": \"Nombre del contacto\", \"company_name\": \"Nombre de la empresa\", \"user_position\": \"Cargo del usuario\"}', 'leads', 0, 1, 0, '2025-10-25 16:35:40', '2025-10-25 16:35:40', 1),
(2, 'Seguimiento', 'Seguimiento - {{company}}', '<p>Hola {{first_name}},</p><p>Me comunico para dar seguimiento a nuestra conversación del {{last_contact_date}}.</p><p>¿Tienes alguna pregunta adicional sobre nuestra propuesta?</p><p>Quedo atento a tus comentarios.</p><p>Saludos cordiales,<br>{{user_name}}</p>', '{\"company\": \"Empresa del contacto\", \"user_name\": \"Nombre del usuario\", \"first_name\": \"Nombre del contacto\", \"last_contact_date\": \"Fecha del último contacto\"}', 'seguimiento', 0, 1, 0, '2025-10-25 16:35:40', '2025-10-25 16:35:40', 1),
(3, 'Propuesta Enviada', 'Propuesta Comercial - {{company}}', '<p>Hola {{first_name}},</p><p>Adjunto encontrarás nuestra propuesta comercial según lo conversado.</p><p>Hemos preparado una solución personalizada que se ajusta a las necesidades de {{company}}.</p><p>Estoy disponible para aclarar cualquier duda.</p><p>Saludos cordiales,<br>{{user_name}}<br>Tel: {{user_phone}}</p>', '{\"company\": \"Empresa del contacto\", \"user_name\": \"Nombre del usuario\", \"first_name\": \"Nombre del contacto\", \"user_phone\": \"Teléfono del usuario\"}', 'propuestas', 0, 1, 0, '2025-10-25 16:35:40', '2025-10-25 16:35:40', 1),
(4, 'Cierre Exitoso', '¡Bienvenido a {{company_name}}!', '<p>Estimado/a {{first_name}},</p><p>¡Es un placer darte la bienvenida como cliente de {{company_name}}!</p><p>Nuestro equipo iniciará el proceso de onboarding en los próximos días.</p><p>Gracias por confiar en nosotros.</p><p>Saludos,<br>{{user_name}}</p>', '{\"user_name\": \"Nombre del usuario\", \"first_name\": \"Nombre del contacto\", \"company_name\": \"Nombre de la empresa\"}', 'cierre', 0, 1, 0, '2025-10-25 16:35:40', '2025-10-25 16:35:40', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_crm_interactions`
--

CREATE TABLE `mod_crm_interactions` (
  `mod_crm_int_id` int NOT NULL COMMENT 'ID único de la interacción',
  `mod_crm_int_type` enum('call','email','meeting','chat','social','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Tipo: call=llamada, email=correo, meeting=reunión, chat=chat, social=red social, other=otro',
  `mod_crm_int_direction` enum('inbound','outbound') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'outbound' COMMENT 'Dirección: inbound=entrante (cliente nos contactó), outbound=saliente (nosotros contactamos)',
  `mod_crm_int_subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Asunto o tema de la interacción',
  `mod_crm_int_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'Contenido o resumen de la interacción',
  `mod_crm_int_duration` smallint UNSIGNED DEFAULT NULL COMMENT 'Duración de la interacción en minutos',
  `mod_crm_int_outcome` enum('successful','unsuccessful','no_answer','follow_up') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Resultado: successful=exitosa, unsuccessful=no exitosa, no_answer=sin respuesta, follow_up=requiere seguimiento',
  `mod_crm_int_con_id` int DEFAULT NULL COMMENT 'ID del contacto con quien se interactúó (FK a mod_contacts)',
  `mod_crm_int_opp_id` int DEFAULT NULL COMMENT 'ID de la oportunidad relacionada si aplica (FK a mod_crm_opportunities)',
  `mod_crm_int_user_id` int NOT NULL COMMENT 'ID del usuario que realizó la interacción (FK a users)',
  `mod_crm_int_ent_id` int NOT NULL COMMENT 'ID de la entidad/empresa propietaria',
  `mod_crm_int_state` tinyint DEFAULT '0' COMMENT 'Estado del registro: 0=activo, 1=archivado, 2=eliminado',
  `mod_crm_int_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora de la interacción',
  `mod_crm_int_create_user_id` int DEFAULT NULL COMMENT 'ID del usuario que creó el registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_crm_notes`
--

CREATE TABLE `mod_crm_notes` (
  `mod_crm_note_id` bigint NOT NULL COMMENT 'ID único de la nota',
  `mod_crm_note_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Contenido de la nota',
  `mod_crm_note_related_type` enum('contact','opportunity','activity') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Tipo de entidad relacionada',
  `mod_crm_note_related_id` int NOT NULL COMMENT 'ID de la entidad relacionada',
  `mod_crm_note_is_pinned` tinyint(1) DEFAULT '0' COMMENT 'Indica si la nota está fijada para destacarla',
  `mod_crm_note_user_id` int NOT NULL COMMENT 'ID del usuario que creó la nota (FK a users)',
  `mod_crm_note_ent_id` int NOT NULL COMMENT 'ID de la entidad/empresa propietaria',
  `mod_crm_note_state` tinyint DEFAULT '0' COMMENT 'Estado del registro: 0=activo, 1=archivado, 2=eliminado',
  `mod_crm_note_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora de creación',
  `mod_crm_note_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha y hora de última actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_customers_enterprises`
--

CREATE TABLE `mod_customers_enterprises` (
  `mod_cen_id` int NOT NULL,
  `mod_cen_cpe_id` int DEFAULT NULL COMMENT 'Customer person Id',
  `mod_cen_ced_id` int DEFAULT NULL COMMENT 'customer data',
  `mod_cen_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cen_username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cen_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cen_email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cen_description` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cen_img` int DEFAULT NULL,
  `mod_cen_register_date` datetime DEFAULT NULL,
  `mod_cen_user_id` int DEFAULT NULL,
  `mod_cen_ent_id` int DEFAULT NULL,
  `mod_cen_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_customers_enterprises`
--

INSERT INTO `mod_customers_enterprises` (`mod_cen_id`, `mod_cen_cpe_id`, `mod_cen_ced_id`, `mod_cen_name`, `mod_cen_username`, `mod_cen_code`, `mod_cen_email`, `mod_cen_description`, `mod_cen_img`, `mod_cen_register_date`, `mod_cen_user_id`, `mod_cen_ent_id`, `mod_cen_state`) VALUES
(1, 0, 1, 'Wappcom', 'wappcom', 'wapp', NULL, '', 0, '2023-01-03 15:50:12', 0, 1, 1),
(2, 0, 2, 'Eurochronos', 'eurochronos', 'euro', NULL, 'Paola Andrea Abudinen	77801315	marketing@eurochronos.com.bo', 0, '2023-01-03 18:08:14', 0, 1, 1),
(3, 0, 3, 'Previsión', 'prevision', 'prevision', NULL, 'Magali Justiniano	70844811	mjustiniano@prevision.com.bo', 0, '2023-01-03 19:55:00', 1, 1, 1),
(4, 0, 4, 'Cenace', 'cenace', 'cenace', NULL, 'Gabriela Roca Aguilera	76600069	gabrielaroca@upsa.edu.bo', 0, '2023-01-03 19:56:14', 0, 1, 1),
(5, 0, 5, 'Casa de Oración', 'casadeoracion', 'casaoracion', NULL, 'Gabriel Rosales Jándula	75001599	gabriel.rosales.j@gmail.com', 0, '2023-01-03 20:07:04', 1, 1, 1),
(6, 0, 6, 'Cabruja Films', 'cabruja', 'cabruja', NULL, 'Jose Luis Cabruja	72121870	jlcabruja@gmail.com	Daniela Gutierrez		dgcabrujafilms@gmail.com', 0, '2023-01-03 20:10:03', 1, 1, 1),
(7, 0, 7, 'Francisco Arce', 'franciscoarce', 'FA001', NULL, 'Francisco Arce 76342483 farcime@gmail.com', 0, '2023-01-03 20:24:58', 1, 1, 1),
(8, 0, 8, 'Chaplin Show', 'chaplinshow', 'CHS-001', NULL, '', 0, '2023-01-03 20:57:24', 1, 1, 1),
(9, 0, 9, 'Candire', 'candire', 'CAN-001', NULL, 'Bernardo Daza +591 67702930 bdaza@candire.net', 0, '2023-06-01 14:53:39', 1, 1, 1),
(10, 0, 10, 'Edadsa', 'edadsa', 'EDA-001', NULL, 'Carlos Lopez clopez@eldia.com.bo  +591 65060735', 0, '2023-09-06 16:45:41', 0, 1, 1),
(11, 0, 11, 'Victoria', 'victoria', 'VIC-001', NULL, 'Luis Fernando Villa	3 348-7070 int 1610 jefesistemas@panaderiavictoria.com', 0, '2023-09-19 09:05:47', 1, 1, 1),
(12, 0, 12, 'Networks Solitions', 'ns', 'ns-1', NULL, '', 0, '2024-09-18 15:26:46', 1, 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_customers_enterprises_data`
--

CREATE TABLE `mod_customers_enterprises_data` (
  `mod_cen_data_id` int NOT NULL,
  `mod_cen_data_cen_id` int NOT NULL,
  `mod_cen_data_business_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cen_data_nit` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cen_data_priority` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nivel\r\nNombre Alternativo\r\nCriterio Principal\r\nAAA\r\nEstratégico\r\nRelación clave y mutua dependencia.\r\nAA\r\nImportante\r\nAlto volumen, bajo riesgo.\r\nA\r\nRecurrente\r\nTicket medio, crecimiento posible.\r\nB\r\nEstándar\r\nTicket bajo, poco potencial.\r\nC\r\nBajo\r\nPuntuales, precio-sensibles.\r\nD\r\nDescartable / Inactivo\r\nNo rentables o problemáticos.\r\n',
  `mod_cen_data_type_contract` int DEFAULT NULL,
  `mod_cen_data_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_customers_enterprises_data`
--

INSERT INTO `mod_customers_enterprises_data` (`mod_cen_data_id`, `mod_cen_data_cen_id`, `mod_cen_data_business_name`, `mod_cen_data_nit`, `mod_cen_data_priority`, `mod_cen_data_type_contract`, `mod_cen_data_json`) VALUES
(1, 2, 'Eurochronos SRL', '150628027', 'AA', 0, ''),
(2, 4, 'Fundación UPSA', '1015227020', 'AA', 0, ''),
(3, 1, 'Wappcom Srl.', '251636025', 'AAA', 0, ''),
(4, 10, 'Edadsa S.A', '150782020', 'AA', 0, '');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_customers_options`
--

CREATE TABLE `mod_customers_options` (
  `mod_cop_id` int NOT NULL COMMENT 'ID único de opción',
  `mod_cop_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre de la opción',
  `mod_cop_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de la opción',
  `mod_cop_autoload` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'yes' COMMENT 'Autoload',
  `mod_cop_date_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `mod_cop_date_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Opciones de clientes';

--
-- Volcado de datos para la tabla `mod_customers_options`
--

INSERT INTO `mod_customers_options` (`mod_cop_id`, `mod_cop_name`, `mod_cop_value`, `mod_cop_autoload`, `mod_cop_date_created`, `mod_cop_date_updated`) VALUES
(1, 'appfnCreate', 'createOrganization', 'yes', '2025-04-16 04:34:48', '2025-04-17 01:07:04'),
(2, 'appCustomerEnterprisePath', '{{_PATH_HOST}}models/class/validme.class.php', 'yes', '2025-04-16 20:39:10', '2025-04-16 20:50:31'),
(3, 'appCustomerEnterpriseClass', 'APP_VALIDME', 'yes', '2025-04-16 20:39:10', '2025-04-16 20:39:10'),
(4, 'appfnGet', 'getCustomerEnterprise', 'yes', '2025-04-17 01:10:31', '2025-04-17 01:13:21'),
(5, 'appfnEdit', 'editCustomerEnterprise', 'yes', '2025-04-17 01:15:30', '2025-04-17 04:39:19'),
(6, 'appfnDelete', 'deleteCustomerEnterprise', 'yes', '2025-04-17 01:15:54', '2025-04-17 01:16:18'),
(7, 'appScriptModule', 'modules/app_validme/components/app_validme.js', 'yes', '2025-04-17 03:33:30', '2025-04-17 04:22:54'),
(8, 'appBtnFnEdit', 'updateCustomerEnterprise', 'yes', '2025-04-17 04:38:53', '2025-04-17 04:38:53'),
(9, 'updateCustomerEnterprise', 'updateCustomerEnterprise', 'yes', '2025-04-17 04:39:47', '2025-04-17 04:39:47'),
(10, 'appfnUpdate', 'updateCustomerEnterprise', 'yes', '2025-04-17 04:46:51', '2025-04-17 04:46:51');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_customers_persons`
--

CREATE TABLE `mod_customers_persons` (
  `mod_cpe_id` int NOT NULL,
  `mod_cpe_acu_id` int DEFAULT NULL,
  `mod_cpe_plan_id` int DEFAULT NULL,
  `mod_cpe_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cpe_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cpe_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cpe_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cpe_phone` int DEFAULT NULL,
  `mod_cpe_ci` int DEFAULT NULL,
  `mod_cpe_ci_complemento` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cpe_adder` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_cpe_register_date` datetime NOT NULL,
  `mod_cpe_user_id` int DEFAULT NULL COMMENT 'usuario que lo registro\r\n',
  `mod_cpe_ent_id` int DEFAULT NULL,
  `mod_cpe_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_departments`
--

CREATE TABLE `mod_departments` (
  `mod_dep_id` int NOT NULL,
  `mod_dep_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_dep_parent_id` int NOT NULL,
  `mod_dep_description` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_dep_ent_id` int NOT NULL,
  `mod_dep_order` int NOT NULL,
  `mod_dep_state` int NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_discount`
--

CREATE TABLE `mod_discount` (
  `mod_dis_id` int NOT NULL,
  `mod_dis_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_dis_detail` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_dis_rate` int DEFAULT NULL,
  `mod_dis_start_date` datetime DEFAULT NULL,
  `mod_dis_end_date` datetime DEFAULT NULL,
  `mod_dis_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_discount_products`
--

CREATE TABLE `mod_discount_products` (
  `mod_dis_prod_dis_id` int NOT NULL,
  `mod_dis_prod_prod_id` int NOT NULL,
  `mod_dis_prod_orden` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_events`
--

CREATE TABLE `mod_events` (
  `mod_eve_id` int NOT NULL,
  `mod_eve_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_description` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_eve_register_date` datetime DEFAULT NULL,
  `mod_eve_user_id` int DEFAULT NULL,
  `mod_eve_init_date` datetime DEFAULT NULL,
  `mod_eve_end_date` datetime DEFAULT NULL,
  `mod_eve_img_small` int DEFAULT NULL,
  `mod_eve_img_medium` int DEFAULT NULL,
  `mod_eve_img_large` int DEFAULT NULL,
  `mod_eve_seats` int DEFAULT NULL,
  `mod_eve_hall` int DEFAULT NULL,
  `mod_eve_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_eve_cost_seat` decimal(21,2) DEFAULT NULL,
  `mod_eve_coin` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Bs',
  `mod_eve_ent_id` int DEFAULT NULL,
  `mod_eve_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_events_halls`
--

CREATE TABLE `mod_events_halls` (
  `mod_eve_hall_id` int NOT NULL,
  `mod_eve_hall_ent_id` int NOT NULL,
  `mod_eve_hall_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_hall_details` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_eve_hall_url_draw_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_hall_fn_js_draw` varchar(440) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_hall_num_tables` int DEFAULT NULL,
  `mod_eve_hall_num_seats` int DEFAULT NULL,
  `mod_eve_hall_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_hall_city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_hall_country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_hall_coord` varchar(440) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_hall_user_id` int DEFAULT NULL,
  `mod_eve_hall_register_date` datetime DEFAULT NULL,
  `mod_eve_hall_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_events_options`
--

CREATE TABLE `mod_events_options` (
  `mod_eve_option_id` int NOT NULL,
  `mod_eve_option_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_option_value` int DEFAULT NULL,
  `mod_eve_option_autoload` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_events_tickets`
--

CREATE TABLE `mod_events_tickets` (
  `mod_eve_tck_id` int NOT NULL,
  `mod_eve_tck_eve_id` int DEFAULT NULL,
  `mod_eve_tck_hall_id` int DEFAULT NULL,
  `mod_eve_tck_table_id` int DEFAULT NULL COMMENT 'mesa id',
  `mod_eve_tck_seat_id` int DEFAULT NULL,
  `mod_eve_tck_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_tck_ref` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'reference',
  `mod_eve_tck_reserve_id` int NOT NULL,
  `mod_eve_tck_acp_id` int DEFAULT NULL COMMENT 'mod_accounting_plan id\r\n',
  `mod_eve_tck_cpe_id` int DEFAULT NULL,
  `mod_eve_tck_date_register` datetime DEFAULT NULL,
  `mod_eve_tck_cost` decimal(22,2) DEFAULT NULL,
  `mod_eve_tck_coin` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_eve_tck_user_id` int NOT NULL,
  `mod_eve_tck_pay_tx_id` int DEFAULT NULL COMMENT 'mod_pay_tx_tck_id of mod_payments_tx_tickets',
  `mod_eve_tck_date_pay_register` datetime DEFAULT NULL,
  `mod_eve_tck_txr` int DEFAULT NULL COMMENT 'id_transaccion pasarela',
  `mod_eve_tck_state` int NOT NULL DEFAULT '0' COMMENT '// State 0:Libre, 1.temp 2:Recervado, 3: Vendido, 4:Anulado, 5:Cancelado  Null : sin estado '
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_external_docs_options`
--

CREATE TABLE `mod_external_docs_options` (
  `mod_edc_opt_id` int NOT NULL,
  `mod_edc_opt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_edc_opt_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_edc_opt_ent_id` int NOT NULL,
  `mod_edc_opt_autoload` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_external_docs_page_design`
--

CREATE TABLE `mod_external_docs_page_design` (
  `mod_edc_pd_id` int NOT NULL,
  `mod_edc_pd_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_edc_pd_url` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_edc_pd_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_edc_pd_ent_id` int DEFAULT NULL,
  `mod_edc_pd_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_external_docs_templates`
--

CREATE TABLE `mod_external_docs_templates` (
  `mod_edc_tpl_id` int NOT NULL,
  `mod_edc_tpl_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_edc_tpl_description` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_edc_tpl_code` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_edc_tpl_tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_edc_tpl_type_id` int DEFAULT NULL COMMENT 'mod_external_docs_types',
  `mod_edc_tpl_pd_id` int DEFAULT NULL COMMENT 'mod_external_docs_page_design',
  `mod_edc_tpl_body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_edc_tpl_register_user_id` int DEFAULT NULL,
  `mod_edc_tpl_register_date` datetime DEFAULT NULL,
  `mod_edc_tpl_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_edc_tpl_ent_id` int DEFAULT NULL,
  `mod_edc_tpl_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_external_docs_types`
--

CREATE TABLE `mod_external_docs_types` (
  `mod_edc_type_id` int NOT NULL,
  `mod_edc_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_edc_type_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_edc_type_parent_id` int NOT NULL,
  `mod_edc_type_ent_id` int NOT NULL,
  `mod_edc_type_color` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_edc_type_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_fss_payouts`
--

CREATE TABLE `mod_fss_payouts` (
  `mod_fp_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del pago a vendor',
  `mod_fp_vv_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID del vendedor (mod_vv_id)',
  `mod_fp_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de ejecución del pago',
  `mod_fp_amount` decimal(15,4) NOT NULL COMMENT 'Monto total pagado',
  `mod_fp_status` enum('PENDING','PROCESSING','SUCCESS','FAILED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Estado de la transferencia bancaria',
  `mod_fp_gt_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID de la transacción GL (mod_gt_id) para el egreso contable',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Transferencias financieras ejecutadas a Vendors';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_fss_vendor_balance`
--

CREATE TABLE `mod_fss_vendor_balance` (
  `mod_fvb_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del movimiento de saldo',
  `mod_fvb_vv_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID del vendedor (mod_vv_id)',
  `mod_fvb_source_id` bigint UNSIGNED NOT NULL COMMENT 'ID de la entidad origen (e.g., Order_Item_ID, Refund_ID)',
  `mod_fvb_source_type` enum('SALE','COMMISSION','REFUND','PAYOUT','ADJUSTMENT') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de evento que afecta el saldo',
  `mod_fvb_signed_amount` decimal(15,4) NOT NULL COMMENT 'Monto con signo (+ a favor del vendor, - en contra)',
  `mod_fvb_fp_id` bigint UNSIGNED DEFAULT NULL COMMENT 'ID del Payout en el que este movimiento fue liquidado (NULL si es pendiente)',
  `mod_fvb_timestamp` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Momento del evento'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Sub-Ledger de movimientos de saldo pendiente/liquidado del Vendor';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ganador_ganaderos`
--

CREATE TABLE `mod_ganador_ganaderos` (
  `mod_ggd_id` int NOT NULL,
  `mod_ggd_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_ggd_acu_id` int DEFAULT NULL,
  `mod_ggd_perfil` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_ggd_img_id` int DEFAULT NULL,
  `mod_ggd_dial` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '+591',
  `mod_ggd_celular` int DEFAULT NULL,
  `mod_ggd_user_id` int DEFAULT NULL,
  `mod_ggd_date_register` datetime DEFAULT NULL,
  `mod_ggd_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ganador_ganaderos_propiedades`
--

CREATE TABLE `mod_ganador_ganaderos_propiedades` (
  `mod_ggp_ggd_id` int NOT NULL COMMENT 'ganaderos id',
  `mod_ggp_gpr_id` int NOT NULL COMMENT 'propiedades id',
  `mod_ggp_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ganador_propiedades`
--

CREATE TABLE `mod_ganador_propiedades` (
  `mod_gpr_id` int NOT NULL,
  `mod_gpr_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_gpr_description` varchar(550) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_gpr_ubicacion` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_gpr_coord` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_gpr_cover_id` int DEFAULT NULL COMMENT 'imagen portada',
  `mod_gpr_video` int DEFAULT NULL,
  `mod_gpr_date_register` int NOT NULL,
  `mod_gpr_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ganador_propiedades_files`
--

CREATE TABLE `mod_ganador_propiedades_files` (
  `mod_gpf_file_id` int NOT NULL,
  `mod_gpf_gpr_id` int NOT NULL,
  `mod_gpf_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ganador_propiedades_images`
--

CREATE TABLE `mod_ganador_propiedades_images` (
  `mod_gpi_img_id` int NOT NULL,
  `mod_gpi_gpr_id` int NOT NULL,
  `mod_gpi_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_ganador_proyectos`
--

CREATE TABLE `mod_ganador_proyectos` (
  `mod_gp_id` int NOT NULL,
  `mod_gp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_gp_description` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'explicación corta del proyecto',
  `mod_gp_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'explicación larga del proyecto',
  `mod_gp_ggd_id` int NOT NULL DEFAULT '0' COMMENT 'ganadero id',
  `mod_gp_gpr_id` int NOT NULL COMMENT 'propiedad id',
  `mod_gp_rentabilidad` decimal(10,2) DEFAULT NULL COMMENT '10,5%',
  `mod_gp_periodo` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_gp_date_end_captacion` datetime DEFAULT NULL,
  `mod_gp_ticket_inversion` int DEFAULT '500' COMMENT 'ticket de inversión inicial de 500.00Bs',
  `mod_gp_size_lote` int NOT NULL DEFAULT '0' COMMENT 'numero de cabezas',
  `mod_gp_recaudacion_prevista` int NOT NULL DEFAULT '0' COMMENT 'multiplos de 500',
  `mod_gp_date_register` datetime DEFAULT NULL,
  `mod_gp_user_id` int NOT NULL DEFAULT '0',
  `mod_gp_state` int NOT NULL DEFAULT '0' COMMENT '0. No activo\r\n1. Disponible\r\n2. En ejecución\r\n3. Finalizado\r\n4. Cancelado\r\n5. De Baja'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_gl_accounts`
--

CREATE TABLE `mod_gl_accounts` (
  `mod_gl_id` int UNSIGNED NOT NULL COMMENT 'Identificador único de cuenta contable',
  `mod_gl_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Código de cuenta estandarizado (Ej: 1000, 2100)',
  `mod_gl_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre descriptivo de la cuenta',
  `mod_gl_type` enum('ASSET','LIABILITY','EQUITY','REVENUE','EXPENSE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Clasificación contable principal',
  `mod_gl_parent_id` int UNSIGNED DEFAULT NULL COMMENT 'ID de la cuenta padre para la jerarquía',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `mod_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización',
  `mod_status` int DEFAULT '1' COMMENT 'Estado (1=activo, 0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Catálogo de Cuentas (Chart of Accounts)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_gl_entries`
--

CREATE TABLE `mod_gl_entries` (
  `mod_ge_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del asiento contable detallado',
  `mod_ge_gt_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID de la transacción (mod_gt_id)',
  `mod_ge_gl_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID de la cuenta contable afectada (mod_gl_id)',
  `mod_ge_type` enum('DEBIT','CREDIT') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de movimiento (DEBITO o CREDITO)',
  `mod_ge_amount` decimal(15,4) NOT NULL COMMENT 'Monto absoluto (siempre positivo)',
  `mod_ge_date` datetime NOT NULL COMMENT 'Fecha y hora de registro del asiento',
  `mod_ge_module` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Módulo que insertó el asiento (e.g., OMS, FSS)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Asientos contables inmutables (Journal Entries)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_gl_transactions`
--

CREATE TABLE `mod_gl_transactions` (
  `mod_gt_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único de la transacción de negocio',
  `mod_gt_source_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Módulo o tipo de documento que originó la transacción (e.g., ORDER, PAYOUT)',
  `mod_gt_source_id` bigint UNSIGNED NOT NULL COMMENT 'ID del documento de origen (e.g., ID de la Orden o ID del Payout)',
  `mod_gt_date` datetime NOT NULL COMMENT 'Fecha y hora de la transacción',
  `mod_gt_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del evento transaccional',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Eventos de negocio que generan movimientos contables';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_hrm_employees`
--

CREATE TABLE `mod_hrm_employees` (
  `mod_he_id` int UNSIGNED NOT NULL COMMENT 'Identificador único del empleado',
  `mod_he_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Código de identificación interna del empleado',
  `mod_he_first_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del empleado',
  `mod_he_last_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Apellido del empleado',
  `mod_he_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Correo electrónico corporativo',
  `mod_he_dept_id` int UNSIGNED DEFAULT NULL COMMENT 'ID del departamento actual',
  `mod_he_hire_date` date NOT NULL COMMENT 'Fecha de contratación',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `mod_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización',
  `mod_status` int DEFAULT '1' COMMENT 'Estado (1=activo, 0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Información del Recurso Humano y Empleados (Auditoría)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_hrm_positions`
--

CREATE TABLE `mod_hrm_positions` (
  `mod_hp_id` int UNSIGNED NOT NULL COMMENT 'Identificador único de la posición',
  `mod_hp_employee_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID del empleado (mod_he_id)',
  `mod_hp_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Título del puesto (Ej: Gerente de Finanzas)',
  `mod_hp_start_date` date NOT NULL COMMENT 'Fecha de inicio en el puesto'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Historial de puestos y posiciones de empleados';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_inventory_options`
--

CREATE TABLE `mod_inventory_options` (
  `mod_inv_opt_id` int NOT NULL,
  `mod_inv_opt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_inv_opt_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_inv_opt_autoload` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_inv_opt_ent_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_inventory_options`
--

INSERT INTO `mod_inventory_options` (`mod_inv_opt_id`, `mod_inv_opt_name`, `mod_inv_opt_value`, `mod_inv_opt_autoload`, `mod_inv_opt_ent_id`) VALUES
(1, 'routeCategoryId', '3', '', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_inventory_units`
--

CREATE TABLE `mod_inventory_units` (
  `mod_inv_unt_id` int NOT NULL,
  `mod_inv_unt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_inv_unt_summary` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_inv_unt_vars` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_inv_unt_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_invoices`
--

CREATE TABLE `mod_invoices` (
  `mod_inv_id` int NOT NULL,
  `mod_inv_px_id` int NOT NULL COMMENT 'Id del pago relacionado',
  `mod_inv_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_inv_total` decimal(10,2) NOT NULL,
  `mod_inv_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending',
  `mod_inv_register_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_inv_user_id` int NOT NULL,
  `mod_inv_ent_id` int NOT NULL,
  `mod_inv_custom_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `mod_inv_class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_inv_custom_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_inv_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_jobtitle`
--

CREATE TABLE `mod_jobtitle` (
  `mod_jbt_id` int NOT NULL,
  `mod_jbt_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_jbt_description` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_jbt_parent_id` int NOT NULL,
  `mod_jpt_duties_manual` int NOT NULL,
  `mod_jbt_ent_id` int NOT NULL,
  `mod_jbt_order` int NOT NULL,
  `mod_jbt_state` int NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_kardex`
--

CREATE TABLE `mod_kardex` (
  `mod_kdx_id` int NOT NULL,
  `mod_kdx_user_id` int NOT NULL,
  `mod_kdx_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_fathers_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_mothers_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_ent_id` int DEFAULT NULL,
  `mod_kdx_entry_date` date DEFAULT NULL,
  `mod_kdx_ci` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_ci_extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_ci_expiration_date` date DEFAULT NULL,
  `mod_kdx_drivers_licence_expiration_date` date DEFAULT NULL,
  `mod_kdx_birth_date` date DEFAULT NULL,
  `mod_kdx_nationality` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_birth_place` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_sex` int DEFAULT NULL COMMENT '2 Masculino, 1 Femenino, 3. Otros',
  `mod_kdx_civil_status` int DEFAULT NULL COMMENT '0.single 1.married 2.divorced 3.widowed',
  `mod_kdx_dates_contact` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_kdx_phone_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_phone_corp` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_phone_corp_ext` int DEFAULT NULL,
  `mod_kdx_personal_mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_corp_mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_personal_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_corp_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_coordinates` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_nro_cns` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_nro_afp` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_afp` int DEFAULT NULL,
  `mod_kdx_shirt_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_pant_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_boot_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_blood_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_removal_date` date DEFAULT NULL,
  `mod_kdx_cod_sap` int DEFAULT NULL,
  `mod_kdx_cv_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_workhours` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_kdx_trash` int DEFAULT NULL,
  `mod_kdx_state` int DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_kardex_jobtitle`
--

CREATE TABLE `mod_kardex_jobtitle` (
  `mod_kdx_jbt_jbt_id` int NOT NULL,
  `mod_kdx_jbt_kdx_id` int NOT NULL,
  `mod_kdx_jbt_ent_id` int NOT NULL,
  `mod_kdx_jbt_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_leagues`
--

CREATE TABLE `mod_leagues` (
  `mod_lg_id` int NOT NULL,
  `mod_lg_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_lg_description` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_lg_sport` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_lg_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_lg_ent_id` int DEFAULT NULL,
  `mod_lg_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_leagues`
--

INSERT INTO `mod_leagues` (`mod_lg_id`, `mod_lg_name`, `mod_lg_description`, `mod_lg_sport`, `mod_lg_json`, `mod_lg_ent_id`, `mod_lg_state`) VALUES
(1, 'prueba', '', '', '', 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_leagues_divisions`
--

CREATE TABLE `mod_leagues_divisions` (
  `mod_lg_div_id` int NOT NULL,
  `mod_lg_div_lg_id` int DEFAULT NULL COMMENT 'Id league',
  `mod_lg_div_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_lg_div_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_lg_div_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_lg_div_state` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_leagues_divisions`
--

INSERT INTO `mod_leagues_divisions` (`mod_lg_div_id`, `mod_lg_div_lg_id`, `mod_lg_div_name`, `mod_lg_div_description`, `mod_lg_div_json`, `mod_lg_div_state`) VALUES
(1, 1, 'division 1', '', '', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_leagues_divisions_teams`
--

CREATE TABLE `mod_leagues_divisions_teams` (
  `mod_lg_div_tm_div_id` int NOT NULL,
  `mod_lg_div_tm_tm_id` int NOT NULL,
  `mod_lg_div_tm_order` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_logistics_distribution_move`
--

CREATE TABLE `mod_logistics_distribution_move` (
  `mod_log_dtz_id` int NOT NULL,
  `mod_log_dtz_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_log_dtz_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_log_dtz_perimetrer` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_log_dtz_cost` decimal(20,2) NOT NULL,
  `mod_log_dtz_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_logistics_distribution_zone`
--

CREATE TABLE `mod_logistics_distribution_zone` (
  `mod_log_dtz_id` int NOT NULL,
  `mod_log_dtz_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_log_dtz_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_log_dtz_perimetrer` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_log_dtz_cost` decimal(20,2) NOT NULL,
  `mod_log_dtz_state` int DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_make`
--

CREATE TABLE `mod_make` (
  `mod_mak_id` int NOT NULL,
  `mod_mak_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_mak_description` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_mak_img_id` int NOT NULL,
  `mod_mak_state` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_management`
--

CREATE TABLE `mod_management` (
  `mod_mag_id` int NOT NULL,
  `mod_mag_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_mag_description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_mag_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_oms_fulfillments`
--

CREATE TABLE `mod_oms_fulfillments` (
  `mod_of_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único de la unidad de cumplimiento',
  `mod_of_oi_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID de la partida de orden (mod_oi_id)',
  `mod_of_ww_id` int UNSIGNED DEFAULT NULL COMMENT 'ID del almacén asignado para fulfillment (si aplica WMS interno)',
  `mod_of_status` enum('PENDING','PICKING','PACKED','SHIPPED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Estado logístico de esta unidad',
  `mod_of_date_assigned` datetime DEFAULT NULL COMMENT 'Fecha de asignación al almacén/vendor',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Unidad de Cumplimiento (una por item/vendor)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_oms_orders`
--

CREATE TABLE `mod_oms_orders` (
  `mod_oo_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único de la orden de cliente',
  `mod_oo_cc_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID del cliente (mod_cc_id)',
  `mod_oo_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha y hora de creación de la orden',
  `mod_oo_shipping_addr_id` bigint UNSIGNED NOT NULL COMMENT 'ID de la dirección de envío del cliente',
  `mod_oo_total_amount` decimal(15,4) NOT NULL COMMENT 'Monto total de la orden',
  `mod_oo_status` enum('PENDING','PROCESSING','SHIPPED','DELIVERED','CANCELLED','REFUNDED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Estado actual de la orden',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `mod_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Cabecera de la Orden de Cliente';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_oms_order_items`
--

CREATE TABLE `mod_oms_order_items` (
  `mod_oi_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único de la partida/item de la orden',
  `mod_oi_oo_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID de la orden (mod_oo_id)',
  `mod_oi_ps_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID del SKU (mod_ps_id)',
  `mod_oi_vv_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID del vendedor responsable',
  `mod_oi_quantity` int NOT NULL COMMENT 'Cantidad de este SKU comprado',
  `mod_oi_price_snap` decimal(15,4) NOT NULL COMMENT 'Precio unitario inmutable al momento de la compra (Snapshot)',
  `mod_oi_commission_rule_id` int UNSIGNED DEFAULT NULL COMMENT 'ID de la regla de comisión aplicada',
  `mod_oi_commission_calc` decimal(15,4) DEFAULT NULL COMMENT 'Monto de la comisión calculado para este item',
  `mod_oi_status` enum('PENDING','FULFILLED','CANCELLED','RETURNED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Estado específico de este item',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Detalle de las partidas de la Orden (Incluye Snapshot)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_oms_refunds`
--

CREATE TABLE `mod_oms_refunds` (
  `mod_orf_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del reembolso financiero',
  `mod_orf_or_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID de la devolución (mod_or_id)',
  `mod_orf_amount` decimal(15,4) NOT NULL COMMENT 'Monto total reembolsado al cliente',
  `mod_orf_gt_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID de la transacción GL (mod_gt_id) para el asiento contable',
  `mod_orf_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de ejecución del reembolso',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Transacción financiera de Reembolso';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_oms_returns`
--

CREATE TABLE `mod_oms_returns` (
  `mod_or_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único de la solicitud de devolución',
  `mod_or_oi_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID de la partida de orden a devolver (mod_oi_id)',
  `mod_or_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de solicitud de la devolución',
  `mod_or_reason` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Motivo de la devolución',
  `mod_or_quantity` int NOT NULL COMMENT 'Cantidad de ítems a devolver',
  `mod_or_status` enum('REQUESTED','APPROVED','SHIPPED','RECEIVED','REJECTED','REFUNDED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Estado de la devolución',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Gestión de Solicitudes de Devolución (Returns)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_oms_shipments`
--

CREATE TABLE `mod_oms_shipments` (
  `mod_os_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del envío físico',
  `mod_os_of_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID de la unidad de cumplimiento (mod_of_id)',
  `mod_os_tracking_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Código de seguimiento del courier',
  `mod_os_courier` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del servicio de paquetería (Ej: FedEx, DHL)',
  `mod_os_cost` decimal(10,2) DEFAULT NULL COMMENT 'Costo de envío',
  `mod_os_delivery_date_est` date DEFAULT NULL COMMENT 'Fecha estimada de entrega',
  `mod_os_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Último estado de tracking reportado',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Entidad física del Envío y Tracking';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_organization_chart`
--

CREATE TABLE `mod_organization_chart` (
  `mod_orc_id` int NOT NULL,
  `mod_orc_position` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_orc_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_orc_functions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_orc_doc_id` int DEFAULT NULL COMMENT 'rel functions',
  `mod_orc_location` int NOT NULL,
  `mod_orc_reports_to` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id,id,id',
  `mod_orc_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_orc_user_id` int NOT NULL COMMENT 'id register',
  `mod_orc_date_register` datetime DEFAULT NULL,
  `mod_orc_ent_id` int DEFAULT NULL,
  `mod_orc_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_organization_chart_rel`
--

CREATE TABLE `mod_organization_chart_rel` (
  `mod_orc_rel_orc_id` int NOT NULL,
  `mod_orc_rel_user_id` int NOT NULL,
  `mod_orc_rel_kdx_id` int DEFAULT NULL,
  `mod_orc_rel_date_register` date DEFAULT NULL,
  `mod_orc_rel_order` int DEFAULT NULL,
  `mod_org_rel_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pay_tx_suscriptions`
--

CREATE TABLE `mod_pay_tx_suscriptions` (
  `mod_pay_tx_sbs_id` bigint NOT NULL,
  `mod_pay_tx_sbs_acu_id` bigint DEFAULT NULL COMMENT 'cuenta de usuario',
  `mod_pay_tx_sbs_cpe_id` bigint DEFAULT NULL,
  `mod_pay_tx_sbs_pay` decimal(22,2) DEFAULT NULL,
  `mod_pay_tx_sbs_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_pay_tx_sbs_coin` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_pay_tx_sbs_rs` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'razon social, ci',
  `mod_pay_tx_sbs_nit` bigint DEFAULT NULL,
  `mod_pay_tx_invoice` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'no-facturado' COMMENT 'facturado, no-facturado',
  `mod_pay_tx_num_invoice` bigint DEFAULT '0',
  `mod_pay_tx_sbs_mode` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_pay_tx_sbs_txr` bigint DEFAULT NULL COMMENT 'id transaccion',
  `mod_pay_tx_sbs_date_pay_register` datetime DEFAULT CURRENT_TIMESTAMP,
  `mod_pay_tx_sbs_callback` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_sbs_mail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_sbs_user_id` bigint DEFAULT NULL,
  `mod_pay_tx_sbs_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_sbs_return` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_sbs_register_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_pay_tx_sbs_qr_state` int DEFAULT '0' COMMENT '0. sin usar 1. usado',
  `mod_pay_tx_sbs_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pay_tx_temp`
--

CREATE TABLE `mod_pay_tx_temp` (
  `mod_pay_tx_tmp_id` int NOT NULL,
  `mod_pay_tx_tmp_acu_id` int NOT NULL,
  `mod_pay_tx_tmp_cpe_id` int NOT NULL,
  `mod_pay_tx_tmp_code` int NOT NULL,
  `mod_pay_tx_tmp_entitie` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'banco, pasarela',
  `mod_pay_tx_tmp_ent_id` int NOT NULL,
  `mod_pay_tx_tmp_mode` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_pay_tx_tmp_register_date` datetime NOT NULL,
  `mod_pay_tx_tmp_nit` bigint NOT NULL,
  `mod_pay_tx_tmp_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_tmp_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_tmp_state` int NOT NULL DEFAULT '0' COMMENT '0. agregado 1.pagado 2. con error \r\n'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pay_tx_tickets`
--

CREATE TABLE `mod_pay_tx_tickets` (
  `mod_pay_tx_tck_id` int NOT NULL,
  `mod_pay_tx_tck_acp_id` int DEFAULT NULL,
  `mod_pay_tx_tck_cpe_id` int NOT NULL,
  `mod_pay_tx_tck_eve_id` int NOT NULL,
  `mod_pay_tx_tck_reserve_id` int NOT NULL,
  `mod_pay_tx_tck_pay` decimal(22,2) NOT NULL DEFAULT '0.00',
  `mod_pay_tx_tck_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_pay_tx_tck_coin` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_pay_tx_tck_rs` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'razon social',
  `mod_pay_tx_tck_nit` int DEFAULT NULL,
  `mod_pay_tx_tck_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_pay_tx_tck_txr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'id transaccion',
  `mod_pay_tx_tck_date_pay_register` datetime NOT NULL,
  `mod_pay_tx_tck_callback` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_tck_mail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_tck_user_id` int NOT NULL DEFAULT '0',
  `mod_pay_tx_tck_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_tck_return` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_pay_tx_tck_register_date` datetime DEFAULT NULL,
  `mod_pay_tx_tck_state` int NOT NULL DEFAULT '0' COMMENT '0. Iniciado, 2.registrado, 3.Active/pagado, 4.Anulado 5.Delete'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_persons`
--

CREATE TABLE `mod_persons` (
  `mod_person_id` int NOT NULL COMMENT 'Id único de la persona',
  `mod_person_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre de la persona',
  `mod_person_lastname_father` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Apellido paterno de la persona',
  `mod_person_lastname_mother` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Apellido materno de la persona',
  `mod_person_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Correo electrónico de la persona',
  `mod_person_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Teléfono de contacto',
  `mod_person_ent_id` int NOT NULL COMMENT 'Id de la entidad asociada',
  `mod_person_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Id del tipo de persona',
  `mod_person_state` int DEFAULT '0' COMMENT 'Estado lógico de la persona (0: inactivo, 1: activo)',
  `mod_person_comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Campo para comentarios adicionales sobre la persona',
  `mod_person_metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'Campo para datos adicionales en formato JSON',
  `mod_person_custom_class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Clase CSS personalizada asociada a la persona',
  `mod_person_custom_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ID personalizado asociado a la persona',
  `mod_person_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `mod_person_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_persons_types`
--

CREATE TABLE `mod_persons_types` (
  `mod_person_type_id` int NOT NULL COMMENT 'Id único del tipo de persona',
  `mod_person_type_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Código único para identificar el tipo',
  `mod_person_type_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre descriptivo del tipo',
  `mod_person_type_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción detallada del tipo',
  `mod_person_type_metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'Datos adicionales en formato JSON',
  `mod_person_type_state` int DEFAULT '1' COMMENT 'Estado lógico del tipo (0: inactivo, 1: activo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_persons_types`
--

INSERT INTO `mod_persons_types` (`mod_person_type_id`, `mod_person_type_code`, `mod_person_type_name`, `mod_person_type_description`, `mod_person_type_metadata`, `mod_person_type_state`) VALUES
(1, 'LEAD', 'Lead', 'Posible cliente potencial', NULL, 1),
(2, 'CUSTOMER', 'Cliente', 'Cliente activo', NULL, 1),
(3, 'PROVIDER', 'Proveedor', 'Proveedor de servicios o productos', NULL, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_attributes`
--

CREATE TABLE `mod_pim_attributes` (
  `mod_pa_id` int UNSIGNED NOT NULL COMMENT 'Identificador único del atributo',
  `mod_pa_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Código interno del atributo (Ej: COLOR, RAM, MATERIAL)',
  `mod_pa_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del atributo',
  `mod_pa_data_type` enum('TEXT','NUMERIC','BOOLEAN','DATE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de dato del valor almacenado',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Definición de atributos dinámicos (EAV)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_attribute_values`
--

CREATE TABLE `mod_pim_attribute_values` (
  `mod_pv_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del valor de atributo',
  `mod_pv_ps_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID del SKU (mod_ps_id)',
  `mod_pv_pa_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID del atributo (mod_pa_id)',
  `mod_pv_text_value` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor del atributo si es de tipo TEXT',
  `mod_pv_numeric_value` decimal(15,4) DEFAULT NULL COMMENT 'Valor del atributo si es de tipo NUMERIC',
  `mod_pv_unit_of_measure` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Unidad de medida (e.g., "GB", "cm")'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Valores de atributos dinámicos (EAV) para cada SKU';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_category_attribute_map`
--

CREATE TABLE `mod_pim_category_attribute_map` (
  `mod_pcam_pc_id` int UNSIGNED NOT NULL COMMENT 'ID de la categoría (mod_pc_id)',
  `mod_pcam_pa_id` int UNSIGNED NOT NULL COMMENT 'ID del atributo (mod_pa_id)',
  `mod_pcam_is_required` tinyint(1) DEFAULT '0' COMMENT 'Indica si este atributo es obligatorio para la categoría'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Mapeo de qué atributos aplican a qué categorías';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_collections`
--

CREATE TABLE `mod_pim_collections` (
  `mod_pcol_id` int UNSIGNED NOT NULL COMMENT 'Identificador único de la colección',
  `mod_pcol_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre de la colección',
  `mod_pcol_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción de la colección',
  `mod_pcol_tags` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Etiquetas de la colección',
  `mod_pcol_icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Icono de la colección',
  `mod_pcol_img_desktop` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Imagen de la colección para desktop',
  `mod_pcol_img_mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Imagen de la colección para mobile',
  `mod_pcol_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `mod_pcol_ent_id` int UNSIGNED DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_pcol_user_id` int UNSIGNED DEFAULT NULL COMMENT 'ID del usuario que creó la colección',
  `mod_pcol_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización',
  `mod_pcol_state` int DEFAULT '1' COMMENT 'Estado (1=activo, 0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Jerarquía de Colecciones de Productos';

--
-- Volcado de datos para la tabla `mod_pim_collections`
--

INSERT INTO `mod_pim_collections` (`mod_pcol_id`, `mod_pcol_name`, `mod_pcol_description`, `mod_pcol_tags`, `mod_pcol_icon`, `mod_pcol_img_desktop`, `mod_pcol_img_mobile`, `mod_pcol_created_at`, `mod_pcol_ent_id`, `mod_pcol_user_id`, `mod_pcol_updated_at`, `mod_pcol_state`) VALUES
(1, 'coleccion 1', '', '', '', '', '', '2025-10-19 02:56:10', 1, 1, '2025-10-19 22:21:23', 1),
(2, 'coleccion 2', '', '', '', '', '', '2025-10-19 22:21:07', 1, 1, '2025-10-19 22:21:07', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_config`
--

CREATE TABLE `mod_pim_config` (
  `mod_pconf_id` int UNSIGNED NOT NULL COMMENT 'Identificador único',
  `mod_pconf_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Clave de configuración',
  `mod_pconf_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de configuración',
  `mod_pconf_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción de la configuración',
  `mod_pconf_type` enum('string','number','boolean','json') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'string' COMMENT 'Tipo de dato',
  `mod_pconf_user_id` int UNSIGNED NOT NULL COMMENT 'ID del usuario que creó la configuración',
  `mod_pconf_ent_id` int UNSIGNED NOT NULL COMMENT 'ID de la entidad',
  `mod_pconf_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Configuraciones del módulo PIM (Key-Value Store)';

--
-- Volcado de datos para la tabla `mod_pim_config`
--

INSERT INTO `mod_pim_config` (`mod_pconf_id`, `mod_pconf_key`, `mod_pconf_value`, `mod_pconf_description`, `mod_pconf_type`, `mod_pconf_user_id`, `mod_pconf_ent_id`, `mod_pconf_updated_at`) VALUES
(1, 'principal_category_id', '2', 'ID de la categoría principal de productos', 'number', 0, 1, '2025-10-19 04:25:15'),
(2, 'enable_collections', '1', 'Habilitar sistema de colecciones', 'boolean', 0, 1, '2025-10-19 04:25:15'),
(3, 'enable_variants', '1', 'Habilitar variantes de productos', 'boolean', 0, 1, '2025-10-19 04:25:15'),
(4, 'default_image_folder', 'products', 'Carpeta por defecto para imágenes de productos', 'string', 0, 1, '2025-10-19 04:25:15'),
(5, 'max_images_per_product', '10', 'Máximo de imágenes por producto', 'number', 0, 1, '2025-10-19 04:25:15');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_products`
--

CREATE TABLE `mod_pim_products` (
  `mod_pp_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del producto base',
  `mod_pp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre base del producto',
  `mod_pp_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del producto',
  `mod_pp_tags` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Etiquetas del producto',
  `mod_pp_ent_id` int UNSIGNED DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_pp_user_id` int UNSIGNED DEFAULT NULL COMMENT 'ID del usuario que creó el producto',
  `mod_pp_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `mod_pp_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización',
  `mod_pp_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Json del producto',
  `mod_pp_state` int DEFAULT '1' COMMENT 'Estado (1=activo, 0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Producto Base (Entidad Lógica) y sus detalles principales';

--
-- Volcado de datos para la tabla `mod_pim_products`
--

INSERT INTO `mod_pim_products` (`mod_pp_id`, `mod_pp_name`, `mod_pp_description`, `mod_pp_tags`, `mod_pp_ent_id`, `mod_pp_user_id`, `mod_pp_created_at`, `mod_pp_updated_at`, `mod_pp_json`, `mod_pp_state`) VALUES
(1, 'prueba 3', '<p>description</p>', 'tags', 1, 1, '2025-10-19 19:20:14', '2025-10-19 19:20:14', '', 1),
(2, 'prueba 4', '<p>descripción</p>', 'tag', 1, 1, '2025-10-19 21:35:40', '2025-10-19 21:58:19', 'json', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_products_categorys`
--

CREATE TABLE `mod_pim_products_categorys` (
  `mod_ppc_pp_id` bigint UNSIGNED NOT NULL COMMENT 'ID del producto',
  `mod_ppc_cat_id` int UNSIGNED NOT NULL COMMENT 'ID de la categoría',
  `mod_ppc_order` int NOT NULL COMMENT 'Orden de la categoría'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Relación Muchos a Muchos entre Productos y Categorías';

--
-- Volcado de datos para la tabla `mod_pim_products_categorys`
--

INSERT INTO `mod_pim_products_categorys` (`mod_ppc_pp_id`, `mod_ppc_cat_id`, `mod_ppc_order`) VALUES
(1, 2, 3),
(1, 5, 1),
(1, 6, 2),
(2, 4, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_products_collections`
--

CREATE TABLE `mod_pim_products_collections` (
  `mod_ppcol_pp_id` bigint UNSIGNED NOT NULL COMMENT 'ID del producto',
  `mod_ppcol_pcol_id` int UNSIGNED NOT NULL COMMENT 'ID de la colección',
  `mod_ppcol_order` int NOT NULL COMMENT 'Orden de la colección'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Relación Muchos a Muchos entre Productos y Colecciones';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_products_files`
--

CREATE TABLE `mod_pim_products_files` (
  `mod_ppf_pp_id` bigint UNSIGNED NOT NULL COMMENT 'ID del producto',
  `mod_ppf_file_id` int UNSIGNED NOT NULL COMMENT 'ID del archivo',
  `mod_ppf_order` int NOT NULL COMMENT 'Orden del archivo'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Relación Muchos a Muchos entre Productos y Archivos';

--
-- Volcado de datos para la tabla `mod_pim_products_files`
--

INSERT INTO `mod_pim_products_files` (`mod_ppf_pp_id`, `mod_ppf_file_id`, `mod_ppf_order`) VALUES
(1, 93, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_pim_skus`
--

CREATE TABLE `mod_pim_skus` (
  `mod_ps_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del SKU / Variante',
  `mod_ps_pp_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID del producto base (mod_pp_id)',
  `mod_ps_vv_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID del vendedor que ofrece este SKU (mod_vv_id)',
  `mod_ps_vendor_sku` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Código de referencia interno del vendor para este SKU',
  `mod_ps_price` decimal(15,4) NOT NULL COMMENT 'Precio de venta actual del SKU',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `mod_status` int DEFAULT '1' COMMENT 'Estado (1=activo, 0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Variantes de producto - Unidad Transaccional/Inventario';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_places`
--

CREATE TABLE `mod_places` (
  `mod_plc_id` int NOT NULL,
  `mod_plc_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_json` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_plc_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ej: Av. 3 pasos al frente, Calle Isoso #34 Edificio Lourdes Dep. 54',
  `mod_plc_city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_phone` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_celular_whatsapp` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_info` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_img` int NOT NULL,
  `mod_plc_profile_icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_main_coord` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_perimeter` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_map_icon` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_acu_id` int NOT NULL DEFAULT '0',
  `mod_plc_cont_id` int NOT NULL DEFAULT '0' COMMENT 'contenido_id',
  `mod_plc_status` int NOT NULL COMMENT 'the situation at a particular time during a process.',
  `mod_plc_ranking` int NOT NULL DEFAULT '5',
  `mod_plc_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_map_ubication` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_plc_24h` int NOT NULL,
  `mod_plc_ent_id` int DEFAULT NULL,
  `mod_plc_user_id` int DEFAULT NULL,
  `mod_plc_state` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_places_accounts_ads`
--

CREATE TABLE `mod_places_accounts_ads` (
  `mod_plc_aca_aca_id` int NOT NULL,
  `mod_plc_aca_plc_id` int NOT NULL,
  `mod_plc_aca_date_register` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_places_categorys`
--

CREATE TABLE `mod_places_categorys` (
  `mod_plc_cat_plc_id` int NOT NULL,
  `mod_plc_cat_cat_id` int NOT NULL,
  `mod_plc_cat_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_prices_list`
--

CREATE TABLE `mod_prices_list` (
  `mod_prl_id` int NOT NULL,
  `mod_prl_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prl_description` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prl_user_id` int DEFAULT NULL,
  `mod_prl_base_list` int DEFAULT NULL COMMENT 'lista base id\r\n\r\n',
  `mod_prl_factor` float(11,3) DEFAULT '1.000',
  `mod_prl_rounding_method` int NOT NULL COMMENT '0. sin *  1: si el siguiente dígito hacia la derecha después del último que desea conservarse es menor a 5, entonces el último no debe ser modificado. Por ejemplo: 8,453 se convertiría en 8,45;\r\n\r\n*2: en el caso opuesto al anterior, cuando el dígito siguiente al límite es mayor a 5, el último se debe incrementar en una unidad. Por ejemplo: 8,459 se convertiría en 8,46;\r\n\r\n*3: si un 5 sigue al último dígito que desea conservarse y después del 5 hay al menos un número diferente de 0, el último se debe incrementar en una unidad. Por ejemplo: 6,345070 se convertiría en 6,35;\r\n\r\n*4 si el último dígito deseado es un número par y a su derecha hay un 5 como dígito final o seguido de ceros, entonces no se realizan más cambios que el mero truncamiento. Por ejemplo, 4,32500 y 4,325 pasarían a ser 4,32;\r\n\r\n*\r\n5: de manera opuesta a la regla anterior, si el último dígito requerido es un número impar, entonces debemos aumentarlo en una unidad. Por ejemplo: 4,31500 y 4,315 se convertirían en 4,32. \r\n',
  `mod_prl_register_date` datetime NOT NULL,
  `mod_prl_ent_id` int DEFAULT NULL,
  `mod_prl_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_producers`
--

CREATE TABLE `mod_producers` (
  `mod_prd_id` int NOT NULL,
  `mod_prd_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prd_description` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prd_img_id` int NOT NULL,
  `mod_prd_state` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products`
--

CREATE TABLE `mod_products` (
  `mod_prod_id` int NOT NULL,
  `mod_prod_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pathurl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prod_description` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prod_tags` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_img` int DEFAULT NULL,
  `mod_prod_code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prod_record_date` datetime DEFAULT NULL,
  `mod_prod_type` int NOT NULL DEFAULT '0',
  `mod_prod_ent_id` int DEFAULT '0',
  `mod_prod_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_categorys`
--

CREATE TABLE `mod_products_categorys` (
  `mod_prod_cat_prod_id` int NOT NULL,
  `mod_prod_cat_cat_id` int NOT NULL,
  `mod_prod_cat_ent_id` int NOT NULL,
  `mod_prod_cat_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_clothing_store`
--

CREATE TABLE `mod_products_clothing_store` (
  `mod_prod_cst_id` int NOT NULL,
  `mod_prod_cst_prod_id` int NOT NULL,
  `mod_prod_cst_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'sx,l,m,l',
  `mod_prod_cst_codebar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prod_cst_contents` int NOT NULL,
  `mod_prod_cst_colors` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'json',
  `mod_prop_cst_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_colors`
--

CREATE TABLE `mod_products_colors` (
  `mod_prod_color_id` int NOT NULL,
  `mod_prod_color_name` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prod_color_hex` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_color_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_color_ent_id` int NOT NULL,
  `mod_prod_color_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_files`
--

CREATE TABLE `mod_products_files` (
  `mod_prod_file_prod_id` int NOT NULL,
  `mod_prod_file_file_id` int NOT NULL,
  `mod_prod_file_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_food`
--

CREATE TABLE `mod_products_food` (
  `mod_prod_food_id` int NOT NULL,
  `mod_prod_food_prod_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_options`
--

CREATE TABLE `mod_products_options` (
  `mod_prod_opt_id` int NOT NULL,
  `mod_prod_opt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_opt_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_opt_autoload` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_pharmacy`
--

CREATE TABLE `mod_products_pharmacy` (
  `mod_prod_pha_id` int NOT NULL,
  `mod_prod_pha_code_provider` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_prov_id` int NOT NULL,
  `mod_prod_pha_lab_id` int NOT NULL,
  `mod_prod_pha_mak_id` int NOT NULL,
  `mod_prod_pha_presentation` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_codebar` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_phar_form` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_active_concentration_1` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_active_concentration_2` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_active_concentration_3` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_therapy_action` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_condition_sale` int NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_pharmacy_stock`
--

CREATE TABLE `mod_products_pharmacy_stock` (
  `mod_prod_pha_stk_id` int NOT NULL,
  `mod_prod_pha_stk_contry_id` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_stk_nro_health_registration` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_stk_expiration_date` datetime NOT NULL,
  `mod_prod_pha_stk_registration_date` datetime NOT NULL,
  `mod_prod_pha_stk_purchase_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_stk_ratio_units_box` int NOT NULL,
  `mod_prod_pha_stk_lot` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_stk_box_blister_ratio` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_pha_stk_height_cm` int NOT NULL,
  `mod_prod_pha_stk_width_cm` int NOT NULL,
  `mod_prod_pha_stk_depth_cm` int NOT NULL,
  `mod_prod_pha_stk_diameter_cm` int NOT NULL,
  `mod_prod_pha_stk_storage_temperature_c` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_prices_list`
--

CREATE TABLE `mod_products_prices_list` (
  `mod_prod_prl_id` int NOT NULL,
  `mod_prod_prl_prod_id` int NOT NULL,
  `mod_prod_prl_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prod_prl_price` decimal(20,2) NOT NULL,
  `mod_prod_prl_previous_price` decimal(20,2) DEFAULT NULL,
  `mod_prod_prl_coin` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prod_prl_register_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_relation`
--

CREATE TABLE `mod_products_relation` (
  `mod_prod_rel_id` int NOT NULL,
  `mod_prod_rel_prod_id` int NOT NULL,
  `mod_prod_rel_ent_id` int NOT NULL,
  `mod_prod_rel_type` int DEFAULT NULL,
  `mod_prod_rel_stock` int DEFAULT NULL,
  `mod_prod_rel_pricing` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_rw`
--

CREATE TABLE `mod_products_rw` (
  `mod_prod_rw_id` int NOT NULL,
  `mod_prod_rw_prod_id` int NOT NULL,
  `mod_prod_rw_state` tinyint DEFAULT '0',
  `mod_prod_rw_rmc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_reference` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_familyname` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_modelname` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_ranking` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_modelcase` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_diameter` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_material` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_bezel` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_windingcrown` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_crystal` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_waterresistance` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_movement` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_calibre` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_bracelet` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_braceletmaterial` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_clasp` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_dial` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_gem_setting` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_powerreserve` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_spec_certification` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_gallery_image1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_gallery_image2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_gallery_image3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_gallery_image4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_feature1_title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_feature1_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_feature1_asset` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_feature2_title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_feature2_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_feature2_asset` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_feature3_title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_feature3_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_feature3_asset` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_brochure` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_rw_h1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_types`
--

CREATE TABLE `mod_products_types` (
  `mod_prod_type_id` int NOT NULL,
  `mod_prod_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_type_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prod_type_subfix` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prod_type_subfix_db` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_prod_type_primary` int DEFAULT '0',
  `mod_prod_type_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_prod_type_ent_id` int DEFAULT NULL,
  `mod_prod_type_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_products_types`
--

INSERT INTO `mod_products_types` (`mod_prod_type_id`, `mod_prod_type_name`, `mod_prod_type_path`, `mod_prod_type_subfix`, `mod_prod_type_subfix_db`, `mod_prod_type_primary`, `mod_prod_type_json`, `mod_prod_type_ent_id`, `mod_prod_type_state`) VALUES
(1, 'Store', 'store', '_str', '_store', 0, '', 1, 1),
(2, 'Clothing store', 'clothingStore', '_cst', '_clothing_store', 1, NULL, 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_products_warehouses`
--

CREATE TABLE `mod_products_warehouses` (
  `mod_prod_wrh_prod_id` int NOT NULL,
  `mod_prod_wrh_wrh_id` int NOT NULL,
  `mod_prod_wrh_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_providers`
--

CREATE TABLE `mod_providers` (
  `mod_prov_id` int NOT NULL,
  `mod_prov_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_user_id` int NOT NULL,
  `mod_prov_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_rating` decimal(3,2) DEFAULT NULL,
  `mod_prov_city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_zip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_website` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_prov_created` datetime NOT NULL,
  `mod_prov_modified` datetime NOT NULL,
  `mod_prov_deleted` datetime DEFAULT NULL COMMENT 'Fecha de eliminación (si aplica)',
  `mod_prov_state` int DEFAULT '0' COMMENT 'Estado (0: Inactivo, 1: Activo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_rehabilitation_centers`
--

CREATE TABLE `mod_rehabilitation_centers` (
  `mod_rhb_center_id` int NOT NULL,
  `mod_rhb_center_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_center_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_center_coord` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_center_user_id` int DEFAULT NULL,
  `mod_rhb_center_ent_id` int DEFAULT NULL,
  `mod_rhb_center_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_rehabilitation_centers`
--

INSERT INTO `mod_rehabilitation_centers` (`mod_rhb_center_id`, `mod_rhb_center_name`, `mod_rhb_center_address`, `mod_rhb_center_coord`, `mod_rhb_center_user_id`, `mod_rhb_center_ent_id`, `mod_rhb_center_state`) VALUES
(1, 'Centro 1', NULL, NULL, 4, 1, 1),
(2, 'Centro 2', NULL, NULL, 2, 1, 1),
(3, 'Centro 3', NULL, NULL, 0, 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_rehabilitation_intern`
--

CREATE TABLE `mod_rehabilitation_intern` (
  `mod_rhb_int_id` int NOT NULL,
  `mod_rhb_int_acu_id` int NOT NULL,
  `mod_rhb_int_date_intern` datetime DEFAULT NULL,
  `mod_rhb_int_date_graduation` datetime DEFAULT NULL,
  `mod_rhb_int_date_leaving` datetime DEFAULT NULL,
  `mod_rhb_int_reason_leaving` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_rhb_int_reason_addiction` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_int_primary_consumption` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_int_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_rehabilitation_primary_consumption`
--

CREATE TABLE `mod_rehabilitation_primary_consumption` (
  `mod_rhb_pcn_id` int NOT NULL,
  `mod_rhb_pcn_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_pcn_summary` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_pcn_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_pcn_order` int DEFAULT NULL,
  `mod_rhb_pcn_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_rehabilitation_tutor`
--

CREATE TABLE `mod_rehabilitation_tutor` (
  `mod_rhb_tutor_id` int NOT NULL,
  `mod_rhb_tutor_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_fathers_lastname` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_mothers_lastname` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_rhb_id` int DEFAULT NULL COMMENT 'mod_rhb_user_id',
  `mod_rhb_tutor_gender` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_ci` int DEFAULT NULL,
  `mod_rhb_tutor_ext` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_dial` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_celular` int DEFAULT NULL,
  `mod_rhb_tutor_relationship` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_intern_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_coordinates` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_tutor_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_rehabilitation_tutor`
--

INSERT INTO `mod_rehabilitation_tutor` (`mod_rhb_tutor_id`, `mod_rhb_tutor_name`, `mod_rhb_tutor_fathers_lastname`, `mod_rhb_tutor_mothers_lastname`, `mod_rhb_tutor_rhb_id`, `mod_rhb_tutor_gender`, `mod_rhb_tutor_ci`, `mod_rhb_tutor_ext`, `mod_rhb_tutor_dial`, `mod_rhb_tutor_celular`, `mod_rhb_tutor_relationship`, `mod_rhb_tutor_address`, `mod_rhb_tutor_intern_ids`, `mod_rhb_tutor_coordinates`, `mod_rhb_tutor_state`) VALUES
(1, 'Hermany', 'Terrazas', 'Cossio', 1, '0', 4735799, 'SC', '591', 75313126, '', '', '', '', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_rehabilitation_user`
--

CREATE TABLE `mod_rehabilitation_user` (
  `mod_rhb_id` int NOT NULL,
  `mod_rhb_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_rhb_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_rhb_acu_id` int DEFAULT NULL,
  `mod_rhb_tepcyr` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Time from First Consumption to Rehabilitation',
  `mod_rhb_birthday` date DEFAULT NULL,
  `mod_rhb_nationality` varchar(550) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rhb_age_first_use` int DEFAULT NULL,
  `mod_rhb_register_date` date DEFAULT NULL,
  `mod_rhb_user_id` int DEFAULT NULL,
  `mod_rhb_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_rems_lots`
--

CREATE TABLE `mod_rems_lots` (
  `mod_rems_lots_id` int NOT NULL,
  `mod_rems_lots_block` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_rems_lots_number` int NOT NULL,
  `mod_rems_lots_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_rems_lots_area_m2` decimal(10,2) NOT NULL,
  `mod_rems_lots_available` tinyint(1) DEFAULT '1' COMMENT '1.disponible,2.reservado,3.en_negociacion,4.promesa_compra,5.vendido,6.en_construccion,7.entregado,8.no_disponible,9.rechazado_caido\r\n\r\n',
  `mod_rems_lots_status` enum('disponible','reservado','en_negociacion','promesa_compra','vendido','en_construccion','entregado','no_disponible','rechazado_caido') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'disponible' COMMENT 'Estado comercial del lote',
  `mod_rems_lots_project_id` int DEFAULT NULL,
  `mod_rems_lots_coordinates` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_rems_lots_details` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_rems_lots_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_rems_lots_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `mod_rems_lots_state` int DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_rems_lots`
--

INSERT INTO `mod_rems_lots` (`mod_rems_lots_id`, `mod_rems_lots_block`, `mod_rems_lots_number`, `mod_rems_lots_name`, `mod_rems_lots_area_m2`, `mod_rems_lots_available`, `mod_rems_lots_status`, `mod_rems_lots_project_id`, `mod_rems_lots_coordinates`, `mod_rems_lots_details`, `mod_rems_lots_created_at`, `mod_rems_lots_updated_at`, `mod_rems_lots_state`) VALUES
(1, 'M05', 1, 'Lote 1-MZ5', 647.27, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span>\r\n<span class=\"METROS\">{{_M}}</span>\r\n<span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(2, 'M05', 2, 'Lote 2-MZ5', 360.51, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(3, 'M05', 3, 'Lote 3-MZ5', 363.49, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(4, 'M05', 4, 'Lote 4-MZ5', 361.54, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(5, 'M05', 5, 'Lote 5-MZ5', 360.79, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(6, 'M05', 6, 'Lote 6-MZ5', 362.11, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(7, 'M05', 7, 'Lote 7-MZ5', 403.23, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(8, 'M05', 8, 'Lote 8-MZ5', 544.66, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(9, 'M05', 9, 'Lote 9-MZ5', 379.76, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(10, 'M05', 10, 'Lote 10-MZ5', 368.21, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(11, 'M05', 11, 'Lote 11-MZ5', 367.28, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(12, 'M05', 12, 'Lote 12-MZ5', 362.17, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(13, 'M05', 13, 'Lote 13-MZ5', 362.08, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(14, 'M05', 14, 'Lote 14-MZ5', 360.57, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(15, 'M05', 15, 'Lote 16-MZ5', 360.94, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(16, 'M05', 16, 'Lote 16-MZ5', 545.04, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(17, 'M06', 1, 'Lote 1-MZ6', 423.45, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(18, 'M06', 2, 'Lote 2-MZ6', 360.59, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(19, 'M06', 3, 'Lote 3-MZ6', 369.53, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(20, 'M06', 8, 'Lote 8-MZ6', 373.51, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(21, 'M06', 7, 'Lote 7-MZ6', 369.16, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(22, 'M06', 13, 'Lote 13-MZ6', 550.54, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(23, 'M06', 14, 'Lote 14-MZ6', 378.15, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(24, 'M06', 15, 'Lote 15-MZ6', 393.27, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(25, 'M06', 16, 'Lote 16-MZ6', 376.28, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(26, 'M06', 17, 'Lote 17-MZ6', 367.78, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(27, 'M06', 18, 'Lote 18-MZ6', 774.23, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(28, 'M06', 19, 'Lote 19-MZ6', 409.46, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(29, 'M06', 20, 'Lote 20-MZ6', 401.34, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-20 02:37:58', 1),
(30, 'M06', 21, 'Lote 21-MZ6', 397.46, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(31, 'M06', 22, 'Lote 22-MZ6', 388.00, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(32, 'M06', 23, 'Lote 23-MZ6', 375.41, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(33, 'M06', 24, 'Lote 24-MZ6', 365.34, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(34, 'M06', 25, 'Lote 25-MZ6', 371.39, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(35, 'M06', 26, 'Lote 26-MZ6', 393.81, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(36, 'M06', 27, 'Lote 27-MZ6', 376.25, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(37, 'M06', 11, 'Lote 11-MZ6', 402.86, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(38, 'M06', 9, 'Lote 9-MZ6', 383.17, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(39, 'M06', 5, 'Lote 5-MZ6', 384.24, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(40, 'M06', 6, 'Lote 6-MZ6', 388.05, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(41, 'M06', 12, 'Lote 12-MZ6', 413.06, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(42, 'M06', 10, 'Lote 10-MZ6', 391.18, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(43, 'M06', 4, 'Lote 4-MZ6', 538.70, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(44, 'M07', 18, 'Lote 18-MZ7', 396.03, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(45, 'M07', 10, 'Lote 10-MZ7', 397.17, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(46, 'M07', 22, 'Lote 22-MZ7', 375.84, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(47, 'M07', 2, 'Lote 2-MZ7', 378.00, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(48, 'M07', 3, 'Lote 3-MZ7', 378.44, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(49, 'M07', 12, 'Lote 12-MZ7', 436.57, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(50, 'M07', 13, 'Lote 13-MZ7', 364.47, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(51, 'M07', 14, 'Lote 14-MZ7', 481.37, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(52, 'M07', 15, 'Lote 15-MZ7', 789.19, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(53, 'M07', 9, 'Lote 9-MZ7', 405.73, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(54, 'M07', 21, 'Lote 21-MZ7', 383.99, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(55, 'M07', 6, 'Lote 6-MZ7', 410.51, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(56, 'M07', 8, 'Lote 8-MZ7', 411.77, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(57, 'M07', 11, 'Lote 11-MZ7', 389.29, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(58, 'M07', 7, 'Lote 7-MZ7', 413.43, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(59, 'M07', 20, 'Lote 20-MZ7', 390.99, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(60, 'M07', 16, 'Lote 16-MZ7', 391.32, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(61, 'M07', 5, 'Lote 5-MZ7', 417.42, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(62, 'M07', 17, 'Lote 17-MZ7', 394.42, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(63, 'M07', 19, 'Lote 19-MZ7', 395.40, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(64, 'M07', 1, 'Lote 1-MZ7', 497.57, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(65, 'M07', 4, 'Lote 4-MZ7', 536.24, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:39', '2025-08-18 07:35:38', 1),
(66, 'M08', 1, 'Lote 1-MZ8', 422.63, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(67, 'M08', 13, 'Lote 13-MZ8', 398.60, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(68, 'M08', 22, 'Lote 22-MZ8', 378.16, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(69, 'M08', 11, 'Lote 11-MZ8', 403.07, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(70, 'M08', 2, 'Lote 2-MZ8', 360.99, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(71, 'M08', 3, 'Lote 3-MZ8', 363.46, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(72, 'M08', 4, 'Lote 4-MZ8', 368.21, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(73, 'M08', 5, 'Lote 5-MZ8', 362.37, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(74, 'M08', 6, 'Lote 6-MZ8', 366.18, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(75, 'M08', 9, 'Lote 9-MZ8', 431.62, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(76, 'M08', 14, 'Lote 14-MZ8', 673.76, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(77, 'M08', 15, 'Lote 15-MZ8', 384.18, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(78, 'M08', 16, 'Lote 16-MZ8', 366.96, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(79, 'M08', 17, 'Lote 17-MZ8', 469.73, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(80, 'M08', 18, 'Lote 18-MZ8', 366.71, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(81, 'M08', 19, 'Lote 19-MZ8', 360.64, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(82, 'M08', 20, 'Lote 20-MZ8', 362.82, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(83, 'M08', 21, 'Lote 21-MZ8', 368.57, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(84, 'M08', 24, 'Lote 24-MZ8', 409.66, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(85, 'M08', 23, 'Lote 23-MZ8', 391.88, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(86, 'M08', 10, 'Lote 10-MZ8', 415.44, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(87, 'M08', 12, 'Lote 12-MZ8', 394.38, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(88, 'M08', 8, 'Lote 8-MZ8', 451.67, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(89, 'M08', 7, 'Lote 7-MZ8', 474.67, 5, 'vendido', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:35:38', 1),
(90, 'M13', 62, 'Lote 62-MZ13', 425.60, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(91, 'M13', 64, 'Lote 64-MZ13', 427.03, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(92, 'M13', 67, 'Lote 67-MZ13', 402.30, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(93, 'M13', 63, 'Lote 63-MZ13', 429.19, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(94, 'M13', 68, 'Lote 68-MZ13', 392.08, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(95, 'M13', 69, 'Lote 69-MZ13', 382.69, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(96, 'M13', 70, 'Lote 70-MZ13', 373.22, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(97, 'M13', 71, 'Lote 71-MZ13', 363.67, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(98, 'M13', 72, 'Lote 72-MZ13', 364.51, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(99, 'M13', 73, 'Lote 73-MZ13', 360.97, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(100, 'M13', 74, 'Lote 74-MZ13', 363.29, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(101, 'M13', 75, 'Lote 75-MZ13', 364.22, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(102, 'M13', 76, 'Lote 76-MZ13', 362.15, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(103, 'M13', 77, 'Lote 77-MZ13', 361.66, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(104, 'M13', 78, 'Lote 78-MZ13', 363.56, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(105, 'M13', 79, 'Lote 79-MZ13', 362.96, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(106, 'M13', 80, 'Lote 80-MZ13', 362.21, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(107, 'M13', 81, 'Lote 81-MZ13', 366.27, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(108, 'M13', 82, 'Lote 82-MZ13', 364.09, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(109, 'M13', 83, 'Lote 83-MZ13', 362.97, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(110, 'M13', 84, 'Lote 84-MZ13', 366.24, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(111, 'M13', 66, 'Lote 66-MZ13', 410.61, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(112, 'M13', 86, 'Lote 86-MZ13', 365.85, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(113, 'M13', 87, 'Lote 87-MZ13', 368.57, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(114, 'M13', 88, 'Lote 88-MZ13', 367.32, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(115, 'M13', 89, 'Lote 89-MZ13', 367.52, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(116, 'M13', 90, 'Lote 90-MZ13', 365.17, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(117, 'M13', 91, 'Lote 91-MZ13', 367.92, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(118, 'M13', 92, 'Lote 92-MZ13', 364.77, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(119, 'M13', 93, 'Lote 93-MZ13', 362.80, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(120, 'M13', 94, 'Lote 94-MZ13', 363.88, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(121, 'M13', 95, 'Lote 95-MZ13', 362.42, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(122, 'M13', 96, 'Lote 96-MZ13', 362.34, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(123, 'M13', 61, 'Lote 61-MZ13', 416.23, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(124, 'M13', 65, 'Lote 65-MZ13', 419.85, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(125, 'M13', 85, 'Lote 85-MZ13', 527.98, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(126, 'M16', 16, 'Lote 16-MZ16', 373.83, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(127, 'M16', 11, 'Lote 11-MZ16', 420.83, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(128, 'M16', 14, 'Lote 14-MZ16', 374.81, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(129, 'M16', 9, 'Lote 9-MZ16', 397.17, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(130, 'M16', 17, 'Lote 17-MZ16', 379.21, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(131, 'M16', 20, 'Lote 20-MZ16', 380.48, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(132, 'M16', 19, 'Lote 19-MZ16', 404.56, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(133, 'M16', 7, 'Lote 7-MZ16', 386.69, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(134, 'M16', 10, 'Lote 10-MZ16', 409.78, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(135, 'M16', 1, 'Lote 1-MZ16', 373.98, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(136, 'M16', 2, 'Lote 2-MZ16', 362.88, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(137, 'M16', 3, 'Lote 3-MZ16', 360.39, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(138, 'M16', 4, 'Lote 4-MZ16', 361.38, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(139, 'M16', 5, 'Lote 5-MZ16', 456.93, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(140, 'M16', 6, 'Lote 6-MZ16', 369.49, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(141, 'M16', 13, 'Lote 13-MZ16', 364.68, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(142, 'M16', 15, 'Lote 15-MZ16', 366.45, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(143, 'M16', 21, 'Lote 21-MZ16', 362.76, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(144, 'M16', 22, 'Lote 22-MZ16', 360.78, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(145, 'M16', 23, 'Lote 23-MZ16', 362.40, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(146, 'M16', 24, 'Lote 24-MZ16', 360.66, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(147, 'M16', 8, 'Lote 8-MZ16', 393.93, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(148, 'M16', 18, 'Lote 18-MZ16', 623.56, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(149, 'M16', 12, 'Lote 12-MZ16', 632.06, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(150, 'M17', 21, 'Lote 21-MZ17', 422.76, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(151, 'M17', 22, 'Lote 22-MZ17', 423.05, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(152, 'M17', 17, 'Lote 17-MZ17', 398.74, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(153, 'M17', 9, 'Lote 9-MZ17', 426.50, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(154, 'M17', 4, 'Lote 4-MZ17', 429.97, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(155, 'M17', 16, 'Lote 16-MZ17', 384.85, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(156, 'M17', 18, 'Lote 18-MZ17', 408.92, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(157, 'M17', 14, 'Lote 14-MZ17', 408.96, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(158, 'M17', 11, 'Lote 11-MZ17', 387.21, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(159, 'M17', 8, 'Lote 8-MZ17', 436.15, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(160, 'M17', 10, 'Lote 10-MZ17', 410.66, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(161, 'M17', 5, 'Lote 5-MZ17', 437.01, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(162, 'M17', 7, 'Lote 7-MZ17', 440.63, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(163, 'M17', 6, 'Lote 6-MZ17', 440.72, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(164, 'M17', 1, 'Lote 1-MZ17', 868.48, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(165, 'M17', 2, 'Lote 2-MZ17', 556.71, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(166, 'M17', 3, 'Lote 3-MZ17', 593.55, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(167, 'M17', 13, 'Lote 13-MZ17', 441.30, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(168, 'M17', 19, 'Lote 19-MZ17', 416.02, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(169, 'M17', 15, 'Lote 15-MZ17', 366.37, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(170, 'M17', 20, 'Lote 20-MZ17', 420.52, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(171, 'M17', 12, 'Lote 12-MZ17', 528.14, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(172, 'M18', 20, 'Lote 20-MZ18', 421.99, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(173, 'M18', 19, 'Lote 19-MZ18', 378.51, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(174, 'M18', 12, 'Lote 12-MZ18', 405.43, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(175, 'M18', 13, 'Lote 13-MZ18', 419.23, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(176, 'M18', 11, 'Lote 11-MZ18', 451.83, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(177, 'M18', 16, 'Lote 16-MZ18', 494.63, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(178, 'M18', 1, 'Lote 1-MZ18', 807.06, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(179, 'M18', 2, 'Lote 2-MZ18', 478.86, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(180, 'M18', 3, 'Lote 3-MZ18', 425.23, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(181, 'M18', 4, 'Lote 4-MZ18', 441.70, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(182, 'M18', 5, 'Lote 5-MZ18', 410.28, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(183, 'M18', 6, 'Lote 6-MZ18', 366.47, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(184, 'M18', 7, 'Lote 7-MZ18', 360.79, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(185, 'M18', 8, 'Lote 8-MZ18', 381.22, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(186, 'M18', 9, 'Lote 9-MZ18', 528.31, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(187, 'M18', 14, 'Lote 14-MZ18', 512.38, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(188, 'M18', 17, 'Lote 17-MZ18', 373.12, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(189, 'M18', 18, 'Lote 18-MZ18', 368.76, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(190, 'M18', 15, 'Lote 15-MZ18', 636.24, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(191, 'M18', 10, 'Lote 10-MZ18', 816.62, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1),
(192, 'M18', 21, 'Lote 21-MZ18', 867.47, 1, 'disponible', 1, '', '<span class=\"title\">Lote 2-MZ5</span><span class=\"METROS\">{{_M}}</span><span class=\"state\">{{_COST}}</span>', '2025-08-17 23:58:40', '2025-08-18 07:33:48', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_rems_projects`
--

CREATE TABLE `mod_rems_projects` (
  `mod_rems_projects_id` int NOT NULL,
  `mod_rems_projects_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_rems_projects_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_rems_projects_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_rems_projects_start_date` date DEFAULT NULL,
  `mod_rems_projects_end_date` date DEFAULT NULL,
  `mod_rems_projects_status` enum('planning','in_progress','on_hold','completed','cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'planning',
  `mod_rems_projects_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_rems_projects_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `mod_rems_projects_state` int DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_rems_projects`
--

INSERT INTO `mod_rems_projects` (`mod_rems_projects_id`, `mod_rems_projects_name`, `mod_rems_projects_location`, `mod_rems_projects_description`, `mod_rems_projects_start_date`, `mod_rems_projects_end_date`, `mod_rems_projects_status`, `mod_rems_projects_created_at`, `mod_rems_projects_updated_at`, `mod_rems_projects_state`) VALUES
(1, 'Colinas del Lago', '', NULL, NULL, NULL, 'planning', '2025-08-18 00:51:52', '2025-08-18 00:51:52', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_rewards`
--

CREATE TABLE `mod_rewards` (
  `mod_rwd_id` int NOT NULL,
  `mod_rwd_cpa_id` int NOT NULL,
  `mod_rwd_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rwd_img` int DEFAULT NULL,
  `mod_rwd_description` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_rwd_code` varchar(21) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_rwd_value` int NOT NULL DEFAULT '0',
  `mod_rwd_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_rwd_register_date` datetime NOT NULL,
  `mod_rwd_user_id` int DEFAULT NULL,
  `mod_rwd_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_rewards_register`
--

CREATE TABLE `mod_rewards_register` (
  `mod_rwd_reg_rwd_id` int NOT NULL,
  `mod_rwd_reg_acu_id` int NOT NULL,
  `mod_rwd_reg_cpa_id` int NOT NULL,
  `mod_rwd_reg_register_date` datetime NOT NULL,
  `mod_rwd_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_services`
--

CREATE TABLE `mod_services` (
  `mod_srv_id` int NOT NULL,
  `mod_srv_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_srv_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_srv_active` int NOT NULL,
  `mod_srv_duration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_srv_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_srv_price` decimal(10,2) NOT NULL,
  `mod_srv_created` datetime NOT NULL,
  `mod_srv_modified` datetime NOT NULL,
  `mod_srv_deleted` datetime DEFAULT NULL,
  `mod_srv_ent_id` int NOT NULL,
  `mod_srv_state` int DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_services_roles`
--

CREATE TABLE `mod_services_roles` (
  `mod_srv_id` int NOT NULL,
  `mod_srv_rol_id` int NOT NULL,
  `mod_srv_rol_ent_id` int NOT NULL,
  `mod_srv_rol_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_sliders`
--

CREATE TABLE `mod_sliders` (
  `mod_sli_id` int NOT NULL,
  `mod_sli_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `mod_sli_description` tinytext COLLATE utf8mb4_general_ci NOT NULL,
  `mod_sli_cls` varchar(45) COLLATE utf8mb4_general_ci NOT NULL,
  `mod_sli_json` text COLLATE utf8mb4_general_ci,
  `mod_sli_date` datetime DEFAULT NULL,
  `mod_sli_date_register` datetime DEFAULT NULL,
  `mod_sli_user_id` int DEFAULT NULL,
  `mod_sli_ent_id` int NOT NULL,
  `mod_sli_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_sliders`
--

INSERT INTO `mod_sliders` (`mod_sli_id`, `mod_sli_name`, `mod_sli_description`, `mod_sli_cls`, `mod_sli_json`, `mod_sli_date`, `mod_sli_date_register`, `mod_sli_user_id`, `mod_sli_ent_id`, `mod_sli_state`) VALUES
(1, 'titulo 1', '', '', '', '2025-11-30 16:51:00', '2025-11-30 15:51:17', 1, 1, 1),
(2, 'prueba 2', '', '', '', '2025-11-30 16:53:00', '2025-11-30 15:53:34', 1, 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_sliders_categorys`
--

CREATE TABLE `mod_sliders_categorys` (
  `mod_sli_cat_sli_id` int NOT NULL,
  `mod_sli_cat_cat_id` int NOT NULL,
  `mod_sli_cat_order` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_sliders_files`
--

CREATE TABLE `mod_sliders_files` (
  `mod_sli_file_id` int NOT NULL,
  `mod_sli_file_sli_id` int NOT NULL,
  `mod_sli_file_file_id` int NOT NULL,
  `mod_sli_file_title` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_sli_file_btn_title` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_sli_file_link` varchar(445) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_sli_file_target` varchar(22) COLLATE utf8mb4_general_ci DEFAULT '_self',
  `mod_sli_file_description` tinytext COLLATE utf8mb4_general_ci,
  `mod_sli_file_order` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_sliders_files`
--

INSERT INTO `mod_sliders_files` (`mod_sli_file_id`, `mod_sli_file_sli_id`, `mod_sli_file_file_id`, `mod_sli_file_title`, `mod_sli_file_btn_title`, `mod_sli_file_link`, `mod_sli_file_target`, `mod_sli_file_description`, `mod_sli_file_order`) VALUES
(7, 2, 1, 'titulo 1', '', '', '_self', '', 0),
(8, 2, 3, 'titulo 2', '', '', '_self', '', 1),
(9, 1, 0, 'prueba 1', '', '', '_self', '', 0);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_sports`
--

CREATE TABLE `mod_sports` (
  `mod_spt_id` int NOT NULL,
  `mod_spt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_sp_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_spt_description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_spt_img` int DEFAULT NULL,
  `mod_spt_ent_id` int DEFAULT NULL,
  `mod_spt_state` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_sports_dates`
--

CREATE TABLE `mod_sports_dates` (
  `mod_sp_dt_id` int NOT NULL,
  `mod_sp_dt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_sp_dt_date` date DEFAULT NULL,
  `mod_sp_dt_comp_id` int DEFAULT NULL COMMENT 'competition',
  `mod_sp_dt_div_id` int DEFAULT NULL,
  `mod_sp_dt_ent_id` int DEFAULT NULL,
  `mod_sp_dt_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_sports_games`
--

CREATE TABLE `mod_sports_games` (
  `mod_sp_gm_id` int NOT NULL,
  `mod_sp_gm_tm_1` int DEFAULT NULL,
  `mod_sp_gm_tm_2` int DEFAULT NULL,
  `mod_sp_gm_place` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_sp_gm_info` int DEFAULT NULL,
  `mod_sp_gm_tm_score_1` int DEFAULT NULL,
  `mod_sp_gm_tm_score_2` int DEFAULT NULL,
  `mod_sg_gm_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_sg_gm_date` datetime DEFAULT NULL,
  `mod_sg_gm_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_sg_gm_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_sports_teams`
--

CREATE TABLE `mod_sports_teams` (
  `mod_sp_tm_id` int NOT NULL,
  `mod_sp_tm_sport` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_sp_tm_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_sp_tm_pathurl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_sp_tm_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_sp_tm_logo` int DEFAULT NULL COMMENT 'file ID',
  `mod_sp_tm_banner` int DEFAULT NULL COMMENT 'file Id',
  `mod_sp_tm_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mos_sp_tm_ent_id` int DEFAULT NULL,
  `mod_sp_tm_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_stock`
--

CREATE TABLE `mod_stock` (
  `mod_stk_id` int NOT NULL,
  `mod_stk_sku` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_stk_prod_id` int NOT NULL,
  `mod_stk_quantity` int DEFAULT NULL,
  `mod_stk_register_date` datetime NOT NULL,
  `mod_stk_comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_stk_inv_id` int DEFAULT NULL COMMENT 'id factura',
  `mod_stk_max` int DEFAULT NULL,
  `mod_stk_min` int DEFAULT NULL,
  `mod_stk_alert` int DEFAULT NULL,
  `mod_stk_receipt_date` datetime NOT NULL COMMENT 'fecha de recepción',
  `mod_stk_lote` int NOT NULL,
  `mod_stk_prv_id` int NOT NULL COMMENT 'id proveedor',
  `mod_stk_net_price` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT 'precio neto',
  `mod_stk_ent_id` int DEFAULT NULL,
  `mod_stk_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_stock_receipt`
--

CREATE TABLE `mod_stock_receipt` (
  `mod_str_id` int NOT NULL,
  `mod_str_prod_id` int DEFAULT NULL,
  `mod_str_quantity` int DEFAULT NULL,
  `mod_str_register_date` datetime NOT NULL,
  `mod_str_comment` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_str_inv_id` int DEFAULT NULL COMMENT 'id factura',
  `mod_str_max` int DEFAULT NULL,
  `mod_str_min` int DEFAULT NULL,
  `mod_str_receipt_date` datetime NOT NULL COMMENT 'fecha de recepción',
  `mod_str_lote` int NOT NULL,
  `mod_str_prv_id` int NOT NULL COMMENT 'id proveedor',
  `mod_str_net_price` decimal(20,2) NOT NULL,
  `mod_str_cash_discount` decimal(20,2) NOT NULL,
  `mod_str_discount` int NOT NULL,
  `mod_str_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_surveys`
--

CREATE TABLE `mod_surveys` (
  `mod_svy_id` int NOT NULL,
  `mod_svy_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_svy_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_svy_created_by` int DEFAULT NULL,
  `mod_svy_creation_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `mod_svy_active` tinyint(1) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_surveys_options`
--

CREATE TABLE `mod_surveys_options` (
  `mod_svy_so_id` int NOT NULL,
  `mod_svy_so_sq_id` int DEFAULT NULL,
  `mod_svy_so_option` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_svy_so_order` int DEFAULT '1',
  `mod_svy_so_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_surveys_questions`
--

CREATE TABLE `mod_surveys_questions` (
  `mod_svy_sq_id` int NOT NULL,
  `mod_svy_sq_svy_id` int DEFAULT NULL,
  `mod_svy_sq_question` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_svy_sq_type` enum('text','multiple_choice','rating') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_svy_sq_is_required` tinyint(1) DEFAULT '1',
  `mod_svy_sq_order` int DEFAULT '1',
  `mod_svy_sq_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_syllabus`
--

CREATE TABLE `mod_syllabus` (
  `mod_syl_id` int NOT NULL,
  `mod_syl_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_syl_summary` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_syl_ent_id` int DEFAULT NULL,
  `mod_syl_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_syllabus_categorys`
--

CREATE TABLE `mod_syllabus_categorys` (
  `mod_syl_cat_syl_id` int NOT NULL,
  `mod_syl_cat_cat_id` int NOT NULL,
  `mod_syl_cat_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_syllabus_contents`
--

CREATE TABLE `mod_syllabus_contents` (
  `mod_syl_cont_id` int NOT NULL,
  `mod_syl_cont_title` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_syl_cont_summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_syl_cont_per_id` int DEFAULT NULL,
  `mod_syl_cont_syl_id` int DEFAULT NULL,
  `mod_syl_cont_order` int DEFAULT NULL,
  `mod_syl_cont_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_syllabus_periods`
--

CREATE TABLE `mod_syllabus_periods` (
  `mod_syl_per_id` int NOT NULL,
  `mod_syl_per_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_syl_per_summary` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_syl_per_ent_id` int DEFAULT NULL,
  `mod_syl_per_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_syllabus_relations_periods`
--

CREATE TABLE `mod_syllabus_relations_periods` (
  `mod_syl_rel_per_syl_id` int NOT NULL,
  `mod_syl_rel_per_per_id` int NOT NULL,
  `mod_syl_rel_per_order` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_tributes_contribuyente_form`
--

CREATE TABLE `mod_tributes_contribuyente_form` (
  `mod_tb_cf_typc_id` int NOT NULL,
  `mod_tb_cf_type_form_id` int NOT NULL,
  `mod_tb_cf_presentacion` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_tributes_facturas_cliente`
--

CREATE TABLE `mod_tributes_facturas_cliente` (
  `mod_tb_fac_id` int NOT NULL,
  `mod_tb_fac_nit` bigint NOT NULL,
  `mod_tb_fac_file_id` int DEFAULT NULL,
  `mod_tb_fac_type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'manual',
  `mod_tb_fac_period` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fac_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_tributes_facturas_filter`
--

CREATE TABLE `mod_tributes_facturas_filter` (
  `mod_tb_fcf_id` int NOT NULL,
  `mod_tb_fcf_nombre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fcf_fac_id` int DEFAULT NULL,
  `mod_tb_fcf_fac_nit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fcf_fac_file_id` int DEFAULT NULL,
  `mod_tb_fcf_fac_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fcf_fac_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'manuales, qr, qr_antiguos, na',
  `mod_tb_fcf_fac_period` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ej: 202505',
  `mod_tb_fcf_fac_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'no_analizada,analizada,descartada',
  `mod_tb_fcf_fac_reason_discard` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fcf_nitProveedor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fcf_razonSocialProveedor` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fcf_codigoAutorizacion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fcf_numeroFactura` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fcf_numeroDuiDim` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_fcf_fechaFacturaDuiDim` date DEFAULT NULL,
  `mod_tb_fcf_importeTotalCompra` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_importeIce` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_importeIehd` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_importeIpj` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_tasas` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_otroNoSujetoACreditoFiscal` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_importesExentos` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_importeComprasGravadasATasaCero` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_descuentos` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_importeGifCard` decimal(10,2) DEFAULT NULL,
  `mod_tb_fcf_user_id` int DEFAULT NULL,
  `mod_tb_fcf_date_register` date DEFAULT NULL,
  `mod_tb_fcf_state` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_tributes_options`
--

CREATE TABLE `mod_tributes_options` (
  `mod_tb_op_id` int NOT NULL,
  `mod_tb_op_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_tb_op_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_tb_op_autoload` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'yes',
  `mod_tb_op_date_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_tb_op_date_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_tributes_periods`
--

CREATE TABLE `mod_tributes_periods` (
  `mod_tb_pr_id` int NOT NULL COMMENT 'ej:202409 se refiere al periodo 2024-09 año/mes siempre seran 6 digitos',
  `mod_tb_pr_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_pr_year_fiscal` year DEFAULT NULL COMMENT 'ej:2024',
  `mod_tb_pr_init_monthly` date DEFAULT NULL COMMENT 'ej:2024-01-01',
  `mod_tb_pr_end_monthly` date DEFAULT NULL COMMENT 'ej:2024-12-31',
  `mod_tb_pr_init_quarterly` date DEFAULT NULL COMMENT 'ej:2024-01-01',
  `mod_tb_pr_end_quarterly` date DEFAULT NULL COMMENT 'ej:2024-12-31',
  `mod_tb_pr_type` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ej: M M,T.. M: mensual, M,T: mensual y trimestral',
  `mod_tb_pr_active_user` int DEFAULT NULL COMMENT 'si este periodo esta activo para el usuario manejado por el cron de sistema para cerrar periodos',
  `mod_tb_pr_active_operator` int DEFAULT NULL COMMENT 'si este periodo esta activo para el operador manejado por el cron de sistema para cerrar periodos',
  `mod_tb_pr_message_register` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'es el campo texto para gestionar mensajes en el registro, es html hecho en markdown',
  `mod_tb_pr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_tb_pr_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_tb_pr_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_tributes_periods`
--

INSERT INTO `mod_tributes_periods` (`mod_tb_pr_id`, `mod_tb_pr_name`, `mod_tb_pr_year_fiscal`, `mod_tb_pr_init_monthly`, `mod_tb_pr_end_monthly`, `mod_tb_pr_init_quarterly`, `mod_tb_pr_end_quarterly`, `mod_tb_pr_type`, `mod_tb_pr_active_user`, `mod_tb_pr_active_operator`, `mod_tb_pr_message_register`, `mod_tb_pr_json`, `mod_tb_pr_description`, `mod_tb_pr_state`) VALUES
(202412, 'Periodo 12-2024', '2024', '2024-12-01', '2024-12-31', '2024-10-01', '2024-12-31', 'M,T', 1, 1, '- Facturas Mensuales desde el 2024/Dic/01 al 2024/Dic/31\r\n- Facturas Trimestrales desde el 2024/Oct/01 al 2024/Dic/31', NULL, NULL, 1),
(202501, 'Periodo 01-2025', '2025', '2025-01-01', '2024-01-31', '2025-01-01', '2025-03-31', 'M', 0, 0, '- Facturas Mensuales desde el 2025/Ene/01 al 2025/Ene/31', NULL, NULL, 0),
(202502, 'Periodo 02-2025', '2025', '2025-02-01', '2024-02-28', '2025-01-01', '2025-03-31', 'M', 0, 0, '- Facturas Mensuales desde el 2025/Feb/01 al 2025/Feb/28', NULL, NULL, 0),
(202503, 'Periodo 03-2025', '2025', '2025-03-01', '2024-03-31', '2025-01-01', '2025-03-31', 'M,T', 0, 0, '- Facturas Mensuales desde el 2025/Mar/01 al 2025/Mar/31 - Facturas Trimestrales desde el 2025/Ene/01 al 2025/Mar/31', NULL, NULL, 0),
(202504, 'Periodo 04-2025', '2025', '2025-04-01', '2024-04-30', '2025-04-01', '2025-06-30', 'M', 0, 0, '- Facturas Mensuales desde el 2025/Abr/01 al 2025/Abr/30', NULL, NULL, 0),
(202505, 'Periodo 05-2025', '2025', '2025-05-01', '2024-05-31', '2025-04-01', '2025-06-30', 'M', 0, 0, '- Facturas Mensuales desde el 2025/May/01 al 2025/May/31', NULL, NULL, 0),
(202506, 'Periodo 06-2025', '2025', '2025-06-01', '2024-06-30', '2025-04-01', '2025-06-30', 'M,T', 0, 0, '- Facturas Mensuales desde el 2025/Jun/01 al 2025/Jun/30 - Facturas Trimestrales desde el 2025/Abr/01 al 2025/Jun/30', NULL, NULL, 0),
(202507, 'Periodo 07-2025', '2025', '2025-07-01', '2024-07-31', '2025-07-01', '2025-09-30', 'M', 0, 0, '- Facturas Mensuales desde el 2025/Jul/01 al 2025/Jul/31', NULL, NULL, 0),
(202508, 'Periodo 08-2025', '2025', '2025-08-01', '2024-08-31', '2025-07-01', '2025-09-30', 'M', 0, 0, '- Facturas Mensuales desde el 2025/Ago/01 al 2025/Ago/31', NULL, NULL, 0),
(202509, 'Periodo 09-2025', '2025', '2025-09-01', '2024-09-30', '2025-07-01', '2025-09-30', 'M,T', 0, 0, '- Facturas Mensuales desde el 2025/Sep/01 al 2025/Sep/30 - Facturas Trimestrales desde el 2025/Jul/01 al 2025/Sep/30', NULL, NULL, 0),
(202510, 'Periodo 10-2025', '2025', '2025-10-01', '2024-10-31', '2025-10-01', '2025-12-31', 'M', 0, 0, '- Facturas Mensuales desde el 2025/Oct/01 al 2025/Oct/31', NULL, NULL, 0),
(202511, 'Periodo 11-2025', '2025', '2025-11-01', '2024-11-30', '2025-10-01', '2025-12-31', 'M', 0, 0, '- Facturas Mensuales desde el 2025/Nov/01 al 2025/Nov/30', NULL, NULL, 0),
(202512, 'Periodo 12-2025', '2025', '2025-12-01', '2024-12-31', '2025-10-01', '2025-12-31', 'M,T', 0, 0, '- Facturas Mensuales desde el 2025/Dic/01 al 2025/Dic/31 - Facturas Trimestrales desde el 2025/Oct/01 al 2025/Dic/31', NULL, NULL, 0);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_tributes_plans_periods`
--

CREATE TABLE `mod_tributes_plans_periods` (
  `mod_tb_plpr_cpe_id` int NOT NULL,
  `mod_tb_plpr_pl_id` int NOT NULL,
  `mod_tb_plpr_pr_id` int NOT NULL,
  `mod_tb_plpr_state` int NOT NULL,
  `mod_tb_plpr_nit` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_tributes_relations_periods`
--

CREATE TABLE `mod_tributes_relations_periods` (
  `mod_tb_rpd_id` int NOT NULL,
  `mod_tb_rpd_pr_id` int DEFAULT NULL,
  `mod_tb_rpd_group_nit` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'g1,g2',
  `mod_tb_rpd_date_max_reception` date DEFAULT NULL,
  `mod_tb_rpd_date_max_preliquidation` date DEFAULT NULL,
  `mod_tb_rpd_date_ok_preliquidation` date DEFAULT NULL,
  `mod_tb_rpd_date_declaration` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_tributes_relations_periods`
--

INSERT INTO `mod_tributes_relations_periods` (`mod_tb_rpd_id`, `mod_tb_rpd_pr_id`, `mod_tb_rpd_group_nit`, `mod_tb_rpd_date_max_reception`, `mod_tb_rpd_date_max_preliquidation`, `mod_tb_rpd_date_ok_preliquidation`, `mod_tb_rpd_date_declaration`) VALUES
(1, 202409, 'G1', '2024-10-05', '2024-10-09', '2024-10-11', '2024-10-12'),
(2, 202409, 'G2', '2024-10-05', '2024-10-10', '2024-10-14', '2024-10-17'),
(3, 202410, 'G1', '2024-11-05', '2024-11-09', '2024-11-11', '2024-11-12'),
(4, 202410, 'G2', '2024-11-05', '2024-11-10', '2024-11-14', '2024-11-17'),
(5, 202411, 'G1', '2024-12-05', '2024-12-09', '2024-12-11', '2024-12-12'),
(6, 202411, 'G2', '2024-12-05', '2024-12-10', '2024-12-14', '2024-12-17'),
(7, 202412, 'G1', '2025-01-05', '2025-01-09', '2025-01-11', '2025-01-12'),
(8, 202409, 'G2', '2025-01-05', '2025-01-10', '2025-01-14', '2025-01-17');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_types_contribuyentes`
--

CREATE TABLE `mod_types_contribuyentes` (
  `mod_typc_id` int NOT NULL,
  `mod_typc_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_typc_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_typc_system` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_typc_state` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_types_contribuyentes`
--

INSERT INTO `mod_types_contribuyentes` (`mod_typc_id`, `mod_typc_name`, `mod_typc_description`, `mod_typc_system`, `mod_typc_state`) VALUES
(1, 'Alquiler de Bienes', NULL, 'tributo_v1', 1),
(2, 'Consultor en Linea', NULL, 'tributo_v1', 1),
(3, 'Oficio Independiente', NULL, 'tributo_v1', 1),
(4, 'Profesional Independiente', NULL, 'tributo_v1', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_types_forms`
--

CREATE TABLE `mod_types_forms` (
  `mod_type_form_id` int NOT NULL,
  `mod_type_form_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_type_form_declaracion` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_type_form_mode` varchar(44) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_type_form_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_type_form_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_types_forms`
--

INSERT INTO `mod_types_forms` (`mod_type_form_id`, `mod_type_form_name`, `mod_type_form_declaracion`, `mod_type_form_mode`, `mod_type_form_json`, `mod_type_form_state`) VALUES
(110, 'Formulario 110', 'trimestral', 'impuestos', '0', 0),
(200, 'Formulario 200', 'mensual', 'impuestos', '0', 1),
(400, 'Formulario 400', 'mensual', 'impuestos', '0', 0),
(610, 'Formulario 610', 'trimestral', 'impuestos', '0', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_types_oficios`
--

CREATE TABLE `mod_types_oficios` (
  `mod_tb_tof_id` int NOT NULL,
  `mod_tb_tof_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_tof_descrition` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_tof_code` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_tb_tof_state` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_types_oficios`
--

INSERT INTO `mod_types_oficios` (`mod_tb_tof_id`, `mod_tb_tof_name`, `mod_tb_tof_descrition`, `mod_tb_tof_code`, `mod_tb_tof_state`) VALUES
(1, 'Alquiler de Bienes', '0', NULL, 1),
(2, 'Consultor en Linea', '0', NULL, 1),
(3, 'Instaladores', '0', NULL, 1),
(4, 'Chóferes', '0', NULL, 1),
(5, 'Carpiteros', '0', NULL, 1),
(6, 'Mecánicos', '0', NULL, 1),
(7, 'Consultores Independientes', '0', NULL, 1),
(8, 'Arquitectos', '0', NULL, 1),
(9, 'Abogados', '0', NULL, 1),
(10, 'Médicos', '0', NULL, 1),
(11, 'Catedráticos', '0', NULL, 1),
(12, 'Ingenieros', '0', NULL, 1),
(13, 'Veterinarios', '0', NULL, 1),
(14, 'Psicólogos', '0', NULL, 1),
(15, 'Bioquimicas', '0', NULL, 1),
(16, 'Economistas', '0', NULL, 1),
(17, 'Otros Profesionales Independientes', '0', NULL, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_validme_applicants`
--

CREATE TABLE `mod_validme_applicants` (
  `mod_va_id` int NOT NULL,
  `mod_va_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_va_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_va_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_va_type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'individual',
  `mod_va_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_va_date_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_va_date_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `mod_va_ent_id` int DEFAULT NULL,
  `mod_va_status` int DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_validme_applicants`
--

INSERT INTO `mod_validme_applicants` (`mod_va_id`, `mod_va_name`, `mod_va_email`, `mod_va_phone`, `mod_va_type`, `mod_va_json`, `mod_va_date_created`, `mod_va_date_updated`, `mod_va_ent_id`, `mod_va_status`) VALUES
(1, 'Jess Fido', 'jess.fido@example.com', '+1234567890', 'individual', NULL, '2025-04-19 09:02:15', '2025-04-19 09:02:15', 1, 1),
(2, 'Sam Blanc', 'sam.blanc@example.com', '+1234567891', 'individual', NULL, '2025-04-19 09:02:15', '2025-04-19 09:02:15', 1, 1),
(3, 'Kyle Roberts', 'kyle.roberts@example.com', '+1234567892', 'individual', NULL, '2025-04-19 09:02:15', '2025-04-19 09:02:15', 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_validme_callback_logs`
--

CREATE TABLE `mod_validme_callback_logs` (
  `mod_vcl_id` int NOT NULL COMMENT 'ID único del log',
  `mod_vcl_applicant_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ID del solicitante relacionado',
  `mod_vcl_applicant_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Correo electrónico del solicitante',
  `mod_vcl_applicant_phone_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Número de teléfono del solicitante',
  `mod_vcl_organization_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ID de la organización',
  `mod_vcl_webhook_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'URL del webhook',
  `mod_vcl_request` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos enviados en la solicitud',
  `mod_vcl_files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Archivos adjuntos',
  `mod_vcl_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Respuesta recibida',
  `mod_vcl_verifications_files` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Archivos adjuntos',
  `mod_vcl_text_payload` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Payload',
  `mod_vcl_status_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código de estado HTTP',
  `mod_vcl_status_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Tipo de estado del callback',
  `mod_vcl_code_verification` int DEFAULT NULL COMMENT 'Código de verificación',
  `mod_vcl_success` tinyint(1) DEFAULT '0' COMMENT 'Indicador de éxito (1=éxito, 0=error)',
  `mod_vcl_attempts` int DEFAULT '1' COMMENT 'Número de intentos realizados',
  `mod_vcl_error_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Mensaje de error si lo hay',
  `mod_vcl_date_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `mod_vcl_date_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización',
  `mod_vcl_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_vcl_state` int DEFAULT '1' COMMENT 'Estado (1=activo, 0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Log de callbacks de respuesta';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_validme_checks`
--

CREATE TABLE `mod_validme_checks` (
  `mod_vc_id` int NOT NULL,
  `mod_vc_applicant_id` int NOT NULL,
  `mod_vc_type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'background',
  `mod_vc_progress` enum('PENDING','IN_PROGRESS','COMPLETED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'PENDING',
  `mod_vc_result` enum('CLEAR','CONSIDER','ALERT') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mod_vc_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_vc_date_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `mod_vc_date_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `mod_vc_ent_id` int DEFAULT NULL,
  `mod_vc_status` int DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `mod_validme_checks`
--

INSERT INTO `mod_validme_checks` (`mod_vc_id`, `mod_vc_applicant_id`, `mod_vc_type`, `mod_vc_progress`, `mod_vc_result`, `mod_vc_json`, `mod_vc_date_created`, `mod_vc_date_updated`, `mod_vc_ent_id`, `mod_vc_status`) VALUES
(1, 1, 'background', 'COMPLETED', 'CLEAR', NULL, '2025-04-19 09:02:18', '2025-04-19 09:02:18', 1, 1),
(2, 2, 'background', 'COMPLETED', 'CONSIDER', NULL, '2025-04-19 09:02:18', '2025-04-19 09:02:18', 1, 1),
(3, 3, 'background', 'COMPLETED', 'CLEAR', NULL, '2025-04-19 09:02:18', '2025-04-19 09:02:18', 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_validme_options`
--

CREATE TABLE `mod_validme_options` (
  `mod_vo_id` int NOT NULL COMMENT 'ID único de opción',
  `mod_vo_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre de la opción',
  `mod_vo_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de la opción',
  `mod_vo_autoload` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'yes' COMMENT 'Autoload',
  `mod_vo_date_created` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `mod_vo_date_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Última actualización'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Opciones de Validme';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_vms_commission_rules`
--

CREATE TABLE `mod_vms_commission_rules` (
  `mod_vcr_id` int UNSIGNED NOT NULL COMMENT 'Identificador único de la regla de comisión',
  `mod_vcr_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre de la regla (Ej: Electronica_Estandar)',
  `mod_vcr_type` enum('FIXED','PERCENTAGE','TIERED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de cálculo de comisión',
  `mod_vcr_percentage` decimal(5,4) DEFAULT NULL COMMENT 'Porcentaje a aplicar (si es tipo PERCENTAGE)',
  `mod_vcr_fixed_amount` decimal(10,2) DEFAULT NULL COMMENT 'Monto fijo a aplicar (si es tipo FIXED)',
  `mod_vcr_start_date` date NOT NULL COMMENT 'Fecha de inicio de vigencia',
  `mod_vcr_end_date` date DEFAULT NULL COMMENT 'Fecha de fin de vigencia (NULL si es indefinida)',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Reglas maestras para calcular la comisión marketplace-vendor';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_vms_performance`
--

CREATE TABLE `mod_vms_performance` (
  `mod_vp_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único de la métrica',
  `mod_vp_vv_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID del vendedor (mod_vv_id)',
  `mod_vp_date_recorded` date NOT NULL COMMENT 'Fecha de registro de la métrica',
  `mod_vp_ots_rate` decimal(5,4) DEFAULT NULL COMMENT 'Tasa de envío a tiempo (On-Time Shipping Rate)',
  `mod_vp_cancellation_rate` decimal(5,4) DEFAULT NULL COMMENT 'Tasa de cancelación de pedidos',
  `mod_vp_avg_rating` decimal(3,2) DEFAULT NULL COMMENT 'Promedio de Reseñas (desde CCM)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Métricas diarias de rendimiento (alimentadas por BI)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_vms_vendors`
--

CREATE TABLE `mod_vms_vendors` (
  `mod_vv_id` int UNSIGNED NOT NULL COMMENT 'Identificador único del vendedor (Vendor)',
  `mod_vv_legal_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre legal o razón social del vendedor',
  `mod_vv_contact_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Correo electrónico de contacto',
  `mod_vv_kyc_status` enum('PENDING','APPROVED','REJECTED') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Estado de verificación (KYC/Compliance)',
  `mod_vv_payout_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'Detalles de la cuenta bancaria para liquidación (idealmente encriptados)',
  `mod_vv_onboarding_date` date NOT NULL COMMENT 'Fecha de alta en la plataforma',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro',
  `mod_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de última actualización',
  `mod_status` int DEFAULT '1' COMMENT 'Estado (1=activo, 0=inactivo)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Registro de Vendedores del Marketplace';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_warehouses`
--

CREATE TABLE `mod_warehouses` (
  `mod_wrh_id` int NOT NULL,
  `mod_wrh_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `mod_wrh_details` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `mod_wrh_primary` bit(2) DEFAULT b'0',
  `mod_wrh_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_wms_movement_log`
--

CREATE TABLE `mod_wms_movement_log` (
  `mod_wm_id` bigint UNSIGNED NOT NULL COMMENT 'Identificador único del movimiento de inventario',
  `mod_wm_ps_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID del SKU (mod_ps_id)',
  `mod_wm_transaction_ref_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Referencia a Order_Item, Return, or Purchase_Order',
  `mod_wm_type` enum('RECEIVE','PICK','ADJUSTMENT','TRANSFER_IN','TRANSFER_OUT','RETURN_RESTOCK') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de evento que causó el cambio de stock',
  `mod_wm_from_bin_id` int UNSIGNED DEFAULT NULL COMMENT 'Ubicación (bin) de origen (NULL si es recepción)',
  `mod_wm_to_bin_id` int UNSIGNED DEFAULT NULL COMMENT 'Ubicación (bin) de destino (NULL si es consumo/pick)',
  `mod_wm_qty_change` int NOT NULL COMMENT 'Cantidad neta que afecta a la ubicación de destino (+/-)',
  `mod_wm_he_id` int UNSIGNED DEFAULT NULL COMMENT 'ID del empleado responsable (para auditoría)',
  `mod_wm_timestamp` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Momento exacto del movimiento'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Ledger inmutable de movimientos de stock para trazabilidad y auditoría';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_wms_stock`
--

CREATE TABLE `mod_wms_stock` (
  `mod_ws_ps_id` bigint UNSIGNED NOT NULL COMMENT 'Referencia al ID del SKU (mod_ps_id)',
  `mod_ws_wb_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID del bin (mod_wb_id)',
  `mod_ws_qty` int NOT NULL DEFAULT '0' COMMENT 'Cantidad de stock disponible en esta ubicación',
  `mod_ws_last_updated` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha y hora de la última actualización de cantidad'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Balance de Stock actual por SKU y Ubicación (Derivado del Ledger)';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_wms_storage_bins`
--

CREATE TABLE `mod_wms_storage_bins` (
  `mod_wb_id` int UNSIGNED NOT NULL COMMENT 'Identificador único del bin (ubicación granular)',
  `mod_wb_ww_id` int UNSIGNED NOT NULL COMMENT 'Referencia al ID del almacén (mod_ww_id)',
  `mod_wb_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Código de ubicación (Ej: A1-03-B)',
  `mod_wb_zone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Zona o área dentro del almacén',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Ubicaciones físicas granulares dentro de los almacenes';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `mod_wms_warehouses`
--

CREATE TABLE `mod_wms_warehouses` (
  `mod_ww_id` int UNSIGNED NOT NULL COMMENT 'Identificador único del almacén',
  `mod_ww_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del almacén o centro de distribución',
  `mod_ww_address_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'Detalles de ubicación física (lat/long, dirección)',
  `mod_ww_is_fulfillment` tinyint(1) DEFAULT '1' COMMENT 'Indica si se usa para cumplir órdenes de cliente',
  `mod_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del registro'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Maestro de Almacenes Físicos';

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `notifications`
--

CREATE TABLE `notifications` (
  `ntf_id` int NOT NULL,
  `ntf_recipient_id` int NOT NULL COMMENT 'Id del destinatario',
  `ntf_recipient_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de destinatario (customer,provider)',
  `ntf_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ntf_sent_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ntf_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'pending,send,delivered',
  `ntf_ent_id` int NOT NULL,
  `ntf_custom_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
  `ntf_class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `ntf_custom_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `ntf_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `options`
--

CREATE TABLE `options` (
  `option_id` bigint UNSIGNED NOT NULL,
  `option_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `option_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `autoload` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'yes'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `options`
--

INSERT INTO `options` (`option_id`, `option_name`, `option_value`, `autoload`) VALUES
(1, 'site_title', 'Ion', 'yes'),
(2, 'site_favicon', 'ion/assets/img/favicon.png', 'yes'),
(3, 'site_img', 'ion/assets/img/logo.svg', 'yes'),
(4, 'site_version', '22662', 'yes'),
(5, 'user_id_default', '3', 'yes'),
(6, 'bearer_token', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI3MjM0OTIzODczNDkiLCJuYW1lIjoibnVjbGVvIiwiaWF0Ijo5MzI0MjQzNDl9.jIsiHIdOGa-KHCJ2mUhLLKqlvTYVLolUyrp1HM6E7Cs-gedeon', 'yes'),
(7, 'client_id', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9-gedeon', 'yes'),
(8, 'client_secret', 'eyJzdWIiOiI3MjM0OTIzODczNDkiLCJuYW1lIjoibnVjbGVvIiwiaWF0Ijo5MzI0MjQzNDl9-gedeon', 'yes'),
(9, 'locale', 'es_ES', 'yes'),
(10, 'timezone', 'America/La_Paz', 'yes'),
(12, 'site-meta', 'sites/default/controllers/pub/meta.pub.php', 'yes'),
(13, 'entitie_id_default', '1', 'yes'),
(14, 'dashboard_img', 'assets/img/logo.svg', 'yes'),
(15, 'dashboard_favicon', 'assets/img/favicon.png', 'yes'),
(16, 'dashboard_brand', 'assets/img/logo.svg', 'yes'),
(17, 'path_icons_pub', 'ion/assets/img/pubs', 'yes'),
(18, 'dial_code_default', '+591', 'yes'),
(19, 'country', 'bo', 'yes'),
(20, 'cron', '', 'yes'),
(21, 'path_activation', '{{_PATH_WEB}}activation', 'yes'),
(22, 'callback', '', 'yes'),
(23, 'footer', 'Nucleo v1.0', 'yes'),
(24, 'path_resetpw', '{{_PATH_WEB}}pages/reserpassword.php', 'yes'),
(26, 'path_logo', '{{_PATH_WEB}}assets/img/logo.svg', 'yes');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `posts`
--

CREATE TABLE `posts` (
  `post_id` int NOT NULL,
  `post_title` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_pathurl` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_shortlink` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_review` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `post_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0',
  `post_img_ref` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_embed` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `post_preview_embed` int DEFAULT '0',
  `post_intern_embed` int DEFAULT '0',
  `post_video` int DEFAULT '0',
  `post_preview_video` int DEFAULT '0',
  `post_intern_video` int DEFAULT '0',
  `post_body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `post_place` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `post_author` int DEFAULT NULL,
  `post_cls` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_top_relations` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_middle_relations` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_last_relations` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `post_date` datetime DEFAULT NULL,
  `post_register_date` datetime NOT NULL,
  `post_ent_id` int DEFAULT NULL,
  `post_user_id` int DEFAULT NULL,
  `post_state` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `posts_authors`
--

CREATE TABLE `posts_authors` (
  `post_au_id` int NOT NULL,
  `post_au_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_au_summary` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `post_au_img` int DEFAULT '0',
  `post_au_ent_id` int DEFAULT NULL,
  `post_au_contact` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `post_au_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `post_au_state` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `posts_authors`
--

INSERT INTO `posts_authors` (`post_au_id`, `post_au_name`, `post_au_summary`, `post_au_img`, `post_au_ent_id`, `post_au_contact`, `post_au_path`, `post_au_state`) VALUES
(1, '', '', 0, 1, '', '', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `posts_categorys`
--

CREATE TABLE `posts_categorys` (
  `post_cat_post_id` int NOT NULL,
  `post_cat_cat_id` int NOT NULL,
  `post_cat_ent_id` int DEFAULT NULL,
  `post_cat_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `posts_files`
--

CREATE TABLE `posts_files` (
  `post_file_post_id` int NOT NULL,
  `post_file_file_id` int NOT NULL,
  `post_file_order` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `publications`
--

CREATE TABLE `publications` (
  `pub_id` int NOT NULL,
  `pub_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `pub_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_summary` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pub_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_path_ui` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_path_icon` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_icon` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_class` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_attr_id` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_attr` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pub_count` int DEFAULT NULL,
  `pub_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `pub_html` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `pub_state` int DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `publications`
--

INSERT INTO `publications` (`pub_id`, `pub_name`, `pub_description`, `pub_title`, `pub_summary`, `pub_path`, `pub_path_ui`, `pub_path_icon`, `pub_icon`, `pub_type`, `pub_class`, `pub_attr_id`, `pub_attr`, `pub_count`, `pub_json`, `pub_html`, `pub_state`) VALUES
(7, 'Nav', 'Barra de Navegación de la página', '', '', 'sites/default/controllers/pub/nav.pub.php', '', 'sites/default/assets/img/pubs/nav.pub.svg', '', 'host', 'pub-nav', '', '', 1, '', '', 1),
(8, 'home', '', '', '', 'sites/default/controllers/pub/home.pub.php', '', '', '', 'host', 'pub-home', '', '', 1, '', '', 1),
(9, 'map', '', '', '', 'sites/default/controllers/pub/map.pub.php', '', '', '', 'host', 'pub-map', '', '', 1, '', '', 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `publications_pattern`
--

CREATE TABLE `publications_pattern` (
  `pub_pat_id` int NOT NULL,
  `pub_pat_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pub_pat_description` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pub_pat_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pub_pat_ent_id` int DEFAULT '0',
  `pub_pat_order` int DEFAULT '0',
  `pub_pat_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `publications_relations`
--

CREATE TABLE `publications_relations` (
  `pub_rel_id` int NOT NULL,
  `pub_rel_cat_id` int DEFAULT NULL,
  `pub_rel_ws_id` int DEFAULT NULL,
  `pub_rel_block_id` int DEFAULT NULL,
  `pub_rel_pub_id` int DEFAULT NULL,
  `pub_rel_state` int NOT NULL DEFAULT '1',
  `pub_rel_order` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `publications_relations`
--

INSERT INTO `publications_relations` (`pub_rel_id`, `pub_rel_cat_id`, `pub_rel_ws_id`, `pub_rel_block_id`, `pub_rel_pub_id`, `pub_rel_state`, `pub_rel_order`) VALUES
(1, 1, 1, 1, 7, 1, 1),
(2, 1, 1, 2, 8, 1, 1),
(3, 6, 1, 2, 9, 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `roles`
--

CREATE TABLE `roles` (
  `rol_id` int NOT NULL,
  `rol_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `rol_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `rol_parent_id` int DEFAULT NULL,
  `rol_redirection_url` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `rol_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `rol_state` int DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `roles`
--

INSERT INTO `roles` (`rol_id`, `rol_name`, `rol_description`, `rol_parent_id`, `rol_redirection_url`, `rol_json`, `rol_state`) VALUES
(1, 'Super Administrador', NULL, 0, '{_PATH_WEB}dashboard', NULL, 1),
(2, 'Administrador', NULL, 1, '{_PATH_WEB}dashboard', NULL, 1),
(3, 'Administrador de Entidad', NULL, 2, '{_PATH_WEB}dashboard', NULL, 1),
(4, 'Administrador RRHH', NULL, 2, '{_PATH_WEB}dashboard', NULL, 1),
(10, 'Encargado de Contabilidad', NULL, 2, '{_PATH_WEB}dashboard', NULL, 1),
(5, 'Jefe de Inventario', NULL, 2, '{_PATH_WEB}dashboard', NULL, 1),
(6, 'Digitador', NULL, 2, '{_PATH_WEB}dashboard', NULL, 1),
(11, 'Encargado de Ventas', NULL, 2, '{_PATH_WEB}dashboard', NULL, 0),
(12, 'Encargado de Mantenimiento\r\n', NULL, 2, '{_PATH_WEB}dashboard', NULL, 0);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `roles_categorys`
--

CREATE TABLE `roles_categorys` (
  `rol_cat_rol_id` int NOT NULL,
  `rol_cat_cat_id` int NOT NULL,
  `rol_cat_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `roles_entities`
--

CREATE TABLE `roles_entities` (
  `rol_ent_rol_id` int NOT NULL,
  `rol_ent_ent_id` int NOT NULL,
  `rol_ent_state` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `roles_modules`
--

CREATE TABLE `roles_modules` (
  `rol_mod_rol_id` int NOT NULL,
  `rol_mod_mod_id` int NOT NULL,
  `rol_mod_ent_id` int NOT NULL,
  `rol_mod_order` int NOT NULL,
  `rol_mod_permits` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0,0,0,0,0' COMMENT 'See,Publish,Add,Edit,Delete'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `roles_modules`
--

INSERT INTO `roles_modules` (`rol_mod_rol_id`, `rol_mod_mod_id`, `rol_mod_ent_id`, `rol_mod_order`, `rol_mod_permits`) VALUES
(5, 500, 1, 1, '0,0,0,0,0'),
(6, 500, 1, 0, '0,0,0,0,0'),
(7, 500, 1, 0, '0,0,0,0,0'),
(5, 501, 1, 1, '0,0,0,0,0'),
(6, 501, 1, 0, '0,0,0,0,0'),
(7, 501, 1, 1, '0,0,0,0,0'),
(10, 1000, 1, 1, '0,0,0,0,0'),
(10, 1001, 1, 1, '0,0,0,0,0');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `roles_sites`
--

CREATE TABLE `roles_sites` (
  `rol_site_rol_id` int NOT NULL COMMENT 'ID del rol',
  `rol_site_site_id` int NOT NULL COMMENT 'ID del sitio',
  `rol_site_order` int NOT NULL COMMENT 'Orden del rol en el sitio'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `roles_systems`
--

CREATE TABLE `roles_systems` (
  `rol_sys_rol_id` int NOT NULL,
  `rol_sys_sys_id` int NOT NULL,
  `rol_sys_ent_id` int NOT NULL,
  `rol_sys_order` int DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `roles_systems`
--

INSERT INTO `roles_systems` (`rol_sys_rol_id`, `rol_sys_sys_id`, `rol_sys_ent_id`, `rol_sys_order`) VALUES
(2, 6, 1, 0),
(5, 6, 1, 1),
(6, 6, 1, 2),
(7, 6, 1, 0),
(10, 5, 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `sites`
--

CREATE TABLE `sites` (
  `site_id` int NOT NULL COMMENT 'ID único del sitio',
  `site_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre descriptivo del sitio',
  `site_path_web` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'URL completa del sitio (ej: https://example.com/)',
  `site_path_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Ruta física del servidor (ej: /var/www/html/)',
  `site_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Título del sitio para SEO y navegador',
  `site_head` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Código HTML personalizado para la sección <head>',
  `site_head_path_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'URL del archivo head externo',
  `site_default` int NOT NULL DEFAULT '0' COMMENT 'Indica si es el sitio por defecto (0=No, 1=Sí)',
  `site_created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación del sitio',
  `site_updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Última actualización del sitio',
  `site_ent_id` int NOT NULL DEFAULT '0' COMMENT 'ID de la entidad propietaria del sitio',
  `site_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del sitio (0=Inactivo, 1=Activo, 2=Mantenimiento, 3=Suspendido)'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `sites`
--

INSERT INTO `sites` (`site_id`, `site_name`, `site_path_web`, `site_path_host`, `site_title`, `site_head`, `site_head_path_url`, `site_default`, `site_created_at`, `site_updated_at`, `site_ent_id`, `site_state`) VALUES
(1, 'Sitio 1', 'https://dev.wappcom.com/home/site/', '/var/html/', 'Sitio 1', '', '', 0, '2025-12-10 00:24:23', '2025-12-10 00:24:23', 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `sites_entities`
--

CREATE TABLE `sites_entities` (
  `site_ent_site_id` int NOT NULL COMMENT 'ID del sitio',
  `site_ent_ent_id` int NOT NULL COMMENT 'ID de la entidad asociada',
  `site_ent_order` int NOT NULL COMMENT 'Orden de la entidad en el sitio'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `sites_users`
--

CREATE TABLE `sites_users` (
  `site_user_site_id` int NOT NULL COMMENT 'ID del sitio',
  `site_user_user_id` int NOT NULL COMMENT 'ID del usuario',
  `site_user_rol_id` int NOT NULL COMMENT 'ID del rol asignado al usuario en el sitio',
  `site_user_order` int NOT NULL COMMENT 'Orden del usuario en el sitio'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `systems`
--

CREATE TABLE `systems` (
  `sys_id` int NOT NULL,
  `sys_name` varchar(255) DEFAULT NULL,
  `sys_description` tinytext,
  `sys_pathurl` varchar(500) DEFAULT NULL,
  `sys_path` varchar(500) DEFAULT NULL,
  `sys_mod_default` int NOT NULL DEFAULT '0',
  `sys_code` varchar(11) NOT NULL,
  `sys_icon` varchar(240) DEFAULT NULL,
  `sys_color` varchar(10) DEFAULT NULL,
  `sys_parent_id` int DEFAULT NULL,
  `sys_indexjs` varchar(255) NOT NULL,
  `sys_css` varchar(255) NOT NULL,
  `sys_order` int NOT NULL,
  `sys_state` int NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Volcado de datos para la tabla `systems`
--

INSERT INTO `systems` (`sys_id`, `sys_name`, `sys_description`, `sys_pathurl`, `sys_path`, `sys_mod_default`, `sys_code`, `sys_icon`, `sys_color`, `sys_parent_id`, `sys_indexjs`, `sys_css`, `sys_order`, `sys_state`) VALUES
(1, 'Websites', NULL, 'websites', 'modules/websites/', 10, '', 'icon icon-code', '#6F91E9', 0, 'components/websites.js', 'assets/css/dist/websites.css', 0, 1),
(2, 'Recursos Humanos', NULL, 'rrhh', 'modules/rrhh/', 200, '', 'icon icon-category', '#6F91E9', 0, 'components/rrhh.js', 'assets/css/dist/rrhh.css', 0, 1),
(4, 'Inventario', NULL, 'inventory', 'modules/inventory/', 400, '', 'icon icon-box', '#FEBF10', 0, 'components/inventory.js', 'assets/css/dist/inventory.css', 0, 1),
(5, 'Contabilidad', NULL, 'accounting', 'modules/accounting/', 500, '', 'icon icon-coin', '#6F91E9', 0, 'components/accounting.js', 'assets/css/dist/accounting.css', 0, 1),
(6, 'Consejeria', NULL, 'counseling', 'modules/counseling/', 600, '', 'icon icon-users', '#27d27c', 0, 'components/counseling.js', 'assets/css/dist/counseling.css', 0, 1),
(7, 'Ventas', NULL, 'sales', 'modules/sales/', 700, '', 'icon icon-sales', '#fc9835', 0, 'components/sales.js', 'assets/css/dist/sales.css', 0, 0),
(8, 'Brokers', NULL, 'brokers', 'modules/brokers/', 800, '', 'icon icon-circle-doble', '#27d27c', 0, 'components/brokers.js', 'assets/css/dist/brokers.css', 0, 0),
(10, 'Suscriptiones', NULL, 'suscriptions', 'core/accounts/', 1000, '', 'icon icon-tag', '#1be5fc', 0, 'components/subscriptions.js', 'assets/css/dist/subscriptions.css', 0, 1),
(12, 'Finalcial Services Leeds', NULL, 'fls', 'modules/fls/', 1200, '', 'icon icon-circle', '#27d27c', 0, 'components/fls.js', 'assets/css/dist/fls.css', 0, 0),
(13, 'Boletería', NULL, 'tickets', 'modules/tickets/', 1300, '', 'icon icon-tag', '#27d27c', 0, 'components/tickets.js', 'assets/css/dist/tickets.min.css', 0, 1),
(14, 'Rehabilitación', NULL, 'rehabilitation', 'modules/rehabilitation/', 1400, '', 'icon icon-user', '#6F91E', 0, 'components/rehabilitation.js', 'assets/css/dist/rehabilitation.min.css', 0, 1),
(15, 'Ads', NULL, 'ads', 'modules/ads/', 1500, '', 'icon icon-loudspeaker', '#e71882', 0, 'components/ads.js', 'assets/css/dist/ads.min.css', 0, 1),
(16, 'LMS', NULL, 'lms', 'modules/lms/', 1600, '', 'icon icon-graduation', '#FEBF10', 0, 'components/lms.js', 'assets/css/dist/lms.min.css', 0, 1),
(17, 'Activo Fijo', NULL, 'fixedassets', 'modules/fixedassets/', 1700, '', 'icon icon-fixed-assets', '#9c27b0', 0, 'components/fixedassets.js', 'assets/css/dist/fixedassets.min.css', 0, 1),
(18, 'Operaciones', NULL, 'operations', 'modules/operations/', 1800, '', 'icon icon-operations', '#258dfc', 0, 'components/operations.js', 'assets/css/dist/operations.min.css', 0, 1),
(19, 'CRM', NULL, 'crm', 'modules/crm/', 1900, '', 'icon icon-crm', '#ef4848', 0, 'components/crm.js', 'assets/css/dist/crm.min.css', 0, 1),
(20, 'Restaurant', NULL, 'restaurants', 'modules/restaurants/', 2000, '', 'icon icon-restaurant', '#6b6fa9', 0, 'components/restaurants.js', 'assets/css/dist/restaurants.min.css', 0, 1),
(21, 'Doc. Externos', NULL, 'externaldocuments', 'modules/externaldocuments/', 2100, '', 'icon icon-doc', '#6b6fa9', 0, 'components/externaldocuments.js', 'assets/css/dist/externaldocuments.min.css', 0, 1),
(22, 'Geoposición', NULL, 'geolocation', 'modules/geolocation/', 2200, '', 'icon icon-pointer-route', '#00d853', 0, 'components/geolocation.js', 'assets/css/dist/geolocation.min.css', 0, 1),
(23, 'Deportes', NULL, 'sports', 'modules/sports/', 2200, '', 'icon icon-sport', '#ff7629', 0, 'components/sports.js', 'assets/css/dist/sports.min.css', 0, 1),
(24, 'Concursos', NULL, 'competitions', 'modules/competitions/', 2400, '', 'icon icon-copy', '#ff3333', 0, 'components/competitions.js', 'assets/css/dist/competitions.min.css', 0, 1),
(36, 'Ganador App', NULL, 'ganadorapp', 'modules/app_ganador/', 3600, '', 'icon icon-table-check', '#00d767', 0, 'components/app_ganador.js', 'assets/css/dist/app_ganador.min.css', 0, 1),
(37, 'Tributo App', NULL, 'app_tributo', 'modules/app_tributo/', 3700, '', 'icon icon-coin', '#003767', 0, 'components/app_tributo.js', 'assets/css/dist/app_tributo.min.css', 0, 1),
(38, 'Finance (GL)', 'Gestión Financiera y Contabilidad General', 'finance', 'modules/finance/', 3800, '', 'icon icon-coin', '#10b981', 0, 'components/finance.js', 'assets/css/dist/finance.min.css', 0, 1),
(39, 'REMS', NULL, 'rems', 'modules/rems/', 3900, '', 'icon icon-home', '#003900', 0, 'components/rems.js', 'assets/css/dist/rems.min.css', 0, 1),
(40, 'PIM', 'Product Information Management - Gestión de Información de Productos', 'pim', 'modules/pim/', 4000, '', 'icon icon-box', '#f59e0b', 0, 'components/pim.js', 'assets/css/dist/pim.min.css', 0, 1),
(41, 'WMS', 'Warehouse Management System - Gestión de Almacenes e Inventario', 'wms', 'modules/wms/', 4100, '', 'icon icon-checked', '#06b6d4', 0, 'components/wms.js', 'assets/css/dist/wms.min.css', 0, 1),
(42, 'OMS', 'Order Management System - Gestión de Órdenes y Fulfillment', 'oms', 'modules/oms/', 4200, '', 'icon icon-sales', '#ef4444', 0, 'components/oms.js', 'assets/css/dist/oms.min.css', 0, 1),
(43, 'FSS', 'Financial Settlement System - Sistema de Liquidación Financiera', 'fss', 'modules/fss/', 4300, '', 'icon icon-coin', '#14b8a6', 0, 'components/fss.js', 'assets/css/dist/fss.min.css', 0, 1),
(44, 'CCM', 'Customer & Communication Management - Gestión de Clientes y Comunicación', 'ccm', 'modules/ccm/', 4400, '', 'icon icon-users', '#ec4899', 0, 'components/ccm.js', 'assets/css/dist/ccm.min.css', 0, 1),
(45, 'BI Analytics', 'Business Intelligence - Análisis y Reportes', 'bi', 'modules/bi/', 4500, '', 'icon icon-table-check', '#6366f1', 0, 'components/bi.js', 'assets/css/dist/bi.min.css', 0, 1),
(46, 'VMS', 'Vendor Management System - Gestión de Vendedores', 'vms', 'modules/vms/', 4600, '', 'icon icon-users', '#8b5cf6', 0, 'components/vms.js', 'assets/css/dist/vms.min.css', 0, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `systems_modules`
--

CREATE TABLE `systems_modules` (
  `sys_mod_sys_id` int NOT NULL,
  `sys_mod_mod_id` int NOT NULL,
  `sys_mod_ent_id` int NOT NULL,
  `sys_mod_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Volcado de datos para la tabla `systems_modules`
--

INSERT INTO `systems_modules` (`sys_mod_sys_id`, `sys_mod_mod_id`, `sys_mod_ent_id`, `sys_mod_order`) VALUES
(1, 10, 1, 1),
(1, 11, 1, 2),
(1, 12, 1, 3),
(1, 13, 1, 4),
(1, 14, 1, 5),
(1, 15, 1, 6),
(1, 16, 1, 7),
(1, 17, 1, 8),
(1, 18, 1, 9),
(1, 19, 1, 10),
(2, 200, 1, 1),
(2, 210, 1, 2),
(2, 220, 1, 3),
(4, 400, 1, 1),
(4, 401, 1, 2),
(4, 402, 1, 1),
(4, 403, 1, 2),
(5, 500, 1, 1),
(6, 600, 1, 1),
(6, 601, 1, 2),
(6, 602, 1, 3),
(6, 603, 1, 4),
(7, 700, 1, 1),
(7, 701, 1, 2),
(8, 800, 1, 1),
(8, 801, 1, 2),
(10, 1000, 1, 1),
(10, 1001, 1, 2),
(10, 1002, 1, 3),
(12, 1200, 1, 1),
(12, 1201, 1, 2),
(13, 1300, 1, 1),
(13, 1301, 1, 2),
(14, 1400, 1, 1),
(14, 1401, 1, 2),
(15, 1500, 1, 1),
(15, 1501, 1, 2),
(15, 1502, 1, 3),
(15, 1503, 1, 4),
(16, 1600, 1, 1),
(16, 1601, 1, 2),
(17, 1700, 1, 1),
(17, 1701, 1, 2),
(18, 1800, 1, 1),
(19, 1900, 1, 1),
(19, 1901, 1, 2),
(19, 1902, 1, 3),
(19, 1903, 1, 4),
(20, 2000, 1, 1),
(20, 2001, 1, 2),
(21, 2100, 1, 1),
(21, 2101, 1, 2),
(21, 2102, 1, 2),
(21, 2103, 1, 2),
(22, 2201, 1, 1),
(23, 2300, 1, 1),
(23, 2301, 1, 2),
(24, 2400, 1, 1),
(36, 3600, 1, 1),
(36, 3690, 1, 2),
(36, 3691, 1, 3),
(36, 3692, 1, 4),
(37, 3700, 1, 1),
(37, 3701, 1, 2),
(37, 3702, 1, 3),
(37, 3703, 1, 4),
(38, 3800, 1, 1),
(38, 3801, 1, 2),
(38, 3802, 1, 3),
(39, 3900, 1, 1),
(39, 3901, 1, 2),
(39, 3902, 1, 3),
(39, 3903, 1, 4),
(39, 3904, 1, 5),
(39, 3905, 1, 6),
(39, 3906, 1, 7),
(39, 3907, 1, 8),
(39, 3908, 1, 9),
(39, 3909, 1, 10),
(39, 3910, 1, 11),
(39, 3911, 1, 12),
(39, 3912, 1, 13),
(39, 3913, 1, 14),
(39, 3914, 1, 15),
(39, 3915, 1, 16),
(39, 3916, 1, 17),
(40, 4000, 1, 1),
(40, 4001, 1, 2),
(40, 4002, 1, 3),
(40, 4003, 1, 4),
(41, 4100, 1, 1),
(41, 4101, 1, 2),
(41, 4102, 1, 3),
(42, 4200, 1, 1),
(42, 4201, 1, 2),
(42, 4202, 1, 3),
(42, 4203, 1, 4),
(42, 4204, 1, 5),
(43, 4300, 1, 1),
(43, 4301, 1, 2),
(44, 4400, 1, 1),
(44, 4401, 1, 2),
(44, 4402, 1, 3),
(45, 4500, 1, 1),
(45, 4501, 1, 2),
(45, 4502, 1, 3),
(46, 4600, 1, 1),
(46, 4601, 1, 2),
(46, 4602, 1, 3);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `users_firms`
--

CREATE TABLE `users_firms` (
  `user_firm_id` int NOT NULL,
  `user_firm_user_id` int NOT NULL,
  `user_firm_img` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `user_firm_reference` int DEFAULT NULL,
  `user_firm_md5` int DEFAULT NULL,
  `user_firm_state` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `users_groups`
--

CREATE TABLE `users_groups` (
  `user_group_user_id` int NOT NULL,
  `user_group_group_id` int NOT NULL,
  `user_group_ent_id` int NOT NULL,
  `user_group_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `users_path`
--

CREATE TABLE `users_path` (
  `user_path_user_id` int NOT NULL,
  `user_path_mod_id` int NOT NULL,
  `user_path_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `user_path_order` int NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `users_roles`
--

CREATE TABLE `users_roles` (
  `user_rol_user_id` int NOT NULL,
  `user_rol_rol_id` int NOT NULL,
  `user_rol_ent_id` int NOT NULL,
  `user_rol_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `users_roles`
--

INSERT INTO `users_roles` (`user_rol_user_id`, `user_rol_rol_id`, `user_rol_ent_id`, `user_rol_order`) VALUES
(1, 1, 1, 0),
(3, 10, 1, 1),
(4, 10, 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `users_tabs`
--

CREATE TABLE `users_tabs` (
  `user_tab_user_id` int NOT NULL,
  `user_tab_sys_id` int NOT NULL,
  `user_tab_ent_id` int NOT NULL,
  `user_tab_sys_active` int NOT NULL,
  `user_tab_start_mod_id` int DEFAULT '0',
  `user_tab_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `user_tab_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `users_tabs`
--

INSERT INTO `users_tabs` (`user_tab_user_id`, `user_tab_sys_id`, `user_tab_ent_id`, `user_tab_sys_active`, `user_tab_start_mod_id`, `user_tab_json`, `user_tab_order`) VALUES
(1, 1, 1, 0, 18, NULL, 2),
(1, 19, 1, 1, 1902, NULL, 1),
(1, 40, 1, 0, 4002, NULL, 3);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `worksheets`
--

CREATE TABLE `worksheets` (
  `ws_id` int NOT NULL,
  `ws_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `ws_level` int DEFAULT NULL,
  `ws_class` varchar(44) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ws_ent_id` int NOT NULL DEFAULT '0',
  `ws_state` int DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `worksheets`
--

INSERT INTO `worksheets` (`ws_id`, `ws_name`, `ws_level`, `ws_class`, `ws_ent_id`, `ws_state`) VALUES
(1, 'planilla 1', 1, 'ws1', 1, 1),
(2, 'planilla 2', 2, 'ws2', 1, 1),
(3, 'planilla 3', 3, 'ws3', 1, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `worksheets_blocks`
--

CREATE TABLE `worksheets_blocks` (
  `ws_block_ws_id` int NOT NULL,
  `ws_block_block_id` int NOT NULL,
  `ws_block_order` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Volcado de datos para la tabla `worksheets_blocks`
--

INSERT INTO `worksheets_blocks` (`ws_block_ws_id`, `ws_block_block_id`, `ws_block_order`) VALUES
(1, 1, 1),
(1, 2, 2),
(1, 3, 3);

--
-- Índices para tablas volcadas
--

--
-- Indices de la tabla `ai_categories`
--
ALTER TABLE `ai_categories`
  ADD PRIMARY KEY (`ai_cat_id`) USING BTREE,
  ADD UNIQUE KEY `ai_cat_name` (`ai_cat_name`) USING BTREE;

--
-- Indices de la tabla `ai_categorys`
--
ALTER TABLE `ai_categorys`
  ADD PRIMARY KEY (`ai_cat_id`) USING BTREE,
  ADD UNIQUE KEY `ai_cat_name` (`ai_cat_name`) USING BTREE;

--
-- Indices de la tabla `ai_keys`
--
ALTER TABLE `ai_keys`
  ADD PRIMARY KEY (`ai_key_id`) USING BTREE,
  ADD UNIQUE KEY `ai_key_name` (`ai_key_name`) USING BTREE,
  ADD KEY `idx_provider` (`ai_key_provider`) USING BTREE;

--
-- Indices de la tabla `ai_logs`
--
ALTER TABLE `ai_logs`
  ADD PRIMARY KEY (`ai_log_id`) USING BTREE,
  ADD KEY `idx_fechas` (`ai_log_created_at`) USING BTREE;

--
-- Indices de la tabla `ai_module_relations`
--
ALTER TABLE `ai_module_relations`
  ADD PRIMARY KEY (`ai_mod_rel_id`) USING BTREE;

--
-- Indices de la tabla `ai_prompts`
--
ALTER TABLE `ai_prompts`
  ADD PRIMARY KEY (`ai_prt_id`) USING BTREE,
  ADD KEY `idx_entidad` (`ai_prt_ent_id`) USING BTREE;

--
-- Indices de la tabla `ai_responses`
--
ALTER TABLE `ai_responses`
  ADD PRIMARY KEY (`ai_rsp_id`) USING BTREE,
  ADD KEY `idx_prompt` (`ai_rsp_prompt_id`) USING BTREE;

--
-- Indices de la tabla `ai_responses_history`
--
ALTER TABLE `ai_responses_history`
  ADD PRIMARY KEY (`ai_rsp_id`) USING BTREE,
  ADD KEY `idx_prompt_id` (`ai_rsp_prompt_id`) USING BTREE,
  ADD KEY `idx_ent_id` (`ai_rsp_ent_id`) USING BTREE,
  ADD KEY `idx_operation_time` (`operation_time`) USING BTREE;

--
-- Indices de la tabla `blocks`
--
ALTER TABLE `blocks`
  ADD PRIMARY KEY (`block_id`) USING BTREE;

--
-- Indices de la tabla `categorys`
--
ALTER TABLE `categorys`
  ADD PRIMARY KEY (`cat_id`) USING BTREE;

--
-- Indices de la tabla `categorys_files`
--
ALTER TABLE `categorys_files`
  ADD PRIMARY KEY (`cat_file_file_id`,`cat_file_cat_id`) USING BTREE;

--
-- Indices de la tabla `contents`
--
ALTER TABLE `contents`
  ADD PRIMARY KEY (`cont_id`) USING BTREE;

--
-- Indices de la tabla `contents_categorys`
--
ALTER TABLE `contents_categorys`
  ADD PRIMARY KEY (`cont_cat_cont_id`,`cont_cat_cat_id`) USING BTREE;

--
-- Indices de la tabla `contents_files`
--
ALTER TABLE `contents_files`
  ADD PRIMARY KEY (`cont_file_cont_id`,`cont_file_file_id`) USING BTREE;

--
-- Indices de la tabla `contents_pubs`
--
ALTER TABLE `contents_pubs`
  ADD PRIMARY KEY (`cont_pub_cont_id`,`cont_pub_pub_id`) USING BTREE;

--
-- Indices de la tabla `docs`
--
ALTER TABLE `docs`
  ADD PRIMARY KEY (`doc_id`) USING BTREE;

--
-- Indices de la tabla `docs_categorys`
--
ALTER TABLE `docs_categorys`
  ADD PRIMARY KEY (`doc_cat_doc_id`,`doc_cat_cat_id`) USING BTREE;

--
-- Indices de la tabla `files`
--
ALTER TABLE `files`
  ADD PRIMARY KEY (`file_id`) USING BTREE;

--
-- Indices de la tabla `forms`
--
ALTER TABLE `forms`
  ADD PRIMARY KEY (`form_id`),
  ADD UNIQUE KEY `form_slug` (`form_slug`);

--
-- Indices de la tabla `forms_entries`
--
ALTER TABLE `forms_entries`
  ADD PRIMARY KEY (`form_entry_id`),
  ADD KEY `idx_forms_entries_form` (`form_entry_form_id`),
  ADD KEY `idx_forms_entries_ent` (`form_entry_ent_id`),
  ADD KEY `idx_forms_entries_site` (`form_entry_site_id`);

--
-- Indices de la tabla `forms_fields`
--
ALTER TABLE `forms_fields`
  ADD PRIMARY KEY (`form_fld_id`),
  ADD KEY `idx_forms_fields_form` (`form_fld_form_id`),
  ADD KEY `idx_forms_fields_ent` (`form_fld_ent_id`),
  ADD KEY `idx_forms_fields_site` (`form_fld_site_id`);

--
-- Indices de la tabla `forms_files`
--
ALTER TABLE `forms_files`
  ADD PRIMARY KEY (`form_file_entry_id`,`form_file_file_id`),
  ADD KEY `idx_forms_files_ent` (`form_file_ent_id`),
  ADD KEY `idx_forms_files_site` (`form_file_site_id`);

--
-- Indices de la tabla `forms_values`
--
ALTER TABLE `forms_values`
  ADD PRIMARY KEY (`form_val_entry_id`,`form_val_field_id`),
  ADD KEY `idx_forms_values_field` (`form_val_field_id`),
  ADD KEY `idx_forms_values_ent` (`form_val_ent_id`),
  ADD KEY `idx_forms_values_site` (`form_val_site_id`);

--
-- Indices de la tabla `groups`
--
ALTER TABLE `groups`
  ADD PRIMARY KEY (`group_id`),
  ADD KEY `idx_group_ent_id` (`group_ent_id`),
  ADD KEY `idx_group_state` (`group_state`);

--
-- Indices de la tabla `groups_files`
--
ALTER TABLE `groups_files`
  ADD KEY `idx_gf_group_id` (`group_file_group_id`),
  ADD KEY `idx_gf_file_id` (`group_file_file_id`);

--
-- Indices de la tabla `groups_users`
--
ALTER TABLE `groups_users`
  ADD KEY `idx_gu_group_id` (`group_user_group_id`),
  ADD KEY `idx_gu_user_id` (`group_user_user_id`);

--
-- Indices de la tabla `links`
--
ALTER TABLE `links`
  ADD PRIMARY KEY (`lnk_id`) USING BTREE;

--
-- Indices de la tabla `links_categorys`
--
ALTER TABLE `links_categorys`
  ADD PRIMARY KEY (`lnk_cat_cat_id`,`lnk_cat_lnk_id`) USING BTREE;

--
-- Indices de la tabla `links_pubs`
--
ALTER TABLE `links_pubs`
  ADD PRIMARY KEY (`lnk_pub_pub_id`,`lnk_pub_lnk_id`) USING BTREE;

--
-- Indices de la tabla `media_categorys`
--
ALTER TABLE `media_categorys`
  ADD PRIMARY KEY (`media_cat_file_id`,`media_cat_cat_id`) USING BTREE;

--
-- Indices de la tabla `menus`
--
ALTER TABLE `menus`
  ADD PRIMARY KEY (`menu_id`),
  ADD KEY `idx_menu_site_id` (`menu_site_id`),
  ADD KEY `idx_menu_ent_id` (`menu_ent_id`),
  ADD KEY `idx_menu_state` (`menu_state`),
  ADD KEY `idx_site_state` (`menu_site_id`,`menu_state`);

--
-- Indices de la tabla `menus_items`
--
ALTER TABLE `menus_items`
  ADD PRIMARY KEY (`menu_item_id`),
  ADD KEY `idx_menu_id` (`menu_item_menu_id`),
  ADD KEY `idx_parent_id` (`menu_item_parent_id`),
  ADD KEY `idx_level` (`menu_item_level`),
  ADD KEY `idx_order` (`menu_item_order`),
  ADD KEY `idx_state` (`menu_item_state`),
  ADD KEY `idx_menu_parent` (`menu_item_menu_id`,`menu_item_parent_id`),
  ADD KEY `idx_menu_order` (`menu_item_menu_id`,`menu_item_order`);

--
-- Indices de la tabla `modules`
--
ALTER TABLE `modules`
  ADD PRIMARY KEY (`mod_id`) USING BTREE;

--
-- Indices de la tabla `modules_categorys`
--
ALTER TABLE `modules_categorys`
  ADD PRIMARY KEY (`mod_cat_mod_id`,`mod_cat_cat_id`,`mod_cat_ent_id`) USING BTREE;

--
-- Indices de la tabla `mod_accounting_plan`
--
ALTER TABLE `mod_accounting_plan`
  ADD PRIMARY KEY (`mod_acp_id`) USING BTREE;

--
-- Indices de la tabla `mod_accounts_addresses`
--
ALTER TABLE `mod_accounts_addresses`
  ADD PRIMARY KEY (`mod_acu_add_acu_id`,`mod_acu_add_add_id`) USING BTREE;

--
-- Indices de la tabla `mod_accounts_ads`
--
ALTER TABLE `mod_accounts_ads`
  ADD PRIMARY KEY (`mod_aca_id`,`mod_aca_cen_id`) USING BTREE;

--
-- Indices de la tabla `mod_accounts_invoices_data`
--
ALTER TABLE `mod_accounts_invoices_data`
  ADD PRIMARY KEY (`mod_acu_invd_id`,`mod_acu_invd_acu_id`,`mod_acu_invd_nit`) USING BTREE;

--
-- Indices de la tabla `mod_accounts_plans`
--
ALTER TABLE `mod_accounts_plans`
  ADD PRIMARY KEY (`mod_ap_id`) USING BTREE;

--
-- Indices de la tabla `mod_accounts_roles`
--
ALTER TABLE `mod_accounts_roles`
  ADD PRIMARY KEY (`mod_acu_rol_id`) USING BTREE;

--
-- Indices de la tabla `mod_accounts_services`
--
ALTER TABLE `mod_accounts_services`
  ADD PRIMARY KEY (`mod_acu_sv_sv_id`,`mod_acu_sv_acu_id`) USING BTREE;

--
-- Indices de la tabla `mod_accounts_users_plans`
--
ALTER TABLE `mod_accounts_users_plans`
  ADD PRIMARY KEY (`mod_acu_ap_acu_id`,`mod_acu_ap_ap_id`,`mod_acu_ap_mode`) USING BTREE;

--
-- Indices de la tabla `mod_accounts_users_roles`
--
ALTER TABLE `mod_accounts_users_roles`
  ADD PRIMARY KEY (`mod_acu_user_rol_acu_id`,`mod_acu_user_rol_rol_id`) USING BTREE;

--
-- Indices de la tabla `mod_actions`
--
ALTER TABLE `mod_actions`
  ADD PRIMARY KEY (`mod_act_id`) USING BTREE;

--
-- Indices de la tabla `mod_actions_register`
--
ALTER TABLE `mod_actions_register`
  ADD PRIMARY KEY (`mod_act_reg_act_id`,`mod_act_reg_cpa_id`,`mod_act_reg_aca_id`,`mod_act_reg_acu_id`,`mod_act_reg_plc_id`) USING BTREE;

--
-- Indices de la tabla `mod_acuse`
--
ALTER TABLE `mod_acuse`
  ADD PRIMARY KEY (`mod_ac_id`) USING BTREE;

--
-- Indices de la tabla `mod_addresses`
--
ALTER TABLE `mod_addresses`
  ADD PRIMARY KEY (`mod_add_id`) USING BTREE;

--
-- Indices de la tabla `mod_addresses_logistics_distribution_zone`
--
ALTER TABLE `mod_addresses_logistics_distribution_zone`
  ADD PRIMARY KEY (`mod_add_ldz_add_id`,`mod_add_ldz_ldz_id`) USING BTREE;

--
-- Indices de la tabla `mod_ads`
--
ALTER TABLE `mod_ads`
  ADD PRIMARY KEY (`mod_ads_id`) USING BTREE;

--
-- Indices de la tabla `mod_ads_campaigns`
--
ALTER TABLE `mod_ads_campaigns`
  ADD PRIMARY KEY (`mod_ads_campaign_id`) USING BTREE;

--
-- Indices de la tabla `mod_ads_devices`
--
ALTER TABLE `mod_ads_devices`
  ADD PRIMARY KEY (`mod_ads_device_id`) USING BTREE;

--
-- Indices de la tabla `mod_ads_display`
--
ALTER TABLE `mod_ads_display`
  ADD PRIMARY KEY (`mod_ads_dsp_id`) USING BTREE;

--
-- Indices de la tabla `mod_ads_displays`
--
ALTER TABLE `mod_ads_displays`
  ADD PRIMARY KEY (`mod_ads_dsp_dsp_id`) USING BTREE;

--
-- Indices de la tabla `mod_ads_display_files`
--
ALTER TABLE `mod_ads_display_files`
  ADD PRIMARY KEY (`mod_ads_dsp_file_dsp_id`,`mod_ads_dsp_file_file_id`) USING BTREE;

--
-- Indices de la tabla `mod_ads_locations`
--
ALTER TABLE `mod_ads_locations`
  ADD PRIMARY KEY (`mod_ads_location_id`) USING BTREE;

--
-- Indices de la tabla `mod_ads_performance_metrics`
--
ALTER TABLE `mod_ads_performance_metrics`
  ADD PRIMARY KEY (`mod_ads_metric_id`) USING BTREE;

--
-- Indices de la tabla `mod_ads_types`
--
ALTER TABLE `mod_ads_types`
  ADD PRIMARY KEY (`mod_ads_type_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_calendars`
--
ALTER TABLE `mod_advised_calendars`
  ADD PRIMARY KEY (`mod_adv_cal_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_calendars_blocked`
--
ALTER TABLE `mod_advised_calendars_blocked`
  ADD PRIMARY KEY (`mod_adv_cb_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_counselors`
--
ALTER TABLE `mod_advised_counselors`
  ADD PRIMARY KEY (`mod_adv_cou_acu_id`,`mod_adv_cou_cou_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_counselors_fields`
--
ALTER TABLE `mod_advised_counselors_fields`
  ADD PRIMARY KEY (`mod_adv_fds_user_id`,`mod_adv_fds_fds_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_history`
--
ALTER TABLE `mod_advised_history`
  ADD PRIMARY KEY (`mod_adv_his_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_history_calendars`
--
ALTER TABLE `mod_advised_history_calendars`
  ADD PRIMARY KEY (`mod_adv_his_cal_cal_id`,`mod_adv_his_cal_his_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_options`
--
ALTER TABLE `mod_advised_options`
  ADD PRIMARY KEY (`mod_adv_opt_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_schedules`
--
ALTER TABLE `mod_advised_schedules`
  ADD PRIMARY KEY (`mod_adv_sch_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_types_appointments`
--
ALTER TABLE `mod_advised_types_appointments`
  ADD PRIMARY KEY (`mod_adv_tya_id`) USING BTREE;

--
-- Indices de la tabla `mod_advised_user`
--
ALTER TABLE `mod_advised_user`
  ADD PRIMARY KEY (`mod_adv_id`) USING BTREE;

--
-- Indices de la tabla `mod_appointments_calendars`
--
ALTER TABLE `mod_appointments_calendars`
  ADD PRIMARY KEY (`mod_apt_cal_id`) USING BTREE;

--
-- Indices de la tabla `mod_appointments_calendars_blocked`
--
ALTER TABLE `mod_appointments_calendars_blocked`
  ADD PRIMARY KEY (`mod_apt_cb_id`) USING BTREE;

--
-- Indices de la tabla `mod_appointments_exceptions`
--
ALTER TABLE `mod_appointments_exceptions`
  ADD PRIMARY KEY (`mod_apt_exc_id`) USING BTREE;

--
-- Indices de la tabla `mod_appointments_logs`
--
ALTER TABLE `mod_appointments_logs`
  ADD PRIMARY KEY (`mod_apt_log_id`) USING BTREE;

--
-- Indices de la tabla `mod_appointments_options`
--
ALTER TABLE `mod_appointments_options`
  ADD PRIMARY KEY (`mod_apt_opt_id`) USING BTREE;

--
-- Indices de la tabla `mod_appointments_payments`
--
ALTER TABLE `mod_appointments_payments`
  ADD PRIMARY KEY (`mod_apt_pay_id`) USING BTREE;

--
-- Indices de la tabla `mod_appointments_reviews`
--
ALTER TABLE `mod_appointments_reviews`
  ADD PRIMARY KEY (`mod_apt_rev_id`) USING BTREE;

--
-- Indices de la tabla `mod_appointments_schedules`
--
ALTER TABLE `mod_appointments_schedules`
  ADD PRIMARY KEY (`mod_apt_sch_id`) USING BTREE;

--
-- Indices de la tabla `mod_appointments_types`
--
ALTER TABLE `mod_appointments_types`
  ADD PRIMARY KEY (`mod_apt_type_id`) USING BTREE;

--
-- Indices de la tabla `mod_bi_dim_date`
--
ALTER TABLE `mod_bi_dim_date`
  ADD PRIMARY KEY (`mod_bd_key`) USING BTREE;

--
-- Indices de la tabla `mod_bi_dim_vendor`
--
ALTER TABLE `mod_bi_dim_vendor`
  ADD PRIMARY KEY (`mod_bv_key`) USING BTREE,
  ADD UNIQUE KEY `mod_bv_vv_id_oltp` (`mod_bv_vv_id_oltp`) USING BTREE;

--
-- Indices de la tabla `mod_bi_fact_sales`
--
ALTER TABLE `mod_bi_fact_sales`
  ADD PRIMARY KEY (`mod_bfs_id`) USING BTREE,
  ADD KEY `idx_date_vendor` (`mod_bfs_bd_key`,`mod_bfs_bv_key`) USING BTREE;

--
-- Indices de la tabla `mod_brands`
--
ALTER TABLE `mod_brands`
  ADD PRIMARY KEY (`mod_brd_id`) USING BTREE;

--
-- Indices de la tabla `mod_campaigns_actions`
--
ALTER TABLE `mod_campaigns_actions`
  ADD PRIMARY KEY (`mod_cpa_act_cpa_id`,`mod_cpa_act_act_id`) USING BTREE;

--
-- Indices de la tabla `mod_campaigns_ads`
--
ALTER TABLE `mod_campaigns_ads`
  ADD PRIMARY KEY (`mod_cpa_id`) USING BTREE;

--
-- Indices de la tabla `mod_candire_campaigns`
--
ALTER TABLE `mod_candire_campaigns`
  ADD PRIMARY KEY (`mod_cnd_cp_id`) USING BTREE;

--
-- Indices de la tabla `mod_carts`
--
ALTER TABLE `mod_carts`
  ADD PRIMARY KEY (`mod_cart_id`,`mod_cart_acu_id`) USING BTREE;

--
-- Indices de la tabla `mod_carts_products`
--
ALTER TABLE `mod_carts_products`
  ADD PRIMARY KEY (`mod_cart_prod_cart_id`,`mod_cart_prod_prod_id`) USING BTREE;

--
-- Indices de la tabla `mod_ccm_messages`
--
ALTER TABLE `mod_ccm_messages`
  ADD PRIMARY KEY (`mod_cm_id`) USING BTREE;

--
-- Indices de la tabla `mod_ccm_reviews`
--
ALTER TABLE `mod_ccm_reviews`
  ADD PRIMARY KEY (`mod_cr_id`) USING BTREE;

--
-- Indices de la tabla `mod_ccm_tickets`
--
ALTER TABLE `mod_ccm_tickets`
  ADD PRIMARY KEY (`mod_ct_id`) USING BTREE;

--
-- Indices de la tabla `mod_classification_info`
--
ALTER TABLE `mod_classification_info`
  ADD PRIMARY KEY (`mod_clsi_id`) USING BTREE;

--
-- Indices de la tabla `mod_competitions`
--
ALTER TABLE `mod_competitions`
  ADD PRIMARY KEY (`mod_cmp_id`) USING BTREE;

--
-- Indices de la tabla `mod_competitions_accounts`
--
ALTER TABLE `mod_competitions_accounts`
  ADD PRIMARY KEY (`mod_cmp_cmp_id`,`mod_cmp_acu_id`) USING BTREE;

--
-- Indices de la tabla `mod_competitions_mira`
--
ALTER TABLE `mod_competitions_mira`
  ADD PRIMARY KEY (`mod_cmp_mira_id`,`mod_cmp_mira_acu_id`,`mod_cmp_mira_num_id`) USING BTREE;

--
-- Indices de la tabla `mod_contacts`
--
ALTER TABLE `mod_contacts`
  ADD PRIMARY KEY (`mod_con_id`) USING BTREE,
  ADD UNIQUE KEY `uniq_contact_primary_email` (`mod_con_email_primary`) USING BTREE,
  ADD KEY `idx_type_status` (`mod_con_type`,`mod_con_status`) USING BTREE,
  ADD KEY `idx_email_secondary` (`mod_con_email_secondary`) USING BTREE,
  ADD KEY `idx_phone_secondary` (`mod_con_phone_secondary`) USING BTREE,
  ADD KEY `idx_assigned_entity` (`mod_con_assigned_user_id`,`mod_con_ent_id`) USING BTREE,
  ADD KEY `idx_entity_state` (`mod_con_ent_id`,`mod_con_state`) USING BTREE,
  ADD KEY `idx_customer_person` (`mod_con_cpe_id`) USING BTREE,
  ADD KEY `idx_customer_enterprise` (`mod_con_cen_id`) USING BTREE,
  ADD KEY `idx_source` (`mod_con_source`) USING BTREE,
  ADD KEY `idx_last_contact` (`mod_con_last_contact_date`) USING BTREE,
  ADD KEY `idx_deleted` (`mod_con_deleted_at`) USING BTREE;
ALTER TABLE `mod_contacts` ADD FULLTEXT KEY `ft_contacts_search` (`mod_con_name`,`mod_con_lastname_father`,`mod_con_email_primary`,`mod_con_company`);

--
-- Indices de la tabla `mod_crm_activities`
--
ALTER TABLE `mod_crm_activities`
  ADD PRIMARY KEY (`mod_crm_act_id`) USING BTREE,
  ADD KEY `idx_type_status` (`mod_crm_act_type`,`mod_crm_act_status`) USING BTREE,
  ADD KEY `idx_assigned_due` (`mod_crm_act_assigned_user_id`,`mod_crm_act_due_date`) USING BTREE,
  ADD KEY `idx_due_date_status` (`mod_crm_act_due_date`,`mod_crm_act_status`) USING BTREE,
  ADD KEY `idx_entity_state` (`mod_crm_act_ent_id`,`mod_crm_act_state`) USING BTREE,
  ADD KEY `idx_related` (`mod_crm_act_related_type`,`mod_crm_act_related_id`) USING BTREE,
  ADD KEY `idx_reminder` (`mod_crm_act_reminder`) USING BTREE;

--
-- Indices de la tabla `mod_crm_contact_tags`
--
ALTER TABLE `mod_crm_contact_tags`
  ADD PRIMARY KEY (`mod_crm_cta_id`) USING BTREE,
  ADD UNIQUE KEY `uk_contact_tag` (`mod_crm_cta_con_id`,`mod_crm_cta_tag_id`) USING BTREE,
  ADD KEY `idx_tag_contact` (`mod_crm_cta_tag_id`,`mod_crm_cta_con_id`) USING BTREE;

--
-- Indices de la tabla `mod_crm_customers`
--
ALTER TABLE `mod_crm_customers`
  ADD PRIMARY KEY (`mod_cc_id`) USING BTREE,
  ADD UNIQUE KEY `mod_cc_email` (`mod_cc_email`) USING BTREE;

--
-- Indices de la tabla `mod_crm_custom_fields`
--
ALTER TABLE `mod_crm_custom_fields`
  ADD PRIMARY KEY (`mod_crm_cfi_id`) USING BTREE,
  ADD UNIQUE KEY `uk_field_entity` (`mod_crm_cfi_entity_type`,`mod_crm_cfi_name`,`mod_crm_cfi_ent_id`) USING BTREE,
  ADD KEY `idx_entity_type_order` (`mod_crm_cfi_entity_type`,`mod_crm_cfi_order`) USING BTREE,
  ADD KEY `idx_entity_state` (`mod_crm_cfi_ent_id`,`mod_crm_cfi_state`) USING BTREE;

--
-- Indices de la tabla `mod_crm_custom_field_values`
--
ALTER TABLE `mod_crm_custom_field_values`
  ADD PRIMARY KEY (`mod_crm_cfv_id`) USING BTREE,
  ADD UNIQUE KEY `uk_field_entity` (`mod_crm_cfv_cfi_id`,`mod_crm_cfv_entity_id`) USING BTREE,
  ADD KEY `idx_entity_field` (`mod_crm_cfv_entity_id`,`mod_crm_cfv_cfi_id`) USING BTREE;

--
-- Indices de la tabla `mod_crm_documents`
--
ALTER TABLE `mod_crm_documents`
  ADD PRIMARY KEY (`mod_crm_doc_id`) USING BTREE,
  ADD KEY `idx_related_created` (`mod_crm_doc_related_type`,`mod_crm_doc_related_id`,`mod_crm_doc_created_at`) USING BTREE,
  ADD KEY `idx_user` (`mod_crm_doc_user_id`) USING BTREE,
  ADD KEY `idx_entity_state` (`mod_crm_doc_ent_id`,`mod_crm_doc_state`) USING BTREE;

--
-- Indices de la tabla `mod_crm_email_templates`
--
ALTER TABLE `mod_crm_email_templates`
  ADD PRIMARY KEY (`mod_crm_emt_id`) USING BTREE,
  ADD KEY `idx_entity_category` (`mod_crm_emt_ent_id`,`mod_crm_emt_category`) USING BTREE,
  ADD KEY `idx_entity_state` (`mod_crm_emt_ent_id`,`mod_crm_emt_state`) USING BTREE;

--
-- Indices de la tabla `mod_crm_interactions`
--
ALTER TABLE `mod_crm_interactions`
  ADD PRIMARY KEY (`mod_crm_int_id`) USING BTREE,
  ADD KEY `idx_contact_created` (`mod_crm_int_con_id`,`mod_crm_int_created_at`) USING BTREE,
  ADD KEY `idx_opportunity` (`mod_crm_int_opp_id`) USING BTREE,
  ADD KEY `idx_type_direction` (`mod_crm_int_type`,`mod_crm_int_direction`) USING BTREE,
  ADD KEY `idx_entity_state` (`mod_crm_int_ent_id`,`mod_crm_int_state`) USING BTREE,
  ADD KEY `idx_user_created` (`mod_crm_int_user_id`,`mod_crm_int_created_at`) USING BTREE;

--
-- Indices de la tabla `mod_crm_notes`
--
ALTER TABLE `mod_crm_notes`
  ADD PRIMARY KEY (`mod_crm_note_id`) USING BTREE,
  ADD KEY `idx_related_created` (`mod_crm_note_related_type`,`mod_crm_note_related_id`,`mod_crm_note_created_at`) USING BTREE,
  ADD KEY `idx_user` (`mod_crm_note_user_id`) USING BTREE,
  ADD KEY `idx_pinned` (`mod_crm_note_is_pinned`) USING BTREE;

--
-- Indices de la tabla `mod_customers_enterprises`
--
ALTER TABLE `mod_customers_enterprises`
  ADD PRIMARY KEY (`mod_cen_id`) USING BTREE;

--
-- Indices de la tabla `mod_customers_enterprises_data`
--
ALTER TABLE `mod_customers_enterprises_data`
  ADD PRIMARY KEY (`mod_cen_data_id`,`mod_cen_data_cen_id`) USING BTREE;

--
-- Indices de la tabla `mod_customers_options`
--
ALTER TABLE `mod_customers_options`
  ADD PRIMARY KEY (`mod_cop_id`) USING BTREE;

--
-- Indices de la tabla `mod_customers_persons`
--
ALTER TABLE `mod_customers_persons`
  ADD PRIMARY KEY (`mod_cpe_id`) USING BTREE;

--
-- Indices de la tabla `mod_departments`
--
ALTER TABLE `mod_departments`
  ADD PRIMARY KEY (`mod_dep_id`) USING BTREE;

--
-- Indices de la tabla `mod_discount`
--
ALTER TABLE `mod_discount`
  ADD PRIMARY KEY (`mod_dis_id`) USING BTREE;

--
-- Indices de la tabla `mod_discount_products`
--
ALTER TABLE `mod_discount_products`
  ADD PRIMARY KEY (`mod_dis_prod_dis_id`,`mod_dis_prod_prod_id`) USING BTREE;

--
-- Indices de la tabla `mod_events`
--
ALTER TABLE `mod_events`
  ADD PRIMARY KEY (`mod_eve_id`) USING BTREE;

--
-- Indices de la tabla `mod_events_halls`
--
ALTER TABLE `mod_events_halls`
  ADD PRIMARY KEY (`mod_eve_hall_id`,`mod_eve_hall_ent_id`) USING BTREE;

--
-- Indices de la tabla `mod_events_options`
--
ALTER TABLE `mod_events_options`
  ADD PRIMARY KEY (`mod_eve_option_id`) USING BTREE;

--
-- Indices de la tabla `mod_events_tickets`
--
ALTER TABLE `mod_events_tickets`
  ADD PRIMARY KEY (`mod_eve_tck_id`) USING BTREE;

--
-- Indices de la tabla `mod_external_docs_options`
--
ALTER TABLE `mod_external_docs_options`
  ADD PRIMARY KEY (`mod_edc_opt_id`) USING BTREE;

--
-- Indices de la tabla `mod_external_docs_page_design`
--
ALTER TABLE `mod_external_docs_page_design`
  ADD PRIMARY KEY (`mod_edc_pd_id`) USING BTREE;

--
-- Indices de la tabla `mod_external_docs_templates`
--
ALTER TABLE `mod_external_docs_templates`
  ADD PRIMARY KEY (`mod_edc_tpl_id`) USING BTREE;

--
-- Indices de la tabla `mod_external_docs_types`
--
ALTER TABLE `mod_external_docs_types`
  ADD PRIMARY KEY (`mod_edc_type_id`) USING BTREE;

--
-- Indices de la tabla `mod_fss_payouts`
--
ALTER TABLE `mod_fss_payouts`
  ADD PRIMARY KEY (`mod_fp_id`) USING BTREE;

--
-- Indices de la tabla `mod_fss_vendor_balance`
--
ALTER TABLE `mod_fss_vendor_balance`
  ADD PRIMARY KEY (`mod_fvb_id`) USING BTREE,
  ADD KEY `idx_vendor_payout` (`mod_fvb_vv_id`,`mod_fvb_fp_id`) USING BTREE;

--
-- Indices de la tabla `mod_ganador_ganaderos`
--
ALTER TABLE `mod_ganador_ganaderos`
  ADD PRIMARY KEY (`mod_ggd_id`) USING BTREE;

--
-- Indices de la tabla `mod_ganador_ganaderos_propiedades`
--
ALTER TABLE `mod_ganador_ganaderos_propiedades`
  ADD PRIMARY KEY (`mod_ggp_ggd_id`,`mod_ggp_gpr_id`) USING BTREE;

--
-- Indices de la tabla `mod_ganador_propiedades`
--
ALTER TABLE `mod_ganador_propiedades`
  ADD PRIMARY KEY (`mod_gpr_id`) USING BTREE;

--
-- Indices de la tabla `mod_ganador_propiedades_files`
--
ALTER TABLE `mod_ganador_propiedades_files`
  ADD PRIMARY KEY (`mod_gpf_file_id`,`mod_gpf_gpr_id`) USING BTREE;

--
-- Indices de la tabla `mod_ganador_propiedades_images`
--
ALTER TABLE `mod_ganador_propiedades_images`
  ADD PRIMARY KEY (`mod_gpi_img_id`,`mod_gpi_gpr_id`) USING BTREE;

--
-- Indices de la tabla `mod_ganador_proyectos`
--
ALTER TABLE `mod_ganador_proyectos`
  ADD PRIMARY KEY (`mod_gp_id`) USING BTREE;

--
-- Indices de la tabla `mod_gl_accounts`
--
ALTER TABLE `mod_gl_accounts`
  ADD PRIMARY KEY (`mod_gl_id`) USING BTREE,
  ADD UNIQUE KEY `mod_gl_code` (`mod_gl_code`) USING BTREE;

--
-- Indices de la tabla `mod_gl_entries`
--
ALTER TABLE `mod_gl_entries`
  ADD PRIMARY KEY (`mod_ge_id`) USING BTREE,
  ADD KEY `idx_account_date` (`mod_ge_gl_id`,`mod_ge_date`) USING BTREE;

--
-- Indices de la tabla `mod_gl_transactions`
--
ALTER TABLE `mod_gl_transactions`
  ADD PRIMARY KEY (`mod_gt_id`) USING BTREE;

--
-- Indices de la tabla `mod_hrm_employees`
--
ALTER TABLE `mod_hrm_employees`
  ADD PRIMARY KEY (`mod_he_id`) USING BTREE,
  ADD UNIQUE KEY `mod_he_code` (`mod_he_code`) USING BTREE,
  ADD UNIQUE KEY `mod_he_email` (`mod_he_email`) USING BTREE;

--
-- Indices de la tabla `mod_hrm_positions`
--
ALTER TABLE `mod_hrm_positions`
  ADD PRIMARY KEY (`mod_hp_id`) USING BTREE;

--
-- Indices de la tabla `mod_inventory_options`
--
ALTER TABLE `mod_inventory_options`
  ADD PRIMARY KEY (`mod_inv_opt_id`) USING BTREE;

--
-- Indices de la tabla `mod_inventory_units`
--
ALTER TABLE `mod_inventory_units`
  ADD PRIMARY KEY (`mod_inv_unt_id`) USING BTREE;

--
-- Indices de la tabla `mod_invoices`
--
ALTER TABLE `mod_invoices`
  ADD PRIMARY KEY (`mod_inv_id`) USING BTREE;

--
-- Indices de la tabla `mod_jobtitle`
--
ALTER TABLE `mod_jobtitle`
  ADD PRIMARY KEY (`mod_jbt_id`) USING BTREE;

--
-- Indices de la tabla `mod_kardex`
--
ALTER TABLE `mod_kardex`
  ADD PRIMARY KEY (`mod_kdx_id`,`mod_kdx_user_id`) USING BTREE;

--
-- Indices de la tabla `mod_kardex_jobtitle`
--
ALTER TABLE `mod_kardex_jobtitle`
  ADD PRIMARY KEY (`mod_kdx_jbt_jbt_id`,`mod_kdx_jbt_kdx_id`,`mod_kdx_jbt_ent_id`) USING BTREE;

--
-- Indices de la tabla `mod_leagues`
--
ALTER TABLE `mod_leagues`
  ADD PRIMARY KEY (`mod_lg_id`) USING BTREE;

--
-- Indices de la tabla `mod_leagues_divisions`
--
ALTER TABLE `mod_leagues_divisions`
  ADD PRIMARY KEY (`mod_lg_div_id`) USING BTREE;

--
-- Indices de la tabla `mod_leagues_divisions_teams`
--
ALTER TABLE `mod_leagues_divisions_teams`
  ADD PRIMARY KEY (`mod_lg_div_tm_div_id`,`mod_lg_div_tm_tm_id`) USING BTREE;

--
-- Indices de la tabla `mod_logistics_distribution_move`
--
ALTER TABLE `mod_logistics_distribution_move`
  ADD PRIMARY KEY (`mod_log_dtz_id`) USING BTREE;

--
-- Indices de la tabla `mod_logistics_distribution_zone`
--
ALTER TABLE `mod_logistics_distribution_zone`
  ADD PRIMARY KEY (`mod_log_dtz_id`) USING BTREE;

--
-- Indices de la tabla `mod_make`
--
ALTER TABLE `mod_make`
  ADD PRIMARY KEY (`mod_mak_id`) USING BTREE;

--
-- Indices de la tabla `mod_management`
--
ALTER TABLE `mod_management`
  ADD PRIMARY KEY (`mod_mag_id`) USING BTREE;

--
-- Indices de la tabla `mod_oms_fulfillments`
--
ALTER TABLE `mod_oms_fulfillments`
  ADD PRIMARY KEY (`mod_of_id`) USING BTREE;

--
-- Indices de la tabla `mod_oms_orders`
--
ALTER TABLE `mod_oms_orders`
  ADD PRIMARY KEY (`mod_oo_id`) USING BTREE;

--
-- Indices de la tabla `mod_oms_order_items`
--
ALTER TABLE `mod_oms_order_items`
  ADD PRIMARY KEY (`mod_oi_id`) USING BTREE;

--
-- Indices de la tabla `mod_oms_refunds`
--
ALTER TABLE `mod_oms_refunds`
  ADD PRIMARY KEY (`mod_orf_id`) USING BTREE,
  ADD UNIQUE KEY `mod_orf_or_id` (`mod_orf_or_id`) USING BTREE;

--
-- Indices de la tabla `mod_oms_returns`
--
ALTER TABLE `mod_oms_returns`
  ADD PRIMARY KEY (`mod_or_id`) USING BTREE;

--
-- Indices de la tabla `mod_oms_shipments`
--
ALTER TABLE `mod_oms_shipments`
  ADD PRIMARY KEY (`mod_os_id`) USING BTREE,
  ADD UNIQUE KEY `mod_os_of_id` (`mod_os_of_id`) USING BTREE,
  ADD UNIQUE KEY `mod_os_tracking_code` (`mod_os_tracking_code`) USING BTREE;

--
-- Indices de la tabla `mod_organization_chart`
--
ALTER TABLE `mod_organization_chart`
  ADD PRIMARY KEY (`mod_orc_id`) USING BTREE;

--
-- Indices de la tabla `mod_organization_chart_rel`
--
ALTER TABLE `mod_organization_chart_rel`
  ADD PRIMARY KEY (`mod_orc_rel_orc_id`,`mod_orc_rel_user_id`) USING BTREE;

--
-- Indices de la tabla `mod_pay_tx_suscriptions`
--
ALTER TABLE `mod_pay_tx_suscriptions`
  ADD PRIMARY KEY (`mod_pay_tx_sbs_id`) USING BTREE;

--
-- Indices de la tabla `mod_pay_tx_temp`
--
ALTER TABLE `mod_pay_tx_temp`
  ADD PRIMARY KEY (`mod_pay_tx_tmp_id`) USING BTREE;

--
-- Indices de la tabla `mod_pay_tx_tickets`
--
ALTER TABLE `mod_pay_tx_tickets`
  ADD PRIMARY KEY (`mod_pay_tx_tck_id`) USING BTREE;

--
-- Indices de la tabla `mod_persons`
--
ALTER TABLE `mod_persons`
  ADD PRIMARY KEY (`mod_person_id`) USING BTREE;

--
-- Indices de la tabla `mod_persons_types`
--
ALTER TABLE `mod_persons_types`
  ADD PRIMARY KEY (`mod_person_type_id`) USING BTREE,
  ADD UNIQUE KEY `mod_person_type_code_UNIQUE` (`mod_person_type_code`) USING BTREE;

--
-- Indices de la tabla `mod_pim_attributes`
--
ALTER TABLE `mod_pim_attributes`
  ADD PRIMARY KEY (`mod_pa_id`) USING BTREE,
  ADD UNIQUE KEY `mod_pa_code` (`mod_pa_code`) USING BTREE;

--
-- Indices de la tabla `mod_pim_attribute_values`
--
ALTER TABLE `mod_pim_attribute_values`
  ADD PRIMARY KEY (`mod_pv_id`) USING BTREE,
  ADD KEY `idx_sku_attr` (`mod_pv_ps_id`,`mod_pv_pa_id`) USING BTREE,
  ADD KEY `idx_attr_text` (`mod_pv_pa_id`,`mod_pv_text_value`(255)) USING BTREE;

--
-- Indices de la tabla `mod_pim_category_attribute_map`
--
ALTER TABLE `mod_pim_category_attribute_map`
  ADD PRIMARY KEY (`mod_pcam_pc_id`,`mod_pcam_pa_id`) USING BTREE;

--
-- Indices de la tabla `mod_pim_collections`
--
ALTER TABLE `mod_pim_collections`
  ADD PRIMARY KEY (`mod_pcol_id`) USING BTREE;

--
-- Indices de la tabla `mod_pim_config`
--
ALTER TABLE `mod_pim_config`
  ADD PRIMARY KEY (`mod_pconf_id`) USING BTREE,
  ADD UNIQUE KEY `mod_pconf_key` (`mod_pconf_key`) USING BTREE;

--
-- Indices de la tabla `mod_pim_products`
--
ALTER TABLE `mod_pim_products`
  ADD PRIMARY KEY (`mod_pp_id`) USING BTREE;

--
-- Indices de la tabla `mod_pim_products_categorys`
--
ALTER TABLE `mod_pim_products_categorys`
  ADD PRIMARY KEY (`mod_ppc_pp_id`,`mod_ppc_cat_id`) USING BTREE;

--
-- Indices de la tabla `mod_pim_products_collections`
--
ALTER TABLE `mod_pim_products_collections`
  ADD PRIMARY KEY (`mod_ppcol_pp_id`,`mod_ppcol_pcol_id`) USING BTREE;

--
-- Indices de la tabla `mod_pim_products_files`
--
ALTER TABLE `mod_pim_products_files`
  ADD PRIMARY KEY (`mod_ppf_pp_id`,`mod_ppf_file_id`) USING BTREE;

--
-- Indices de la tabla `mod_pim_skus`
--
ALTER TABLE `mod_pim_skus`
  ADD PRIMARY KEY (`mod_ps_id`) USING BTREE,
  ADD UNIQUE KEY `idx_vendor_sku` (`mod_ps_vv_id`,`mod_ps_vendor_sku`) USING BTREE;

--
-- Indices de la tabla `mod_places`
--
ALTER TABLE `mod_places`
  ADD PRIMARY KEY (`mod_plc_id`) USING BTREE;

--
-- Indices de la tabla `mod_places_accounts_ads`
--
ALTER TABLE `mod_places_accounts_ads`
  ADD PRIMARY KEY (`mod_plc_aca_aca_id`,`mod_plc_aca_plc_id`) USING BTREE;

--
-- Indices de la tabla `mod_places_categorys`
--
ALTER TABLE `mod_places_categorys`
  ADD PRIMARY KEY (`mod_plc_cat_plc_id`,`mod_plc_cat_cat_id`) USING BTREE;

--
-- Indices de la tabla `mod_prices_list`
--
ALTER TABLE `mod_prices_list`
  ADD PRIMARY KEY (`mod_prl_id`) USING BTREE;

--
-- Indices de la tabla `mod_producers`
--
ALTER TABLE `mod_producers`
  ADD PRIMARY KEY (`mod_prd_id`) USING BTREE;

--
-- Indices de la tabla `mod_products`
--
ALTER TABLE `mod_products`
  ADD PRIMARY KEY (`mod_prod_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_categorys`
--
ALTER TABLE `mod_products_categorys`
  ADD PRIMARY KEY (`mod_prod_cat_prod_id`,`mod_prod_cat_cat_id`,`mod_prod_cat_ent_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_clothing_store`
--
ALTER TABLE `mod_products_clothing_store`
  ADD PRIMARY KEY (`mod_prod_cst_id`,`mod_prod_cst_prod_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_colors`
--
ALTER TABLE `mod_products_colors`
  ADD PRIMARY KEY (`mod_prod_color_id`,`mod_prod_color_hex`) USING BTREE;

--
-- Indices de la tabla `mod_products_files`
--
ALTER TABLE `mod_products_files`
  ADD PRIMARY KEY (`mod_prod_file_prod_id`,`mod_prod_file_file_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_food`
--
ALTER TABLE `mod_products_food`
  ADD PRIMARY KEY (`mod_prod_food_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_options`
--
ALTER TABLE `mod_products_options`
  ADD PRIMARY KEY (`mod_prod_opt_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_pharmacy`
--
ALTER TABLE `mod_products_pharmacy`
  ADD PRIMARY KEY (`mod_prod_pha_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_pharmacy_stock`
--
ALTER TABLE `mod_products_pharmacy_stock`
  ADD PRIMARY KEY (`mod_prod_pha_stk_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_prices_list`
--
ALTER TABLE `mod_products_prices_list`
  ADD PRIMARY KEY (`mod_prod_prl_id`,`mod_prod_prl_prod_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_relation`
--
ALTER TABLE `mod_products_relation`
  ADD PRIMARY KEY (`mod_prod_rel_id`,`mod_prod_rel_prod_id`,`mod_prod_rel_ent_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_rw`
--
ALTER TABLE `mod_products_rw`
  ADD PRIMARY KEY (`mod_prod_rw_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_types`
--
ALTER TABLE `mod_products_types`
  ADD PRIMARY KEY (`mod_prod_type_id`) USING BTREE;

--
-- Indices de la tabla `mod_products_warehouses`
--
ALTER TABLE `mod_products_warehouses`
  ADD PRIMARY KEY (`mod_prod_wrh_prod_id`,`mod_prod_wrh_wrh_id`) USING BTREE;

--
-- Indices de la tabla `mod_providers`
--
ALTER TABLE `mod_providers`
  ADD PRIMARY KEY (`mod_prov_id`) USING BTREE;

--
-- Indices de la tabla `mod_rehabilitation_centers`
--
ALTER TABLE `mod_rehabilitation_centers`
  ADD PRIMARY KEY (`mod_rhb_center_id`) USING BTREE;

--
-- Indices de la tabla `mod_rehabilitation_intern`
--
ALTER TABLE `mod_rehabilitation_intern`
  ADD PRIMARY KEY (`mod_rhb_int_id`,`mod_rhb_int_acu_id`) USING BTREE;

--
-- Indices de la tabla `mod_rehabilitation_primary_consumption`
--
ALTER TABLE `mod_rehabilitation_primary_consumption`
  ADD PRIMARY KEY (`mod_rhb_pcn_id`) USING BTREE;

--
-- Indices de la tabla `mod_rehabilitation_tutor`
--
ALTER TABLE `mod_rehabilitation_tutor`
  ADD PRIMARY KEY (`mod_rhb_tutor_id`) USING BTREE;

--
-- Indices de la tabla `mod_rehabilitation_user`
--
ALTER TABLE `mod_rehabilitation_user`
  ADD PRIMARY KEY (`mod_rhb_id`) USING BTREE;

--
-- Indices de la tabla `mod_rems_lots`
--
ALTER TABLE `mod_rems_lots`
  ADD PRIMARY KEY (`mod_rems_lots_id`) USING BTREE;

--
-- Indices de la tabla `mod_rems_projects`
--
ALTER TABLE `mod_rems_projects`
  ADD PRIMARY KEY (`mod_rems_projects_id`) USING BTREE,
  ADD KEY `idx_mod_rems_projects_status` (`mod_rems_projects_status`) USING BTREE,
  ADD KEY `idx_mod_rems_projects_dates` (`mod_rems_projects_start_date`,`mod_rems_projects_end_date`) USING BTREE;
ALTER TABLE `mod_rems_projects` ADD FULLTEXT KEY `ft_mod_rems_projects_search` (`mod_rems_projects_name`,`mod_rems_projects_location`,`mod_rems_projects_description`);

--
-- Indices de la tabla `mod_rewards_register`
--
ALTER TABLE `mod_rewards_register`
  ADD PRIMARY KEY (`mod_rwd_reg_rwd_id`,`mod_rwd_reg_acu_id`,`mod_rwd_reg_cpa_id`) USING BTREE;

--
-- Indices de la tabla `mod_services`
--
ALTER TABLE `mod_services`
  ADD PRIMARY KEY (`mod_srv_id`) USING BTREE;

--
-- Indices de la tabla `mod_services_roles`
--
ALTER TABLE `mod_services_roles`
  ADD PRIMARY KEY (`mod_srv_id`) USING BTREE;

--
-- Indices de la tabla `mod_sliders`
--
ALTER TABLE `mod_sliders`
  ADD PRIMARY KEY (`mod_sli_id`) USING BTREE;

--
-- Indices de la tabla `mod_sliders_categorys`
--
ALTER TABLE `mod_sliders_categorys`
  ADD PRIMARY KEY (`mod_sli_cat_sli_id`,`mod_sli_cat_cat_id`) USING BTREE;

--
-- Indices de la tabla `mod_sliders_files`
--
ALTER TABLE `mod_sliders_files`
  ADD PRIMARY KEY (`mod_sli_file_id`) USING BTREE,
  ADD KEY `idx_slider_id` (`mod_sli_file_sli_id`) USING BTREE;

--
-- Indices de la tabla `mod_sports`
--
ALTER TABLE `mod_sports`
  ADD PRIMARY KEY (`mod_spt_id`) USING BTREE;

--
-- Indices de la tabla `mod_sports_dates`
--
ALTER TABLE `mod_sports_dates`
  ADD PRIMARY KEY (`mod_sp_dt_id`) USING BTREE;

--
-- Indices de la tabla `mod_sports_games`
--
ALTER TABLE `mod_sports_games`
  ADD PRIMARY KEY (`mod_sp_gm_id`) USING BTREE;

--
-- Indices de la tabla `mod_sports_teams`
--
ALTER TABLE `mod_sports_teams`
  ADD PRIMARY KEY (`mod_sp_tm_id`) USING BTREE;

--
-- Indices de la tabla `mod_stock`
--
ALTER TABLE `mod_stock`
  ADD PRIMARY KEY (`mod_stk_id`) USING BTREE;

--
-- Indices de la tabla `mod_stock_receipt`
--
ALTER TABLE `mod_stock_receipt`
  ADD PRIMARY KEY (`mod_str_id`) USING BTREE;

--
-- Indices de la tabla `mod_surveys`
--
ALTER TABLE `mod_surveys`
  ADD PRIMARY KEY (`mod_svy_id`) USING BTREE;

--
-- Indices de la tabla `mod_surveys_options`
--
ALTER TABLE `mod_surveys_options`
  ADD PRIMARY KEY (`mod_svy_so_id`) USING BTREE,
  ADD KEY `mod_so_sq_id` (`mod_svy_so_sq_id`) USING BTREE;

--
-- Indices de la tabla `mod_surveys_questions`
--
ALTER TABLE `mod_surveys_questions`
  ADD PRIMARY KEY (`mod_svy_sq_id`) USING BTREE,
  ADD KEY `mod_sq_svy_id` (`mod_svy_sq_svy_id`) USING BTREE;

--
-- Indices de la tabla `mod_syllabus`
--
ALTER TABLE `mod_syllabus`
  ADD PRIMARY KEY (`mod_syl_id`) USING BTREE;

--
-- Indices de la tabla `mod_syllabus_categorys`
--
ALTER TABLE `mod_syllabus_categorys`
  ADD PRIMARY KEY (`mod_syl_cat_syl_id`,`mod_syl_cat_cat_id`) USING BTREE;

--
-- Indices de la tabla `mod_syllabus_contents`
--
ALTER TABLE `mod_syllabus_contents`
  ADD PRIMARY KEY (`mod_syl_cont_id`) USING BTREE;

--
-- Indices de la tabla `mod_syllabus_periods`
--
ALTER TABLE `mod_syllabus_periods`
  ADD PRIMARY KEY (`mod_syl_per_id`) USING BTREE;

--
-- Indices de la tabla `mod_syllabus_relations_periods`
--
ALTER TABLE `mod_syllabus_relations_periods`
  ADD PRIMARY KEY (`mod_syl_rel_per_syl_id`,`mod_syl_rel_per_per_id`) USING BTREE;

--
-- Indices de la tabla `mod_tributes_facturas_cliente`
--
ALTER TABLE `mod_tributes_facturas_cliente`
  ADD PRIMARY KEY (`mod_tb_fac_id`) USING BTREE;

--
-- Indices de la tabla `mod_tributes_facturas_filter`
--
ALTER TABLE `mod_tributes_facturas_filter`
  ADD PRIMARY KEY (`mod_tb_fcf_id`) USING BTREE;

--
-- Indices de la tabla `mod_tributes_options`
--
ALTER TABLE `mod_tributes_options`
  ADD PRIMARY KEY (`mod_tb_op_id`) USING BTREE;

--
-- Indices de la tabla `mod_tributes_periods`
--
ALTER TABLE `mod_tributes_periods`
  ADD PRIMARY KEY (`mod_tb_pr_id`) USING BTREE;

--
-- Indices de la tabla `mod_tributes_plans_periods`
--
ALTER TABLE `mod_tributes_plans_periods`
  ADD PRIMARY KEY (`mod_tb_plpr_cpe_id`,`mod_tb_plpr_pl_id`,`mod_tb_plpr_pr_id`) USING BTREE;

--
-- Indices de la tabla `mod_tributes_relations_periods`
--
ALTER TABLE `mod_tributes_relations_periods`
  ADD PRIMARY KEY (`mod_tb_rpd_id`) USING BTREE;

--
-- Indices de la tabla `mod_types_contribuyentes`
--
ALTER TABLE `mod_types_contribuyentes`
  ADD PRIMARY KEY (`mod_typc_id`) USING BTREE;

--
-- Indices de la tabla `mod_types_forms`
--
ALTER TABLE `mod_types_forms`
  ADD PRIMARY KEY (`mod_type_form_id`) USING BTREE;

--
-- Indices de la tabla `mod_types_oficios`
--
ALTER TABLE `mod_types_oficios`
  ADD PRIMARY KEY (`mod_tb_tof_id`) USING BTREE;

--
-- Indices de la tabla `mod_validme_applicants`
--
ALTER TABLE `mod_validme_applicants`
  ADD PRIMARY KEY (`mod_va_id`) USING BTREE,
  ADD UNIQUE KEY `mod_va_email` (`mod_va_email`) USING BTREE;

--
-- Indices de la tabla `mod_validme_callback_logs`
--
ALTER TABLE `mod_validme_callback_logs`
  ADD PRIMARY KEY (`mod_vcl_id`) USING BTREE;

--
-- Indices de la tabla `mod_validme_checks`
--
ALTER TABLE `mod_validme_checks`
  ADD PRIMARY KEY (`mod_vc_id`) USING BTREE;

--
-- Indices de la tabla `mod_validme_options`
--
ALTER TABLE `mod_validme_options`
  ADD PRIMARY KEY (`mod_vo_id`) USING BTREE;

--
-- Indices de la tabla `mod_vms_commission_rules`
--
ALTER TABLE `mod_vms_commission_rules`
  ADD PRIMARY KEY (`mod_vcr_id`) USING BTREE;

--
-- Indices de la tabla `mod_vms_performance`
--
ALTER TABLE `mod_vms_performance`
  ADD PRIMARY KEY (`mod_vp_id`) USING BTREE,
  ADD UNIQUE KEY `idx_vendor_date` (`mod_vp_vv_id`,`mod_vp_date_recorded`) USING BTREE;

--
-- Indices de la tabla `mod_vms_vendors`
--
ALTER TABLE `mod_vms_vendors`
  ADD PRIMARY KEY (`mod_vv_id`) USING BTREE,
  ADD UNIQUE KEY `mod_vv_contact_email` (`mod_vv_contact_email`) USING BTREE;

--
-- Indices de la tabla `mod_warehouses`
--
ALTER TABLE `mod_warehouses`
  ADD PRIMARY KEY (`mod_wrh_id`) USING BTREE;

--
-- Indices de la tabla `mod_wms_movement_log`
--
ALTER TABLE `mod_wms_movement_log`
  ADD PRIMARY KEY (`mod_wm_id`) USING BTREE,
  ADD KEY `idx_sku_timestamp` (`mod_wm_ps_id`,`mod_wm_timestamp`) USING BTREE;

--
-- Indices de la tabla `mod_wms_stock`
--
ALTER TABLE `mod_wms_stock`
  ADD PRIMARY KEY (`mod_ws_ps_id`,`mod_ws_wb_id`) USING BTREE;

--
-- Indices de la tabla `mod_wms_storage_bins`
--
ALTER TABLE `mod_wms_storage_bins`
  ADD PRIMARY KEY (`mod_wb_id`) USING BTREE;

--
-- Indices de la tabla `mod_wms_warehouses`
--
ALTER TABLE `mod_wms_warehouses`
  ADD PRIMARY KEY (`mod_ww_id`) USING BTREE;

--
-- Indices de la tabla `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`ntf_id`) USING BTREE;

--
-- Indices de la tabla `options`
--
ALTER TABLE `options`
  ADD PRIMARY KEY (`option_id`) USING BTREE;

--
-- Indices de la tabla `posts`
--
ALTER TABLE `posts`
  ADD PRIMARY KEY (`post_id`) USING BTREE;

--
-- Indices de la tabla `posts_authors`
--
ALTER TABLE `posts_authors`
  ADD PRIMARY KEY (`post_au_id`) USING BTREE;

--
-- Indices de la tabla `posts_categorys`
--
ALTER TABLE `posts_categorys`
  ADD PRIMARY KEY (`post_cat_post_id`,`post_cat_cat_id`) USING BTREE;

--
-- Indices de la tabla `posts_files`
--
ALTER TABLE `posts_files`
  ADD PRIMARY KEY (`post_file_post_id`,`post_file_file_id`) USING BTREE;

--
-- Indices de la tabla `publications`
--
ALTER TABLE `publications`
  ADD PRIMARY KEY (`pub_id`) USING BTREE;

--
-- Indices de la tabla `publications_pattern`
--
ALTER TABLE `publications_pattern`
  ADD PRIMARY KEY (`pub_pat_id`) USING BTREE;

--
-- Indices de la tabla `publications_relations`
--
ALTER TABLE `publications_relations`
  ADD PRIMARY KEY (`pub_rel_id`) USING BTREE;

--
-- Indices de la tabla `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`rol_id`) USING BTREE;

--
-- Indices de la tabla `roles_categorys`
--
ALTER TABLE `roles_categorys`
  ADD PRIMARY KEY (`rol_cat_rol_id`,`rol_cat_cat_id`) USING BTREE;

--
-- Indices de la tabla `roles_entities`
--
ALTER TABLE `roles_entities`
  ADD PRIMARY KEY (`rol_ent_rol_id`,`rol_ent_ent_id`) USING BTREE;

--
-- Indices de la tabla `roles_modules`
--
ALTER TABLE `roles_modules`
  ADD PRIMARY KEY (`rol_mod_mod_id`,`rol_mod_rol_id`) USING BTREE;

--
-- Indices de la tabla `roles_sites`
--
ALTER TABLE `roles_sites`
  ADD PRIMARY KEY (`rol_site_rol_id`,`rol_site_site_id`) USING BTREE,
  ADD KEY `idx_site_id` (`rol_site_site_id`) USING BTREE,
  ADD KEY `idx_order` (`rol_site_site_id`,`rol_site_order`) USING BTREE;

--
-- Indices de la tabla `roles_systems`
--
ALTER TABLE `roles_systems`
  ADD PRIMARY KEY (`rol_sys_rol_id`,`rol_sys_sys_id`,`rol_sys_ent_id`) USING BTREE;

--
-- Indices de la tabla `sites`
--
ALTER TABLE `sites`
  ADD PRIMARY KEY (`site_id`) USING BTREE,
  ADD KEY `idx_state` (`site_state`) USING BTREE,
  ADD KEY `idx_ent_id` (`site_ent_id`) USING BTREE,
  ADD KEY `idx_path_web` (`site_path_web`(250)) USING BTREE,
  ADD KEY `idx_path_host` (`site_path_host`(250)) USING BTREE,
  ADD KEY `idx_ent_state` (`site_ent_id`,`site_state`) USING BTREE;

--
-- Indices de la tabla `sites_entities`
--
ALTER TABLE `sites_entities`
  ADD PRIMARY KEY (`site_ent_site_id`,`site_ent_ent_id`) USING BTREE,
  ADD KEY `idx_site_id` (`site_ent_site_id`) USING BTREE,
  ADD KEY `idx_ent_id` (`site_ent_ent_id`) USING BTREE,
  ADD KEY `idx_order` (`site_ent_site_id`,`site_ent_order`) USING BTREE;

--
-- Indices de la tabla `sites_users`
--
ALTER TABLE `sites_users`
  ADD PRIMARY KEY (`site_user_site_id`,`site_user_user_id`) USING BTREE,
  ADD KEY `idx_user_id` (`site_user_user_id`) USING BTREE,
  ADD KEY `idx_rol_id` (`site_user_rol_id`) USING BTREE,
  ADD KEY `idx_order` (`site_user_site_id`,`site_user_order`) USING BTREE;

--
-- Indices de la tabla `systems`
--
ALTER TABLE `systems`
  ADD PRIMARY KEY (`sys_id`) USING BTREE;

--
-- Indices de la tabla `systems_modules`
--
ALTER TABLE `systems_modules`
  ADD PRIMARY KEY (`sys_mod_sys_id`,`sys_mod_mod_id`,`sys_mod_ent_id`) USING BTREE;

--
-- Indices de la tabla `users_firms`
--
ALTER TABLE `users_firms`
  ADD PRIMARY KEY (`user_firm_id`,`user_firm_user_id`) USING BTREE;

--
-- Indices de la tabla `users_groups`
--
ALTER TABLE `users_groups`
  ADD PRIMARY KEY (`user_group_user_id`,`user_group_group_id`) USING BTREE;

--
-- Indices de la tabla `users_path`
--
ALTER TABLE `users_path`
  ADD PRIMARY KEY (`user_path_user_id`,`user_path_mod_id`) USING BTREE;

--
-- Indices de la tabla `users_roles`
--
ALTER TABLE `users_roles`
  ADD PRIMARY KEY (`user_rol_user_id`,`user_rol_rol_id`) USING BTREE;

--
-- Indices de la tabla `users_tabs`
--
ALTER TABLE `users_tabs`
  ADD PRIMARY KEY (`user_tab_user_id`,`user_tab_sys_id`,`user_tab_ent_id`) USING BTREE;

--
-- Indices de la tabla `worksheets`
--
ALTER TABLE `worksheets`
  ADD PRIMARY KEY (`ws_id`) USING BTREE;

--
-- Indices de la tabla `worksheets_blocks`
--
ALTER TABLE `worksheets_blocks`
  ADD PRIMARY KEY (`ws_block_ws_id`,`ws_block_block_id`) USING BTREE;

--
-- AUTO_INCREMENT de las tablas volcadas
--

--
-- AUTO_INCREMENT de la tabla `ai_categories`
--
ALTER TABLE `ai_categories`
  MODIFY `ai_cat_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT de la tabla `ai_categorys`
--
ALTER TABLE `ai_categorys`
  MODIFY `ai_cat_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `ai_keys`
--
ALTER TABLE `ai_keys`
  MODIFY `ai_key_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `ai_logs`
--
ALTER TABLE `ai_logs`
  MODIFY `ai_log_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `ai_module_relations`
--
ALTER TABLE `ai_module_relations`
  MODIFY `ai_mod_rel_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `ai_prompts`
--
ALTER TABLE `ai_prompts`
  MODIFY `ai_prt_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `ai_responses`
--
ALTER TABLE `ai_responses`
  MODIFY `ai_rsp_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `ai_responses_history`
--
ALTER TABLE `ai_responses_history`
  MODIFY `ai_rsp_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `blocks`
--
ALTER TABLE `blocks`
  MODIFY `block_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT de la tabla `categorys`
--
ALTER TABLE `categorys`
  MODIFY `cat_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT de la tabla `contents`
--
ALTER TABLE `contents`
  MODIFY `cont_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `docs`
--
ALTER TABLE `docs`
  MODIFY `doc_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `files`
--
ALTER TABLE `files`
  MODIFY `file_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `forms`
--
ALTER TABLE `forms`
  MODIFY `form_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del formulario', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `forms_entries`
--
ALTER TABLE `forms_entries`
  MODIFY `form_entry_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del envío/entrada';

--
-- AUTO_INCREMENT de la tabla `forms_fields`
--
ALTER TABLE `forms_fields`
  MODIFY `form_fld_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del campo', AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT de la tabla `groups`
--
ALTER TABLE `groups`
  MODIFY `group_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `links`
--
ALTER TABLE `links`
  MODIFY `lnk_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `menus`
--
ALTER TABLE `menus`
  MODIFY `menu_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `menus_items`
--
ALTER TABLE `menus_items`
  MODIFY `menu_item_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=253;

--
-- AUTO_INCREMENT de la tabla `modules`
--
ALTER TABLE `modules`
  MODIFY `mod_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4603;

--
-- AUTO_INCREMENT de la tabla `mod_accounting_plan`
--
ALTER TABLE `mod_accounting_plan`
  MODIFY `mod_acp_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_accounts_ads`
--
ALTER TABLE `mod_accounts_ads`
  MODIFY `mod_aca_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_accounts_invoices_data`
--
ALTER TABLE `mod_accounts_invoices_data`
  MODIFY `mod_acu_invd_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_accounts_plans`
--
ALTER TABLE `mod_accounts_plans`
  MODIFY `mod_ap_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT de la tabla `mod_accounts_roles`
--
ALTER TABLE `mod_accounts_roles`
  MODIFY `mod_acu_rol_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `mod_actions`
--
ALTER TABLE `mod_actions`
  MODIFY `mod_act_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_acuse`
--
ALTER TABLE `mod_acuse`
  MODIFY `mod_ac_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_addresses`
--
ALTER TABLE `mod_addresses`
  MODIFY `mod_add_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_ads`
--
ALTER TABLE `mod_ads`
  MODIFY `mod_ads_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único del anuncio';

--
-- AUTO_INCREMENT de la tabla `mod_ads_campaigns`
--
ALTER TABLE `mod_ads_campaigns`
  MODIFY `mod_ads_campaign_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la campaña', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `mod_ads_devices`
--
ALTER TABLE `mod_ads_devices`
  MODIFY `mod_ads_device_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único del dispositivo';

--
-- AUTO_INCREMENT de la tabla `mod_ads_display`
--
ALTER TABLE `mod_ads_display`
  MODIFY `mod_ads_dsp_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_ads_displays`
--
ALTER TABLE `mod_ads_displays`
  MODIFY `mod_ads_dsp_dsp_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la posición del anuncio';

--
-- AUTO_INCREMENT de la tabla `mod_ads_locations`
--
ALTER TABLE `mod_ads_locations`
  MODIFY `mod_ads_location_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la ubicación';

--
-- AUTO_INCREMENT de la tabla `mod_ads_performance_metrics`
--
ALTER TABLE `mod_ads_performance_metrics`
  MODIFY `mod_ads_metric_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la métrica';

--
-- AUTO_INCREMENT de la tabla `mod_ads_types`
--
ALTER TABLE `mod_ads_types`
  MODIFY `mod_ads_type_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único del tipo de anuncio';

--
-- AUTO_INCREMENT de la tabla `mod_advised_calendars`
--
ALTER TABLE `mod_advised_calendars`
  MODIFY `mod_adv_cal_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_advised_calendars_blocked`
--
ALTER TABLE `mod_advised_calendars_blocked`
  MODIFY `mod_adv_cb_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_advised_counselors_fields`
--
ALTER TABLE `mod_advised_counselors_fields`
  MODIFY `mod_adv_fds_user_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_advised_history`
--
ALTER TABLE `mod_advised_history`
  MODIFY `mod_adv_his_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_advised_options`
--
ALTER TABLE `mod_advised_options`
  MODIFY `mod_adv_opt_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_advised_schedules`
--
ALTER TABLE `mod_advised_schedules`
  MODIFY `mod_adv_sch_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_advised_types_appointments`
--
ALTER TABLE `mod_advised_types_appointments`
  MODIFY `mod_adv_tya_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `mod_advised_user`
--
ALTER TABLE `mod_advised_user`
  MODIFY `mod_adv_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_calendars`
--
ALTER TABLE `mod_appointments_calendars`
  MODIFY `mod_apt_cal_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la cita';

--
-- AUTO_INCREMENT de la tabla `mod_appointments_calendars_blocked`
--
ALTER TABLE `mod_appointments_calendars_blocked`
  MODIFY `mod_apt_cb_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_exceptions`
--
ALTER TABLE `mod_appointments_exceptions`
  MODIFY `mod_apt_exc_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_logs`
--
ALTER TABLE `mod_appointments_logs`
  MODIFY `mod_apt_log_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_options`
--
ALTER TABLE `mod_appointments_options`
  MODIFY `mod_apt_opt_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_payments`
--
ALTER TABLE `mod_appointments_payments`
  MODIFY `mod_apt_pay_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id del pago';

--
-- AUTO_INCREMENT de la tabla `mod_appointments_reviews`
--
ALTER TABLE `mod_appointments_reviews`
  MODIFY `mod_apt_rev_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la reseña';

--
-- AUTO_INCREMENT de la tabla `mod_appointments_schedules`
--
ALTER TABLE `mod_appointments_schedules`
  MODIFY `mod_apt_sch_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_bi_dim_vendor`
--
ALTER TABLE `mod_bi_dim_vendor`
  MODIFY `mod_bv_key` int NOT NULL AUTO_INCREMENT COMMENT 'Clave subrogada para la Dimensión de Vendor';

--
-- AUTO_INCREMENT de la tabla `mod_bi_fact_sales`
--
ALTER TABLE `mod_bi_fact_sales`
  MODIFY `mod_bfs_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Clave primaria subrogada para rendimiento OLAP';

--
-- AUTO_INCREMENT de la tabla `mod_brands`
--
ALTER TABLE `mod_brands`
  MODIFY `mod_brd_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `mod_campaigns_ads`
--
ALTER TABLE `mod_campaigns_ads`
  MODIFY `mod_cpa_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_candire_campaigns`
--
ALTER TABLE `mod_candire_campaigns`
  MODIFY `mod_cnd_cp_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_carts`
--
ALTER TABLE `mod_carts`
  MODIFY `mod_cart_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_ccm_messages`
--
ALTER TABLE `mod_ccm_messages`
  MODIFY `mod_cm_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del mensaje';

--
-- AUTO_INCREMENT de la tabla `mod_ccm_reviews`
--
ALTER TABLE `mod_ccm_reviews`
  MODIFY `mod_cr_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la reseña';

--
-- AUTO_INCREMENT de la tabla `mod_ccm_tickets`
--
ALTER TABLE `mod_ccm_tickets`
  MODIFY `mod_ct_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del ticket de soporte';

--
-- AUTO_INCREMENT de la tabla `mod_classification_info`
--
ALTER TABLE `mod_classification_info`
  MODIFY `mod_clsi_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_competitions`
--
ALTER TABLE `mod_competitions`
  MODIFY `mod_cmp_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_competitions_mira`
--
ALTER TABLE `mod_competitions_mira`
  MODIFY `mod_cmp_mira_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_contacts`
--
ALTER TABLE `mod_contacts`
  MODIFY `mod_con_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único del contacto';

--
-- AUTO_INCREMENT de la tabla `mod_crm_activities`
--
ALTER TABLE `mod_crm_activities`
  MODIFY `mod_crm_act_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de la actividad';

--
-- AUTO_INCREMENT de la tabla `mod_crm_contact_tags`
--
ALTER TABLE `mod_crm_contact_tags`
  MODIFY `mod_crm_cta_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de la relación';

--
-- AUTO_INCREMENT de la tabla `mod_crm_customers`
--
ALTER TABLE `mod_crm_customers`
  MODIFY `mod_cc_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del cliente';

--
-- AUTO_INCREMENT de la tabla `mod_crm_custom_fields`
--
ALTER TABLE `mod_crm_custom_fields`
  MODIFY `mod_crm_cfi_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único del campo personalizado';

--
-- AUTO_INCREMENT de la tabla `mod_crm_custom_field_values`
--
ALTER TABLE `mod_crm_custom_field_values`
  MODIFY `mod_crm_cfv_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único del valor';

--
-- AUTO_INCREMENT de la tabla `mod_crm_documents`
--
ALTER TABLE `mod_crm_documents`
  MODIFY `mod_crm_doc_id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID único del documento';

--
-- AUTO_INCREMENT de la tabla `mod_crm_email_templates`
--
ALTER TABLE `mod_crm_email_templates`
  MODIFY `mod_crm_emt_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de la plantilla', AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT de la tabla `mod_crm_interactions`
--
ALTER TABLE `mod_crm_interactions`
  MODIFY `mod_crm_int_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de la interacción';

--
-- AUTO_INCREMENT de la tabla `mod_crm_notes`
--
ALTER TABLE `mod_crm_notes`
  MODIFY `mod_crm_note_id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID único de la nota';

--
-- AUTO_INCREMENT de la tabla `mod_customers_enterprises`
--
ALTER TABLE `mod_customers_enterprises`
  MODIFY `mod_cen_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT de la tabla `mod_customers_enterprises_data`
--
ALTER TABLE `mod_customers_enterprises_data`
  MODIFY `mod_cen_data_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT de la tabla `mod_customers_options`
--
ALTER TABLE `mod_customers_options`
  MODIFY `mod_cop_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de opción', AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT de la tabla `mod_customers_persons`
--
ALTER TABLE `mod_customers_persons`
  MODIFY `mod_cpe_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_departments`
--
ALTER TABLE `mod_departments`
  MODIFY `mod_dep_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT de la tabla `mod_discount`
--
ALTER TABLE `mod_discount`
  MODIFY `mod_dis_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `mod_events`
--
ALTER TABLE `mod_events`
  MODIFY `mod_eve_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_events_halls`
--
ALTER TABLE `mod_events_halls`
  MODIFY `mod_eve_hall_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_events_options`
--
ALTER TABLE `mod_events_options`
  MODIFY `mod_eve_option_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_events_tickets`
--
ALTER TABLE `mod_events_tickets`
  MODIFY `mod_eve_tck_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_external_docs_options`
--
ALTER TABLE `mod_external_docs_options`
  MODIFY `mod_edc_opt_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_external_docs_page_design`
--
ALTER TABLE `mod_external_docs_page_design`
  MODIFY `mod_edc_pd_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_external_docs_templates`
--
ALTER TABLE `mod_external_docs_templates`
  MODIFY `mod_edc_tpl_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_external_docs_types`
--
ALTER TABLE `mod_external_docs_types`
  MODIFY `mod_edc_type_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_fss_payouts`
--
ALTER TABLE `mod_fss_payouts`
  MODIFY `mod_fp_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del pago a vendor';

--
-- AUTO_INCREMENT de la tabla `mod_fss_vendor_balance`
--
ALTER TABLE `mod_fss_vendor_balance`
  MODIFY `mod_fvb_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del movimiento de saldo';

--
-- AUTO_INCREMENT de la tabla `mod_ganador_ganaderos`
--
ALTER TABLE `mod_ganador_ganaderos`
  MODIFY `mod_ggd_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_ganador_propiedades`
--
ALTER TABLE `mod_ganador_propiedades`
  MODIFY `mod_gpr_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_ganador_proyectos`
--
ALTER TABLE `mod_ganador_proyectos`
  MODIFY `mod_gp_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_gl_accounts`
--
ALTER TABLE `mod_gl_accounts`
  MODIFY `mod_gl_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de cuenta contable';

--
-- AUTO_INCREMENT de la tabla `mod_gl_entries`
--
ALTER TABLE `mod_gl_entries`
  MODIFY `mod_ge_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del asiento contable detallado';

--
-- AUTO_INCREMENT de la tabla `mod_gl_transactions`
--
ALTER TABLE `mod_gl_transactions`
  MODIFY `mod_gt_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la transacción de negocio';

--
-- AUTO_INCREMENT de la tabla `mod_hrm_employees`
--
ALTER TABLE `mod_hrm_employees`
  MODIFY `mod_he_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del empleado';

--
-- AUTO_INCREMENT de la tabla `mod_hrm_positions`
--
ALTER TABLE `mod_hrm_positions`
  MODIFY `mod_hp_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la posición';

--
-- AUTO_INCREMENT de la tabla `mod_inventory_options`
--
ALTER TABLE `mod_inventory_options`
  MODIFY `mod_inv_opt_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `mod_inventory_units`
--
ALTER TABLE `mod_inventory_units`
  MODIFY `mod_inv_unt_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_invoices`
--
ALTER TABLE `mod_invoices`
  MODIFY `mod_inv_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_jobtitle`
--
ALTER TABLE `mod_jobtitle`
  MODIFY `mod_jbt_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT de la tabla `mod_kardex`
--
ALTER TABLE `mod_kardex`
  MODIFY `mod_kdx_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10012;

--
-- AUTO_INCREMENT de la tabla `mod_leagues`
--
ALTER TABLE `mod_leagues`
  MODIFY `mod_lg_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `mod_leagues_divisions`
--
ALTER TABLE `mod_leagues_divisions`
  MODIFY `mod_lg_div_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `mod_logistics_distribution_move`
--
ALTER TABLE `mod_logistics_distribution_move`
  MODIFY `mod_log_dtz_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_logistics_distribution_zone`
--
ALTER TABLE `mod_logistics_distribution_zone`
  MODIFY `mod_log_dtz_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `mod_make`
--
ALTER TABLE `mod_make`
  MODIFY `mod_mak_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_management`
--
ALTER TABLE `mod_management`
  MODIFY `mod_mag_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_oms_fulfillments`
--
ALTER TABLE `mod_oms_fulfillments`
  MODIFY `mod_of_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la unidad de cumplimiento';

--
-- AUTO_INCREMENT de la tabla `mod_oms_orders`
--
ALTER TABLE `mod_oms_orders`
  MODIFY `mod_oo_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la orden de cliente';

--
-- AUTO_INCREMENT de la tabla `mod_oms_order_items`
--
ALTER TABLE `mod_oms_order_items`
  MODIFY `mod_oi_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la partida/item de la orden';

--
-- AUTO_INCREMENT de la tabla `mod_oms_refunds`
--
ALTER TABLE `mod_oms_refunds`
  MODIFY `mod_orf_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del reembolso financiero';

--
-- AUTO_INCREMENT de la tabla `mod_oms_returns`
--
ALTER TABLE `mod_oms_returns`
  MODIFY `mod_or_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la solicitud de devolución';

--
-- AUTO_INCREMENT de la tabla `mod_oms_shipments`
--
ALTER TABLE `mod_oms_shipments`
  MODIFY `mod_os_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del envío físico';

--
-- AUTO_INCREMENT de la tabla `mod_organization_chart`
--
ALTER TABLE `mod_organization_chart`
  MODIFY `mod_orc_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_pay_tx_suscriptions`
--
ALTER TABLE `mod_pay_tx_suscriptions`
  MODIFY `mod_pay_tx_sbs_id` bigint NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_pay_tx_temp`
--
ALTER TABLE `mod_pay_tx_temp`
  MODIFY `mod_pay_tx_tmp_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_pay_tx_tickets`
--
ALTER TABLE `mod_pay_tx_tickets`
  MODIFY `mod_pay_tx_tck_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_persons`
--
ALTER TABLE `mod_persons`
  MODIFY `mod_person_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la persona';

--
-- AUTO_INCREMENT de la tabla `mod_persons_types`
--
ALTER TABLE `mod_persons_types`
  MODIFY `mod_person_type_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único del tipo de persona', AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `mod_pim_attributes`
--
ALTER TABLE `mod_pim_attributes`
  MODIFY `mod_pa_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del atributo';

--
-- AUTO_INCREMENT de la tabla `mod_pim_attribute_values`
--
ALTER TABLE `mod_pim_attribute_values`
  MODIFY `mod_pv_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del valor de atributo';

--
-- AUTO_INCREMENT de la tabla `mod_pim_collections`
--
ALTER TABLE `mod_pim_collections`
  MODIFY `mod_pcol_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la colección', AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `mod_pim_config`
--
ALTER TABLE `mod_pim_config`
  MODIFY `mod_pconf_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único', AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT de la tabla `mod_pim_products`
--
ALTER TABLE `mod_pim_products`
  MODIFY `mod_pp_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del producto base', AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `mod_pim_skus`
--
ALTER TABLE `mod_pim_skus`
  MODIFY `mod_ps_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del SKU / Variante';

--
-- AUTO_INCREMENT de la tabla `mod_places`
--
ALTER TABLE `mod_places`
  MODIFY `mod_plc_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_prices_list`
--
ALTER TABLE `mod_prices_list`
  MODIFY `mod_prl_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_producers`
--
ALTER TABLE `mod_producers`
  MODIFY `mod_prd_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products`
--
ALTER TABLE `mod_products`
  MODIFY `mod_prod_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products_clothing_store`
--
ALTER TABLE `mod_products_clothing_store`
  MODIFY `mod_prod_cst_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products_colors`
--
ALTER TABLE `mod_products_colors`
  MODIFY `mod_prod_color_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products_food`
--
ALTER TABLE `mod_products_food`
  MODIFY `mod_prod_food_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products_options`
--
ALTER TABLE `mod_products_options`
  MODIFY `mod_prod_opt_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT de la tabla `mod_products_pharmacy`
--
ALTER TABLE `mod_products_pharmacy`
  MODIFY `mod_prod_pha_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products_pharmacy_stock`
--
ALTER TABLE `mod_products_pharmacy_stock`
  MODIFY `mod_prod_pha_stk_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products_prices_list`
--
ALTER TABLE `mod_products_prices_list`
  MODIFY `mod_prod_prl_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products_relation`
--
ALTER TABLE `mod_products_relation`
  MODIFY `mod_prod_rel_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products_rw`
--
ALTER TABLE `mod_products_rw`
  MODIFY `mod_prod_rw_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_products_types`
--
ALTER TABLE `mod_products_types`
  MODIFY `mod_prod_type_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `mod_providers`
--
ALTER TABLE `mod_providers`
  MODIFY `mod_prov_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_rehabilitation_centers`
--
ALTER TABLE `mod_rehabilitation_centers`
  MODIFY `mod_rhb_center_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `mod_rehabilitation_intern`
--
ALTER TABLE `mod_rehabilitation_intern`
  MODIFY `mod_rhb_int_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_rehabilitation_primary_consumption`
--
ALTER TABLE `mod_rehabilitation_primary_consumption`
  MODIFY `mod_rhb_pcn_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_rehabilitation_tutor`
--
ALTER TABLE `mod_rehabilitation_tutor`
  MODIFY `mod_rhb_tutor_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `mod_rehabilitation_user`
--
ALTER TABLE `mod_rehabilitation_user`
  MODIFY `mod_rhb_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_rems_lots`
--
ALTER TABLE `mod_rems_lots`
  MODIFY `mod_rems_lots_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=193;

--
-- AUTO_INCREMENT de la tabla `mod_rems_projects`
--
ALTER TABLE `mod_rems_projects`
  MODIFY `mod_rems_projects_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `mod_services`
--
ALTER TABLE `mod_services`
  MODIFY `mod_srv_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_sliders`
--
ALTER TABLE `mod_sliders`
  MODIFY `mod_sli_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT de la tabla `mod_sliders_files`
--
ALTER TABLE `mod_sliders_files`
  MODIFY `mod_sli_file_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT de la tabla `mod_sports`
--
ALTER TABLE `mod_sports`
  MODIFY `mod_spt_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_sports_dates`
--
ALTER TABLE `mod_sports_dates`
  MODIFY `mod_sp_dt_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_sports_games`
--
ALTER TABLE `mod_sports_games`
  MODIFY `mod_sp_gm_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_sports_teams`
--
ALTER TABLE `mod_sports_teams`
  MODIFY `mod_sp_tm_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_stock`
--
ALTER TABLE `mod_stock`
  MODIFY `mod_stk_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_stock_receipt`
--
ALTER TABLE `mod_stock_receipt`
  MODIFY `mod_str_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_surveys`
--
ALTER TABLE `mod_surveys`
  MODIFY `mod_svy_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_surveys_options`
--
ALTER TABLE `mod_surveys_options`
  MODIFY `mod_svy_so_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_surveys_questions`
--
ALTER TABLE `mod_surveys_questions`
  MODIFY `mod_svy_sq_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_syllabus`
--
ALTER TABLE `mod_syllabus`
  MODIFY `mod_syl_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_syllabus_contents`
--
ALTER TABLE `mod_syllabus_contents`
  MODIFY `mod_syl_cont_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_syllabus_periods`
--
ALTER TABLE `mod_syllabus_periods`
  MODIFY `mod_syl_per_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_facturas_cliente`
--
ALTER TABLE `mod_tributes_facturas_cliente`
  MODIFY `mod_tb_fac_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_facturas_filter`
--
ALTER TABLE `mod_tributes_facturas_filter`
  MODIFY `mod_tb_fcf_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_options`
--
ALTER TABLE `mod_tributes_options`
  MODIFY `mod_tb_op_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_periods`
--
ALTER TABLE `mod_tributes_periods`
  MODIFY `mod_tb_pr_id` int NOT NULL AUTO_INCREMENT COMMENT 'ej:202409 se refiere al periodo 2024-09 año/mes siempre seran 6 digitos', AUTO_INCREMENT=202513;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_relations_periods`
--
ALTER TABLE `mod_tributes_relations_periods`
  MODIFY `mod_tb_rpd_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT de la tabla `mod_types_contribuyentes`
--
ALTER TABLE `mod_types_contribuyentes`
  MODIFY `mod_typc_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT de la tabla `mod_types_forms`
--
ALTER TABLE `mod_types_forms`
  MODIFY `mod_type_form_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=611;

--
-- AUTO_INCREMENT de la tabla `mod_types_oficios`
--
ALTER TABLE `mod_types_oficios`
  MODIFY `mod_tb_tof_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT de la tabla `mod_validme_applicants`
--
ALTER TABLE `mod_validme_applicants`
  MODIFY `mod_va_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `mod_validme_callback_logs`
--
ALTER TABLE `mod_validme_callback_logs`
  MODIFY `mod_vcl_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único del log';

--
-- AUTO_INCREMENT de la tabla `mod_validme_checks`
--
ALTER TABLE `mod_validme_checks`
  MODIFY `mod_vc_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `mod_validme_options`
--
ALTER TABLE `mod_validme_options`
  MODIFY `mod_vo_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de opción';

--
-- AUTO_INCREMENT de la tabla `mod_vms_commission_rules`
--
ALTER TABLE `mod_vms_commission_rules`
  MODIFY `mod_vcr_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la regla de comisión';

--
-- AUTO_INCREMENT de la tabla `mod_vms_performance`
--
ALTER TABLE `mod_vms_performance`
  MODIFY `mod_vp_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la métrica';

--
-- AUTO_INCREMENT de la tabla `mod_vms_vendors`
--
ALTER TABLE `mod_vms_vendors`
  MODIFY `mod_vv_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del vendedor (Vendor)';

--
-- AUTO_INCREMENT de la tabla `mod_warehouses`
--
ALTER TABLE `mod_warehouses`
  MODIFY `mod_wrh_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `mod_wms_movement_log`
--
ALTER TABLE `mod_wms_movement_log`
  MODIFY `mod_wm_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del movimiento de inventario';

--
-- AUTO_INCREMENT de la tabla `mod_wms_storage_bins`
--
ALTER TABLE `mod_wms_storage_bins`
  MODIFY `mod_wb_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del bin (ubicación granular)';

--
-- AUTO_INCREMENT de la tabla `mod_wms_warehouses`
--
ALTER TABLE `mod_wms_warehouses`
  MODIFY `mod_ww_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del almacén';

--
-- AUTO_INCREMENT de la tabla `notifications`
--
ALTER TABLE `notifications`
  MODIFY `ntf_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `options`
--
ALTER TABLE `options`
  MODIFY `option_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;

--
-- AUTO_INCREMENT de la tabla `posts`
--
ALTER TABLE `posts`
  MODIFY `post_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `posts_authors`
--
ALTER TABLE `posts_authors`
  MODIFY `post_au_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `publications`
--
ALTER TABLE `publications`
  MODIFY `pub_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT de la tabla `publications_pattern`
--
ALTER TABLE `publications_pattern`
  MODIFY `pub_pat_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `publications_relations`
--
ALTER TABLE `publications_relations`
  MODIFY `pub_rel_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `roles`
--
ALTER TABLE `roles`
  MODIFY `rol_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT de la tabla `sites`
--
ALTER TABLE `sites`
  MODIFY `site_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único del sitio', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `systems`
--
ALTER TABLE `systems`
  MODIFY `sys_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

--
-- AUTO_INCREMENT de la tabla `users_firms`
--
ALTER TABLE `users_firms`
  MODIFY `user_firm_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `worksheets`
--
ALTER TABLE `worksheets`
  MODIFY `ws_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- Restricciones para tablas volcadas
--

--
-- Filtros para la tabla `mod_surveys_options`
--
ALTER TABLE `mod_surveys_options`
  ADD CONSTRAINT `mod_surveys_options_ibfk_1` FOREIGN KEY (`mod_svy_so_sq_id`) REFERENCES `mod_surveys_questions` (`mod_svy_sq_id`) ON DELETE RESTRICT ON UPDATE RESTRICT;

--
-- Filtros para la tabla `mod_surveys_questions`
--
ALTER TABLE `mod_surveys_questions`
  ADD CONSTRAINT `mod_surveys_questions_ibfk_1` FOREIGN KEY (`mod_svy_sq_svy_id`) REFERENCES `mod_surveys` (`mod_svy_id`) ON DELETE RESTRICT ON UPDATE RESTRICT;

DELIMITER $$
--
-- Eventos
--
CREATE DEFINER=`dev`@`%` EVENT `mod_crm_evt_update_overdue_activities` ON SCHEDULE EVERY 1 HOUR STARTS '2025-10-25 16:35:40' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
    UPDATE mod_crm_activities
    SET mod_crm_act_status = 'overdue'
    WHERE mod_crm_act_due_date < NOW()
    AND mod_crm_act_status = 'pending';
END$$

DELIMITER ;
COMMIT;

