/*
 Navicat Premium Data Transfer

 Source Server         : dev.io
 Source Server Type    : MySQL
 Source Server Version : 80045
 Source Host           : 192.168.100.177:3306
 Source Schema         : nucleo_base

 Target Server Type    : MySQL
 Target Server Version : 80045
 File Encoding         : 65001

 Date: 25/04/2026 09:10:23
*/


-- ----------------------------
-- Table structure for ai_categories
-- ----------------------------
CREATE TABLE `ai_categories` (
  `ai_cat_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cat',
  `ai_cat_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `ai_cat_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `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',
  PRIMARY KEY (`ai_cat_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ai_categories
-- ----------------------------
BEGIN;
INSERT INTO `ai_categories` VALUES (1, 'support', 1, 0, NULL);
INSERT INTO `ai_categories` VALUES (2, 'sales', 1, 0, NULL);
INSERT INTO `ai_categories` VALUES (3, 'inventory', 1, 0, NULL);
INSERT INTO `ai_categories` VALUES (4, 'other', 1, 0, NULL);
COMMIT;

-- ----------------------------
-- Table structure for ai_categorys
-- ----------------------------
CREATE TABLE `ai_categorys` (
  `ai_cat_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cat',
  `ai_cat_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `ai_cat_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `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',
  PRIMARY KEY (`ai_cat_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ai_categorys
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for ai_keys
-- ----------------------------
CREATE TABLE `ai_keys` (
  `ai_key_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de key',
  `ai_key_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `ai_key_value` varbinary(255) NOT NULL COMMENT 'Valor de ai key value',
  `ai_key_provider` enum('OpenAI','Azure','Google','Other') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'OpenAI' COMMENT 'Valor de ai key provider',
  `ai_key_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `ai_key_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de actualización',
  `ai_key_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `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',
  PRIMARY KEY (`ai_key_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ai_keys
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for ai_logs
-- ----------------------------
CREATE TABLE `ai_logs` (
  `ai_log_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de log',
  `ai_log_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `ai_log_prompt_id` int NOT NULL COMMENT 'ID de log prompt',
  `ai_log_response_id` int NOT NULL COMMENT 'ID de log response',
  `ai_log_execution_time` float DEFAULT NULL COMMENT 'Valor de ai log execution time',
  `ai_log_status` enum('success','error','pending') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'success' COMMENT 'Estado del proceso',
  `ai_log_error_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de ai log error details',
  `ai_log_request_metadata` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `ai_log_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `ai_log_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `ai_log_state` int DEFAULT '0' COMMENT '0=active, 1=archived, 2=deleted',
  PRIMARY KEY (`ai_log_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ai_logs
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for ai_module_relations
-- ----------------------------
CREATE TABLE `ai_module_relations` (
  `ai_mod_rel_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de mod rel',
  `ai_mod_rel_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `ai_mod_rel_feature` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de ai mod rel feature',
  `ai_mod_rel_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `ai_mod_rel_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de actualización',
  `ai_mod_rel_mod_id` int NOT NULL COMMENT 'ID de mod rel mod',
  `ai_mod_rel_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `ai_mod_rel_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `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',
  PRIMARY KEY (`ai_mod_rel_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ai_module_relations
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for ai_prompts
-- ----------------------------
CREATE TABLE `ai_prompts` (
  `ai_prt_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de prt',
  `ai_prt_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de ai prt text',
  `ai_prt_cat_id` int NOT NULL COMMENT 'ID de prt cat',
  `ai_prt_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `ai_prt_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de actualización',
  `ai_prt_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `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',
  PRIMARY KEY (`ai_prt_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ai_prompts
-- ----------------------------
BEGIN;
INSERT INTO `ai_prompts` 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);
INSERT INTO `ai_prompts` VALUES (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);
COMMIT;

-- ----------------------------
-- Table structure for ai_responses
-- ----------------------------
CREATE TABLE `ai_responses` (
  `ai_rsp_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de rsp',
  `ai_rsp_prompt_id` int NOT NULL COMMENT 'ID de rsp prompt',
  `ai_rsp_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de ai rsp text',
  `ai_rsp_model_used` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'GPT-4' COMMENT 'Valor de ai rsp model used',
  `ai_rsp_confidence_score` decimal(5,2) DEFAULT NULL COMMENT 'Valor de ai rsp confidence score',
  `ai_rsp_created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `ai_rsp_updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Fecha de actualización',
  `ai_rsp_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `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',
  PRIMARY KEY (`ai_rsp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ai_responses
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for ai_responses_history
-- ----------------------------
CREATE TABLE `ai_responses_history` (
  `ai_rsp_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de rsp',
  `ai_rsp_prompt_id` int NOT NULL COMMENT 'ID de rsp prompt',
  `ai_rsp_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de ai rsp text',
  `ai_rsp_model_used` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'GPT-4' COMMENT 'Valor de ai rsp model used',
  `ai_rsp_confidence_score` decimal(5,2) DEFAULT NULL COMMENT 'Valor de ai rsp confidence score',
  `ai_rsp_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de creación',
  `ai_rsp_updated_at` datetime DEFAULT NULL COMMENT 'Fecha de actualización',
  `ai_rsp_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `ai_rsp_state` int DEFAULT '0' COMMENT 'Estado del registro',
  `operation_type` enum('INSERT','UPDATE','DELETE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de registro',
  `operation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Valor de operation time',
  PRIMARY KEY (`ai_rsp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ai_responses_history
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for blocks
-- ----------------------------
CREATE TABLE `blocks` (
  `block_id` int NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del registro',
  `block_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `block_class` varchar(44) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de block class',
  `block_order` int DEFAULT NULL COMMENT 'Orden de visualización',
  `block_parent_id` int NOT NULL COMMENT 'ID de parent',
  `block_ent_id` int NOT NULL DEFAULT '0' COMMENT 'ID de la entidad',
  `block_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`block_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of blocks
-- ----------------------------
BEGIN;
INSERT INTO `blocks` VALUES (1, 'Header', 'headerPage', 1, 0, 1, 1);
INSERT INTO `blocks` VALUES (2, 'Body', 'bodyPage', 2, 0, 1, 1);
INSERT INTO `blocks` VALUES (3, 'Footer', 'footerPage', 3, 0, 1, 1);
INSERT INTO `blocks` VALUES (4, 'Aside', 'asidePage', 2, 2, 1, 0);
INSERT INTO `blocks` VALUES (9, 'Aside Fluid', 'asideFluid', 1, 4, 1, 0);
COMMIT;

-- ----------------------------
-- Table structure for categorys
-- ----------------------------
CREATE TABLE `categorys` (
  `cat_id` int NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del registro',
  `cat_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `cat_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta del recurso',
  `cat_pathurl` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta URL del recurso',
  `cat_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `cat_order` int DEFAULT NULL COMMENT 'Orden de visualización',
  `cat_parent_id` int DEFAULT '0' COMMENT 'ID de parent',
  `cat_related` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cat related',
  `cat_icon` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cat icon',
  `cat_color` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cat color',
  `cat_img` int DEFAULT NULL COMMENT 'Valor de cat img',
  `cat_banner` int DEFAULT NULL COMMENT 'Valor de cat banner',
  `cat_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `cat_configpath` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cat configpath',
  `cat_cls` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cat cls',
  `cat_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `cat_state_collapse` int NOT NULL DEFAULT '1' COMMENT 'Valor de cat state collapse',
  `cat_site_id` int NOT NULL DEFAULT '1' COMMENT 'ID del sitio',
  `cat_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`cat_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of categorys
-- ----------------------------
BEGIN;
INSERT INTO `categorys` VALUES (1, 'Home', 'home', 'home', '', 0, 0, '', '', '', 0, 0, 1, '', '', '', 1, 1, 1);
INSERT INTO `categorys` VALUES (3, 'Contact', 'contact', 'contact', 'Contact category', 4, 0, '', '', '', 0, 0, 1, '', '', '', 1, 1, 1);
INSERT INTO `categorys` VALUES (2, 'Productos', 'productos', 'productos', '', 1, 0, '', '', '', 0, 0, 1, '', '', '', 1, 1, 1);
INSERT INTO `categorys` VALUES (4, 'Dormitorio', 'dormitorio', 'dormitorio', '', 1, 2, '', '', '', 0, 0, 1, '', '', '', 1, 1, 1);
INSERT INTO `categorys` VALUES (5, 'Cocina', 'cocina', 'cocina', '', 2, 2, '', '', '', 0, 0, 1, '', '', '', 1, 1, 1);
INSERT INTO `categorys` VALUES (6, 'Oficina', 'oficina', 'oficina', '', 3, 2, '', '', '', 0, 0, 1, '', '', '', 1, 1, 1);
INSERT INTO `categorys` VALUES (7, 'Tecnología', 'tecnologia', 'tecnologia', '', 4, 2, '', '', '', 0, 0, 1, '', '', '', 1, 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for categorys_files
-- ----------------------------
CREATE TABLE `categorys_files` (
  `cat_file_file_id` int NOT NULL COMMENT 'ID de file file',
  `cat_file_cat_id` int NOT NULL COMMENT 'ID de file cat',
  `cat_file_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`cat_file_file_id`,`cat_file_cat_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of categorys_files
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for contents
-- ----------------------------
CREATE TABLE `contents` (
  `cont_id` int NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del registro',
  `cont_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de cont title',
  `cont_pathurl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Ruta URL del recurso',
  `cont_summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de cont summary',
  `cont_tags` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cont tags',
  `cont_img` int DEFAULT NULL COMMENT 'Valor de cont img',
  `cont_body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de cont body',
  `cont_author` int DEFAULT NULL COMMENT 'Valor de cont author',
  `cont_register_date` datetime DEFAULT NULL COMMENT 'Fecha de registro',
  `cont_user_id` int DEFAULT NULL COMMENT 'user register',
  `cont_notitle` int DEFAULT '0' COMMENT 'Valor de cont notitle',
  `cont_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta URL del recurso',
  `cont_btn_title` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cont btn title',
  `cont_icon` varchar(21) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cont icon',
  `cont_target` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '_blank' COMMENT 'Valor de cont target',
  `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 COMMENT 'Datos adicionales en formato JSON',
  `cont_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`cont_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of contents
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for contents_categorys
-- ----------------------------
CREATE TABLE `contents_categorys` (
  `cont_cat_cont_id` int NOT NULL COMMENT 'ID de cat cont',
  `cont_cat_cat_id` int NOT NULL COMMENT 'ID de cat cat',
  `cont_cat_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `cont_cat_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`cont_cat_cont_id`,`cont_cat_cat_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of contents_categorys
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for contents_files
-- ----------------------------
CREATE TABLE `contents_files` (
  `cont_file_cont_id` int NOT NULL COMMENT 'ID de file cont',
  `cont_file_file_id` int NOT NULL COMMENT 'ID de file file',
  `cont_file_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de cont file title',
  `cont_file_summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de cont file summary',
  `cont_file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Ruta URL del recurso',
  `cont_file_btn_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cont file btn title',
  `cont_file_icon` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de cont file icon',
  `cont_file_target` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '_blank' COMMENT 'Valor de cont file target',
  `cont_file_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`cont_file_cont_id`,`cont_file_file_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of contents_files
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for contents_pubs
-- ----------------------------
CREATE TABLE `contents_pubs` (
  `cont_pub_cont_id` int NOT NULL COMMENT 'ID de pub cont',
  `cont_pub_pub_id` int NOT NULL COMMENT 'ID de pub pub',
  `cont_pub_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`cont_pub_cont_id`,`cont_pub_pub_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of contents_pubs
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for docs
-- ----------------------------
CREATE TABLE `docs` (
  `doc_id` int NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del registro',
  `doc_file_id` int DEFAULT NULL COMMENT 'ID de file',
  `doc_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de doc title',
  `doc_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `doc_tags` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de doc tags',
  `doc_img` int NOT NULL DEFAULT '0' COMMENT 'customized',
  `doc_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `doc_register_date` datetime DEFAULT NULL COMMENT 'Fecha de registro',
  `doc_user_id` int NOT NULL DEFAULT '0' COMMENT 'ID del usuario',
  `doc_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `doc_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `doc_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`doc_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of docs
-- ----------------------------
BEGIN;
INSERT INTO `docs` VALUES (1, 26, 'prueba', 'sdasdd', '', 0, '2026-04-21 01:15:00', '2026-04-20 21:26:23', 1, '', 1, 1);
INSERT INTO `docs` VALUES (2, 28, 'Avance Farmaline A 15 De Agosto', '', '', 0, '2026-04-21 01:42:00', '2026-04-20 21:43:14', 1, '', 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for docs_categorys
-- ----------------------------
CREATE TABLE `docs_categorys` (
  `doc_cat_doc_id` int NOT NULL COMMENT 'ID de cat doc',
  `doc_cat_cat_id` int NOT NULL COMMENT 'ID de cat cat',
  `doc_cat_order` int NOT NULL COMMENT 'Orden de visualización',
  `doc_cat_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  PRIMARY KEY (`doc_cat_doc_id`,`doc_cat_cat_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of docs_categorys
-- ----------------------------
BEGIN;
INSERT INTO `docs_categorys` VALUES (1, 2, 0, 1);
INSERT INTO `docs_categorys` VALUES (2, 4, 0, 1);
COMMIT;

-- ----------------------------
-- Records of entities
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for files
-- ----------------------------
CREATE TABLE `files` (
  `file_id` int NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del registro',
  `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `file_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `file_pathurl` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta URL del recurso',
  `file_embed` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de file embed',
  `file_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de file title',
  `file_btn_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de file btn title',
  `file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta URL del recurso',
  `file_target` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '_self' COMMENT 'Valor de file target',
  `file_ext` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de file ext',
  `file_alt` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de file alt',
  `file_filename_md5` binary(255) DEFAULT NULL COMMENT 'Valor de file filename md5',
  `file_datatime` datetime DEFAULT NULL COMMENT 'Valor de file datatime',
  `file_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `file_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`file_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of files
-- ----------------------------
BEGIN;
INSERT INTO `files` VALUES (2, 'logo-wappcom_20251129_2333', '', 'files/sliders/logo-wappcom_20251129_2333.png', NULL, NULL, NULL, NULL, '_self', 'png', NULL, 0x323165633862343032343730363662353766343763343836356631353939623100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-11-29 23:33:02', 1, 1);
INSERT INTO `files` VALUES (3, 'link', '', 'files/sliders/link.png', NULL, NULL, NULL, NULL, '_self', 'png', NULL, 0x326133303461313334383435366363643232333463643731613831626433333800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-11-30 16:18:54', 1, 1);
INSERT INTO `files` VALUES (4, 'el_dia_29_12_2025-', '', 'files/docs/el_dia_29_12_2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x383266643135373839303930613435366435303365366534393837323838666200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 11:21:35', 1, 1);
INSERT INTO `files` VALUES (5, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 11:27:50', 1, 1);
INSERT INTO `files` VALUES (6, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 11:48:08', 1, 1);
INSERT INTO `files` VALUES (7, 'documento-fintech-3-', '', 'files/docs/documento-fintech-3-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x303338303239343535303434613065336363336461303434326433646461666500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 11:54:56', 1, 1);
INSERT INTO `files` VALUES (8, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:11:11', 1, 1);
INSERT INTO `files` VALUES (9, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:18:18', 1, 1);
INSERT INTO `files` VALUES (10, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:23:14', 1, 1);
INSERT INTO `files` VALUES (11, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:33:04', 1, 1);
INSERT INTO `files` VALUES (12, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:41:29', 1, 1);
INSERT INTO `files` VALUES (13, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:43:32', 1, 1);
INSERT INTO `files` VALUES (14, 'documento-fintech-3-', '', 'files/docs/documento-fintech-3-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x303338303239343535303434613065336363336461303434326433646461666500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:45:41', 1, 1);
INSERT INTO `files` VALUES (15, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:47:57', 1, 1);
INSERT INTO `files` VALUES (16, 'el-dia-29-12-2025-', '', 'files/docs/el-dia-29-12-2025-.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x623034623637313865343461333431363134303432356363383338356433356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:50:51', 1, 1);
INSERT INTO `files` VALUES (17, 'el-dia-29-12-2025', '', 'files/docs/el-dia-29-12-2025.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x626261336562373231373237656335303437663535666564353462656430333400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2025-12-29 12:52:57', 1, 1);
INSERT INTO `files` VALUES (18, 'ci-hermany-2', '', 'files/posts/2026-01-09/ci-hermany-2.jpg', NULL, NULL, NULL, NULL, '_self', 'jpeg', NULL, 0x303065653837623336616437326161653236383236666531353434623663343800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-01-09 10:00:35', 1, 1);
INSERT INTO `files` VALUES (19, 'contrato-11', NULL, 'files/files/rems/documents/contrato-11.pdf', NULL, NULL, NULL, NULL, '_self', 'pdf', NULL, 0x626662666635633735313036306331386134313732643735376662363836633600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-04-07 21:56:49', 1, 1);
INSERT INTO `files` VALUES (20, '15a38c3d37b838f7aac813e9a81ad32100bd6709bcadb678b91a67736d00a39c', NULL, 'files/contacts/15a38c3d37b838f7aac813e9a81ad32100bd6709bcadb678b91a67736d00a39c.jpg', NULL, NULL, NULL, NULL, '_self', 'jpeg', NULL, 0x333264656335316230396632316561306565363532383730376134373262323700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-04-19 11:37:35', 1, 1);
INSERT INTO `files` VALUES (21, '922af8a0-edb1-4627-b69c-b316627f42dd', NULL, 'files/contacts/922af8a0-edb1-4627-b69c-b316627f42dd.jpeg', NULL, NULL, NULL, NULL, '_self', 'jpeg', NULL, 0x363463383962613533323066346565643065373063616262613536373139626100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-04-19 13:24:53', 1, 1);
INSERT INTO `files` VALUES (23, '1696414230540', NULL, 'files/enterprise/1696414230540.jpeg', NULL, NULL, NULL, NULL, '_self', 'jpeg', NULL, 0x306335383966316439333239343366663732653730633665343130643236346500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-04-19 14:32:23', 1, 1);
INSERT INTO `files` VALUES (24, '1380x634-rbp-es-ff-desktop-explorer-m224270-0001-static-jpeg', NULL, 'files/media/1380x634-rbp-es-ff-desktop-explorer-m224270-0001-static-jpeg.jpg', NULL, NULL, NULL, NULL, '_self', 'jpeg', NULL, 0x373539643537383036363130333436326164626531363237636164343339356100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-04-19 14:54:48', 1, 1);
INSERT INTO `files` VALUES (25, '1380x634-watches-family-2024', NULL, 'files/websites/media/1380x634-watches-family-2024.jpg', NULL, NULL, NULL, NULL, '_self', 'jpeg', NULL, 0x346161396632306537383466616562366666363165616231656564623934633200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-04-20 20:30:22', 1, 1);
INSERT INTO `files` VALUES (26, 'copy-servicing-your-rolex-en', NULL, 'files/websites/docs/copy-servicing-your-rolex-en.docx', NULL, NULL, NULL, NULL, '_self', 'docx', NULL, 0x623162336431316235346162396363323565376166373334326332306166626200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-04-20 21:16:51', 1, 1);
INSERT INTO `files` VALUES (27, 'suggestedretailprices-bo-4-1', NULL, 'files/websites/docs/suggestedretailprices-bo-4-1.xlsx', NULL, NULL, NULL, NULL, '_self', 'xls', NULL, 0x333539373963376132326138383138653137633535353365333462663439396100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-04-20 21:40:46', 1, 1);
INSERT INTO `files` VALUES (28, 'avance-farmaline-a-15-de-agosto', NULL, 'files/websites/docs/avance-farmaline-a-15-de-agosto.xlsx', NULL, NULL, NULL, NULL, '_self', 'xls', NULL, 0x363736633733633964633531623864313466303232663964363261616133326400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, '2026-04-20 21:43:03', 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for forms
-- ----------------------------
CREATE TABLE `forms` (
  `form_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del formulario',
  `form_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Título del formulario',
  `form_slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Slug/identificador legible',
  `form_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del formulario',
  `form_settings` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'JSON/text con opciones: confirmation, notifications, redirect, etc',
  `form_notify_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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)',
  PRIMARY KEY (`form_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Definición de Formularios (Maestro)';

-- ----------------------------
-- Records of forms
-- ----------------------------
BEGIN;
INSERT INTO `forms` 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);
COMMIT;

-- ----------------------------
-- Table structure for forms_entries
-- ----------------------------
CREATE TABLE `forms_entries` (
  `form_entry_id` bigint unsigned NOT NULL AUTO_INCREMENT 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'IP del remitente',
  `form_entry_user_id` bigint unsigned DEFAULT NULL COMMENT 'Usuario asociado (si aplica)',
  `form_entry_meta` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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)',
  PRIMARY KEY (`form_entry_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Entradas/Envios generados por los formularios';

-- ----------------------------
-- Records of forms_entries
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for forms_fields
-- ----------------------------
CREATE TABLE `forms_fields` (
  `form_fld_id` bigint unsigned NOT NULL AUTO_INCREMENT 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre interno del campo (ej: email)',
  `form_fld_label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Etiqueta visible para UI',
  `form_fld_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'text' COMMENT 'Tipo de campo (text, textarea, email, select, checkbox, file, etc)',
  `form_fld_options` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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)',
  PRIMARY KEY (`form_fld_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Campos pertenecientes a cada formulario';

-- ----------------------------
-- Records of forms_fields
-- ----------------------------
BEGIN;
INSERT INTO `forms_fields` 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);
INSERT INTO `forms_fields` VALUES (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);
INSERT INTO `forms_fields` VALUES (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);
INSERT INTO `forms_fields` VALUES (4, 1, NULL, 1, 'attachment', 'Adjunto', 'file', NULL, 0, 4, NULL, '2025-12-09 19:12:13', '2025-12-09 19:12:13', 1);
COMMIT;

-- ----------------------------
-- Table structure for 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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del campo al que pertenece el archivo',
  `form_file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre original del archivo',
  `form_file_size` int DEFAULT NULL COMMENT 'Tamaño en bytes',
  `form_file_mime` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Tipo MIME',
  PRIMARY KEY (`form_file_entry_id`,`form_file_file_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Mapeo de archivos subidos por entrada';

-- ----------------------------
-- Records of forms_files
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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 CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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)',
  PRIMARY KEY (`form_val_entry_id`,`form_val_field_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Valores por campo de cada entrada (EAV simple)';

-- ----------------------------
-- Records of forms_values
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for groups
-- ----------------------------
CREATE TABLE `groups` (
  `group_id` int NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del registro',
  `group_ent_id` int DEFAULT '1' COMMENT 'ID de la entidad/empresa',
  `group_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del grupo',
  `group_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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',
  PRIMARY KEY (`group_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Grupos de usuarios y archivos';

-- ----------------------------
-- Records of groups
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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',
  PRIMARY KEY (`group_file_group_id`,`group_file_file_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Asignación de archivos a grupos';

-- ----------------------------
-- Records of groups_files
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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',
  PRIMARY KEY (`group_user_group_id`,`group_user_user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Asignación de usuarios a grupos';

-- ----------------------------
-- Records of groups_users
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for links
-- ----------------------------
CREATE TABLE `links` (
  `lnk_id` int NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del registro',
  `lnk_title` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de lnk title',
  `lnk_description` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `lnk_tags` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de lnk tags',
  `lnk_url` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '#' COMMENT 'Ruta URL del recurso',
  `lnk_target` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '_blank' COMMENT 'Valor de lnk target',
  `lnk_icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de lnk icon',
  `lnk_attr` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de lnk attr',
  `lnk_cls` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de lnk cls',
  `lnk_alt` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de lnk alt',
  `lnk_img` int DEFAULT NULL COMMENT 'Valor de lnk img',
  `lnk_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `lnk_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `lnk_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`lnk_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of links
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for links_categorys
-- ----------------------------
CREATE TABLE `links_categorys` (
  `lnk_cat_cat_id` int NOT NULL COMMENT 'ID de cat cat',
  `lnk_cat_lnk_id` int NOT NULL COMMENT 'ID de cat lnk',
  `lnk_cat_order` int DEFAULT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`lnk_cat_cat_id`,`lnk_cat_lnk_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of links_categorys
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for links_pubs
-- ----------------------------
CREATE TABLE `links_pubs` (
  `lnk_pub_pub_id` int NOT NULL COMMENT 'ID de pub pub',
  `lnk_pub_lnk_id` int NOT NULL COMMENT 'ID de pub lnk',
  `lnk_pub_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`lnk_pub_pub_id`,`lnk_pub_lnk_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of links_pubs
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for media_categorys
-- ----------------------------
CREATE TABLE `media_categorys` (
  `media_cat_file_id` int NOT NULL COMMENT 'ID de cat file',
  `media_cat_cat_id` int NOT NULL COMMENT 'ID de cat cat',
  `media_cat_order` int NOT NULL COMMENT 'Orden de visualización',
  `media_cat_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de media cat title',
  `media_cat_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `media_cat_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  PRIMARY KEY (`media_cat_file_id`,`media_cat_cat_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of media_categorys
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for menus
-- ----------------------------
CREATE TABLE `menus` (
  `menu_id` int NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del registro',
  `menu_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del menú',
  `menu_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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',
  PRIMARY KEY (`menu_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Menús principales del sistema';

-- ----------------------------
-- Records of menus
-- ----------------------------
BEGIN;
INSERT INTO `menus` 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');
INSERT INTO `menus` VALUES (2, 'pie de pagina', '', NULL, 1, 1, '2025-12-08 23:10:52', '2025-12-08 23:10:52');
COMMIT;

-- ----------------------------
-- Table structure for menus_items
-- ----------------------------
CREATE TABLE `menus_items` (
  `menu_item_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de item',
  `menu_item_menu_id` int NOT NULL COMMENT 'ID del menú al que pertenece',
  `menu_item_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Etiqueta de navegación',
  `menu_item_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del item',
  `menu_item_pathurl` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'URL del enlace',
  `menu_item_target` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Clase del icono o URL de imagen',
  `menu_item_img` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'URL de imagen (alternativa al icono)',
  `menu_item_html_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ID HTML personalizado',
  `menu_item_css_class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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 CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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',
  PRIMARY KEY (`menu_item_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=253 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Items de menú con soporte jerárquico';

-- ----------------------------
-- Records of menus_items
-- ----------------------------
BEGIN;
INSERT INTO `menus_items` 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');
INSERT INTO `menus_items` VALUES (236, 1, '', NULL, '', '_self', 0, 0, 1, '', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46');
INSERT INTO `menus_items` VALUES (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');
INSERT INTO `menus_items` VALUES (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');
INSERT INTO `menus_items` VALUES (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');
INSERT INTO `menus_items` VALUES (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');
INSERT INTO `menus_items` VALUES (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');
INSERT INTO `menus_items` VALUES (242, 1, 'prueba menu', NULL, '', '_self', 0, 0, 7, '', '', '', '', NULL, 0, '', 1, '2025-12-08 22:56:46', '2025-12-08 22:56:46');
INSERT INTO `menus_items` VALUES (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');
INSERT INTO `menus_items` VALUES (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');
INSERT INTO `menus_items` VALUES (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');
INSERT INTO `menus_items` VALUES (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');
INSERT INTO `menus_items` VALUES (250, 2, 'prueba 2', NULL, '', '_self', 0, 0, 0, '', '', '', '', NULL, 0, '', 1, '2025-12-08 23:11:01', '2025-12-08 23:11:01');
INSERT INTO `menus_items` VALUES (251, 2, 'About Us', NULL, '', '_self', 250, 1, 1, '', '', '', '', NULL, 0, '', 1, '2025-12-08 23:11:01', '2025-12-08 23:11:01');
INSERT INTO `menus_items` VALUES (252, 2, 'Books', NULL, '', '_self', 251, 2, 2, '', '', '', '', NULL, 0, '', 1, '2025-12-08 23:11:01', '2025-12-08 23:11:01');
COMMIT;

-- ----------------------------
-- Table structure for mod_accounting_plan
-- ----------------------------
CREATE TABLE `mod_accounting_plan` (
  `mod_acp_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de acp',
  `mod_acp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_acp_descripcion` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod acp descripcion',
  `mod_acp_parent_id` int DEFAULT NULL COMMENT 'ID de acp parent',
  `mod_acp_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_acp_level` int DEFAULT NULL COMMENT 'Valor de mod acp level',
  `mod_acp_coin` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod acp coin',
  `mod_acp_has_referral_code` int NOT NULL DEFAULT '0' COMMENT 'tiene codigo de referido',
  `mod_acp_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_acp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_accounting_plan
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_accounts_addresses
-- ----------------------------
CREATE TABLE `mod_accounts_addresses` (
  `mod_acu_add_acu_id` int NOT NULL COMMENT 'ID de acu add acu',
  `mod_acu_add_add_id` int NOT NULL COMMENT 'ID de acu add add',
  `mod_acu_add_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_acu_add_acu_id`,`mod_acu_add_add_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_accounts_addresses
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_accounts_ads
-- ----------------------------
CREATE TABLE `mod_accounts_ads` (
  `mod_aca_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de mod_accounts_ads',
  `mod_aca_cen_id` int NOT NULL COMMENT 'ID de aca cen',
  `mod_aca_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_aca_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `mod_aca_code` int DEFAULT NULL COMMENT 'Código interno',
  `mod_aca_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_aca_state` int DEFAULT NULL COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_aca_id`,`mod_aca_cen_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_accounts_ads
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_accounts_invoices_data
-- ----------------------------
CREATE TABLE `mod_accounts_invoices_data` (
  `mod_acu_invd_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de acu invd',
  `mod_acu_invd_acu_id` int NOT NULL COMMENT 'ID de acu invd acu',
  `mod_acu_invd_razon_social` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod acu invd razon social',
  `mod_acu_invd_nit` int NOT NULL COMMENT 'Valor de mod acu invd nit',
  `mod_acu_invd_order` int NOT NULL COMMENT 'Orden de visualización',
  `mod_acu_invd_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_acu_invd_id`,`mod_acu_invd_acu_id`,`mod_acu_invd_nit`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_accounts_invoices_data
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_accounts_plans
-- ----------------------------
CREATE TABLE `mod_accounts_plans` (
  `mod_ap_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de ap',
  `mod_ap_name` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_ap_description` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_ap_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_ap_level` int DEFAULT NULL COMMENT 'Valor de mod ap level',
  `mod_ap_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod ap details',
  `mod_ap_cost` decimal(10,2) DEFAULT NULL COMMENT 'Valor de mod ap cost',
  `mod_ap_coin` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Bs' COMMENT 'Valor de mod ap coin',
  `mod_ap_mode` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'monthly' COMMENT 'Valor de mod ap mode',
  `mod_ap_last` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod ap last',
  `mod_ap_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_ap_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_ap_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_ap_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_accounts_plans
-- ----------------------------
BEGIN;
INSERT INTO `mod_accounts_plans` 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);
INSERT INTO `mod_accounts_plans` VALUES (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);
INSERT INTO `mod_accounts_plans` VALUES (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);
INSERT INTO `mod_accounts_plans` VALUES (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);
INSERT INTO `mod_accounts_plans` VALUES (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);
INSERT INTO `mod_accounts_plans` VALUES (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);
COMMIT;

-- ----------------------------
-- Table structure for mod_accounts_roles
-- ----------------------------
CREATE TABLE `mod_accounts_roles` (
  `mod_acu_rol_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de acu rol',
  `mod_acu_rol_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_acu_rol_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_acu_rol_parent_id` int DEFAULT NULL COMMENT 'ID de acu rol parent',
  `mod_acu_rol_redirection_url` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta URL del recurso',
  `mod_acu_rol_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_acu_rol_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_acu_rol_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_accounts_roles
-- ----------------------------
BEGIN;
INSERT INTO `mod_accounts_roles` VALUES (1, 'temp', NULL, 0, NULL, NULL, 1);
INSERT INTO `mod_accounts_roles` VALUES (2, 'suscriptor', NULL, 0, NULL, NULL, 0);
COMMIT;

-- ----------------------------
-- Table structure for mod_accounts_services
-- ----------------------------
CREATE TABLE `mod_accounts_services` (
  `mod_acu_sv_sv_id` int NOT NULL COMMENT 'ID de acu sv sv',
  `mod_acu_sv_acu_id` int NOT NULL COMMENT 'ID de acu sv acu',
  `mod_acu_sv_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_acu_sv_sv_id`,`mod_acu_sv_acu_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_accounts_services
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Records of mod_accounts_token
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Records of mod_accounts_users
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_accounts_users_plans
-- ----------------------------
CREATE TABLE `mod_accounts_users_plans` (
  `mod_acu_ap_acu_id` int NOT NULL COMMENT 'ID de acu ap acu',
  `mod_acu_ap_ap_id` int NOT NULL COMMENT 'ID de acu ap ap',
  `mod_acu_ap_mode` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod acu ap mode',
  `mod_acu_ap_date_register` datetime NOT NULL COMMENT 'Valor de mod acu ap date register',
  PRIMARY KEY (`mod_acu_ap_acu_id`,`mod_acu_ap_ap_id`,`mod_acu_ap_mode`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_accounts_users_plans
-- ----------------------------
BEGIN;
INSERT INTO `mod_accounts_users_plans` VALUES (1, 2, '', '2025-04-09 20:23:38');
COMMIT;

-- ----------------------------
-- Table structure for mod_accounts_users_roles
-- ----------------------------
CREATE TABLE `mod_accounts_users_roles` (
  `mod_acu_user_rol_acu_id` int NOT NULL COMMENT 'ID de acu user rol acu',
  `mod_acu_user_rol_rol_id` int NOT NULL COMMENT 'ID de acu user rol rol',
  `mod_acu_user_rol_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `mod_acu_user_rol_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_acu_user_rol_acu_id`,`mod_acu_user_rol_rol_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_accounts_users_roles
-- ----------------------------
BEGIN;
INSERT INTO `mod_accounts_users_roles` VALUES (0, 1, 1, 0);
INSERT INTO `mod_accounts_users_roles` VALUES (1, 1, 1, 0);
INSERT INTO `mod_accounts_users_roles` VALUES (3, 1, 1, 0);
INSERT INTO `mod_accounts_users_roles` VALUES (4, 1, 1, 0);
COMMIT;

-- ----------------------------
-- Table structure for mod_actions
-- ----------------------------
CREATE TABLE `mod_actions` (
  `mod_act_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de act',
  `mod_act_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_act_summary` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod act summary',
  `mod_act_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Ruta del recurso',
  `mod_act_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_act_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_actions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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 COMMENT 'Valor de mod act reg value',
  `mod_act_reg_register_date` datetime NOT NULL COMMENT 'Fecha de registro',
  `mod_act_reg_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  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
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_actions_register
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_acuse
-- ----------------------------
CREATE TABLE `mod_acuse` (
  `mod_ac_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de ac',
  `mod_ac_date` datetime NOT NULL COMMENT 'Fecha del registro',
  `mod_ac_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Correo electrónico',
  PRIMARY KEY (`mod_ac_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_acuse
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_addresses
-- ----------------------------
CREATE TABLE `mod_addresses` (
  `mod_add_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de add',
  `mod_add_name` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_add_alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod add alias',
  `mod_add_description` varchar(700) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_add_coord` varchar(700) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod add coord',
  `mod_add_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_add_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_addresses
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_addresses_logistics_distribution_zone
-- ----------------------------
CREATE TABLE `mod_addresses_logistics_distribution_zone` (
  `mod_add_ldz_add_id` int NOT NULL COMMENT 'ID de add ldz add',
  `mod_add_ldz_ldz_id` int NOT NULL COMMENT 'ID de add ldz ldz',
  `mod_add_ldz_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_add_ldz_add_id`,`mod_add_ldz_ldz_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_addresses_logistics_distribution_zone
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ads
-- ----------------------------
CREATE TABLE `mod_ads` (
  `mod_ads_id` int NOT NULL AUTO_INCREMENT 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 COMMENT 'Código interno',
  `mod_ads_attribute` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod ads attribute',
  `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 COMMENT 'Fecha del registro',
  `mod_ads_end_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_ads_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del anuncio (0: inactivo, 1: activo)',
  PRIMARY KEY (`mod_ads_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ads
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ads_campaigns
-- ----------------------------
CREATE TABLE `mod_ads_campaigns` (
  `mod_ads_campaign_id` int NOT NULL AUTO_INCREMENT 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` datetime 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',
  PRIMARY KEY (`mod_ads_campaign_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ads_campaigns
-- ----------------------------
BEGIN;
INSERT INTO `mod_ads_campaigns` 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);
COMMIT;

-- ----------------------------
-- Table structure for mod_ads_devices
-- ----------------------------
CREATE TABLE `mod_ads_devices` (
  `mod_ads_device_id` int NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_ads_device_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ads_devices
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ads_display
-- ----------------------------
CREATE TABLE `mod_ads_display` (
  `mod_ads_dsp_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de ads dsp',
  `mod_ads_dsp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_ads_dsp_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `mod_ads_dsp_site_id` int DEFAULT NULL COMMENT 'ID del sitio',
  `mod_ads_dsp_pub_id` int DEFAULT NULL COMMENT 'ID de ads dsp pub',
  `mod_ads_dsp_file_id` int DEFAULT NULL COMMENT 'ID de ads dsp file',
  `mod_ads_dsp_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `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' COMMENT 'Estado del registro',
  `mod_ads_dsp_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  PRIMARY KEY (`mod_ads_dsp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ads_display
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ads_display_files
-- ----------------------------
CREATE TABLE `mod_ads_display_files` (
  `mod_ads_dsp_file_dsp_id` int NOT NULL COMMENT 'ID de ads dsp file dsp',
  `mod_ads_dsp_file_file_id` int NOT NULL COMMENT 'ID de ads dsp file file',
  `mod_ads_dsp_file_order` int DEFAULT '1' COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_ads_dsp_file_dsp_id`,`mod_ads_dsp_file_file_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ads_display_files
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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_id` int NOT NULL,
  `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',
  `id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ads_displays
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ads_locations
-- ----------------------------
CREATE TABLE `mod_ads_locations` (
  `mod_ads_location_id` int NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_ads_location_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ads_locations
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ads_performance_metrics
-- ----------------------------
CREATE TABLE `mod_ads_performance_metrics` (
  `mod_ads_metric_id` int NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_ads_metric_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ads_performance_metrics
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ads_types
-- ----------------------------
CREATE TABLE `mod_ads_types` (
  `mod_ads_type_id` int NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_ads_type_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ads_types
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_calendars
-- ----------------------------
CREATE TABLE `mod_advised_calendars` (
  `mod_adv_cal_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de adv cal',
  `mod_adv_cal_acu_id` int DEFAULT NULL COMMENT 'ID de adv cal acu',
  `mod_adv_cal_cou_id` int DEFAULT NULL COMMENT 'ID de adv cal cou',
  `mod_adv_cal_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'appointment' COMMENT 'Tipo de registro',
  `mod_adv_cal_date_start` datetime DEFAULT NULL COMMENT 'Valor de mod adv cal date start',
  `mod_adv_cal_date_end` datetime DEFAULT NULL COMMENT 'Valor de mod adv cal date end',
  `mod_adv_cal_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv cal title',
  `mod_adv_cal_details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod adv cal details',
  `mod_adv_cal_place` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv cal place',
  `mod_adv_cal_reason_cancel` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv cal reason cancel',
  `mod_adv_cal_reschedule` int DEFAULT NULL COMMENT 'Valor de mod adv cal reschedule',
  `mod_adv_cal_flags` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv cal flags',
  `mod_adv_cal_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_adv_cal_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_adv_cal_date_register` datetime DEFAULT NULL COMMENT 'Valor de mod adv cal date register',
  `mod_adv_cal_state` int NOT NULL DEFAULT '0' COMMENT '0. Eliminado, 1. Activo, 2. cancelado, 3. reagendado, 4. Atendido',
  PRIMARY KEY (`mod_adv_cal_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_calendars
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_calendars_blocked
-- ----------------------------
CREATE TABLE `mod_advised_calendars_blocked` (
  `mod_adv_cb_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de adv cb',
  `mod_adv_cb_date_start` datetime NOT NULL COMMENT 'Valor de mod adv cb date start',
  `mod_adv_cb_date_end` datetime DEFAULT NULL COMMENT 'Valor de mod adv cb date end',
  `mod_adv_cb_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_adv_cb_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_adv_cb_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_calendars_blocked
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_counselors
-- ----------------------------
CREATE TABLE `mod_advised_counselors` (
  `mod_adv_cou_acu_id` int NOT NULL COMMENT 'ID de adv cou acu',
  `mod_adv_cou_cou_id` int NOT NULL COMMENT 'ID de adv cou cou',
  `mod_adv_cou_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_adv_cou_acu_id`,`mod_adv_cou_cou_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_counselors
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_counselors_fields
-- ----------------------------
CREATE TABLE `mod_advised_counselors_fields` (
  `mod_adv_fds_user_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID del usuario',
  `mod_adv_fds_fds_id` int NOT NULL COMMENT 'ID de adv fds fds',
  `mod_adv_fds_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_adv_fds_user_id`,`mod_adv_fds_fds_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_counselors_fields
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_history
-- ----------------------------
CREATE TABLE `mod_advised_history` (
  `mod_adv_his_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de adv his',
  `mod_adv_his_acu_id` int DEFAULT NULL COMMENT 'ID de adv his acu',
  `mod_adv_his_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_adv_his_fds_id` int DEFAULT NULL COMMENT 'ID de adv his fds',
  `mod_adv_his_comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod adv his comments',
  `mod_adv_his_date_registration` datetime DEFAULT NULL COMMENT 'Valor de mod adv his date registration',
  `mod_adv_his_date_init` datetime DEFAULT NULL COMMENT 'Valor de mod adv his date init',
  `mod_adv_his_date_end` datetime DEFAULT NULL COMMENT 'Valor de mod adv his date end',
  `mod_adv_his_place` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv his place',
  `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' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_adv_his_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_history
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_history_calendars
-- ----------------------------
CREATE TABLE `mod_advised_history_calendars` (
  `mod_adv_his_cal_cal_id` int NOT NULL COMMENT 'ID de adv his cal cal',
  `mod_adv_his_cal_his_id` int NOT NULL COMMENT 'ID de adv his cal his',
  `mod_adv_his_cal_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_adv_his_cal_cal_id`,`mod_adv_his_cal_his_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_history_calendars
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_options
-- ----------------------------
CREATE TABLE `mod_advised_options` (
  `mod_adv_opt_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de adv opt',
  `mod_adv_opt_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_adv_opt_value` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod adv opt value',
  `mod_adv_opt_autoload` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'yes' COMMENT 'Valor de mod adv opt autoload',
  PRIMARY KEY (`mod_adv_opt_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_options
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_schedules
-- ----------------------------
CREATE TABLE `mod_advised_schedules` (
  `mod_adv_sch_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de adv sch',
  `mod_adv_sch_cou_id` int NOT NULL COMMENT 'ID de adv sch cou',
  `mod_adv_sch_day` int NOT NULL COMMENT 'Valor de mod adv sch day',
  `mod_adv_sch_hour_start` time NOT NULL COMMENT 'Valor de mod adv sch hour start',
  `mod_adv_sch_hour_end` time NOT NULL COMMENT 'Valor de mod adv sch hour end',
  `mod_adv_sch_count` int NOT NULL COMMENT 'Valor de mod adv sch count',
  `mod_adv_sch_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_adv_sch_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_schedules
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_types_appointments
-- ----------------------------
CREATE TABLE `mod_advised_types_appointments` (
  `mod_adv_tya_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de adv tya',
  `mod_adv_tya_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_adv_tya_summary` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv tya summary',
  `mod_adv_tya_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Tipo de registro',
  `mod_adv_tya_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta del recurso',
  `mod_adv_tya_color` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv tya color',
  `mod_adv_tya_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_adv_tya_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_adv_tya_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_adv_tya_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_types_appointments
-- ----------------------------
BEGIN;
INSERT INTO `mod_advised_types_appointments` VALUES (1, 'Consejeria', NULL, NULL, NULL, NULL, '{\r\n \"listUsers\",\"selectDay\"\r\n}', 1, 1);
INSERT INTO `mod_advised_types_appointments` VALUES (2, 'Otra Actividad', NULL, NULL, NULL, NULL, '{\r\n \"title\",\"selectDates\"\r\n}', 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for mod_advised_user
-- ----------------------------
CREATE TABLE `mod_advised_user` (
  `mod_adv_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de adv',
  `mod_adv_fullname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod adv fullname',
  `mod_adv_comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod adv comments',
  `mod_adv_acu_id` int DEFAULT NULL COMMENT 'ID de adv acu',
  `mod_adv_fds_id` int DEFAULT NULL COMMENT 'ID de adv fds',
  `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 COMMENT 'Valor de mod adv dependents',
  `mod_adv_telf_fax` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv telf fax',
  `mod_adv_address` varchar(550) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv address',
  `mod_adv_coordinates` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv coordinates',
  `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 COMMENT 'Valor de mod adv company work',
  `mod_adv_address_work` varchar(550) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv address work',
  `mod_adv_work_area` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv work area',
  `mod_adv_profession` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv profession',
  `mod_adv_position` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv position',
  `mod_adv_spouse_fullname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse fullname',
  `mod_adv_spouse_gender` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse gender',
  `mod_adv_spouse_ci` int DEFAULT NULL COMMENT 'Valor de mod adv spouse ci',
  `mod_adv_spouse_ext` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse ext',
  `mod_adv_spouse_birthday` date DEFAULT NULL COMMENT 'Valor de mod adv spouse birthday',
  `mod_adv_spouse_nationality` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse nationality',
  `mod_adv_spouse_telf_fax` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse telf fax',
  `mod_adv_spouse_cellphone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse cellphone',
  `mod_adv_spouse_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Correo electrónico',
  `mod_adv_spouse_labor_status` int DEFAULT NULL COMMENT 'Estado del proceso',
  `mod_adv_spouse_company_work` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse company work',
  `mod_adv_spouse_address_work` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse address work',
  `mod_adv_spouse_work_area` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse work area',
  `mod_adv_spouse_profession` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse profession',
  `mod_adv_spouse_position` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod adv spouse position',
  PRIMARY KEY (`mod_adv_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_advised_user
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_appointments_calendars
-- ----------------------------
CREATE TABLE `mod_appointments_calendars` (
  `mod_apt_cal_id` int NOT NULL AUTO_INCREMENT 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 COMMENT 'Valor de mod apt cal date start',
  `mod_apt_cal_date_end` datetime DEFAULT NULL COMMENT 'Valor de mod apt cal date end',
  `mod_apt_cal_reschedule` int DEFAULT NULL COMMENT 'Valor de mod apt cal reschedule',
  `mod_apt_cal_reason_cancel` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod apt cal reason cancel',
  `mod_apt_cal_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod apt cal title',
  `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 COMMENT 'ID de la entidad',
  `mod_apt_cal_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `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)',
  PRIMARY KEY (`mod_apt_cal_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_appointments_calendars
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_appointments_calendars_blocked
-- ----------------------------
CREATE TABLE `mod_appointments_calendars_blocked` (
  `mod_apt_cb_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de apt cb',
  `mod_apt_cb_date_start` datetime NOT NULL COMMENT 'Valor de mod apt cb date start',
  `mod_apt_cb_date_end` datetime DEFAULT NULL COMMENT 'Valor de mod apt cb date end',
  `mod_apt_cb_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_apt_cb_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_apt_cb_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_appointments_calendars_blocked
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_appointments_exceptions
-- ----------------------------
CREATE TABLE `mod_appointments_exceptions` (
  `mod_apt_exc_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de apt exc',
  `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',
  PRIMARY KEY (`mod_apt_exc_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_appointments_exceptions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_appointments_logs
-- ----------------------------
CREATE TABLE `mod_appointments_logs` (
  `mod_apt_log_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de apt log',
  `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',
  PRIMARY KEY (`mod_apt_log_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_appointments_logs
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_appointments_options
-- ----------------------------
CREATE TABLE `mod_appointments_options` (
  `mod_apt_opt_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de apt opt',
  `mod_apt_opt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_apt_opt_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod apt opt value',
  `mod_apt_opt_autoload` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'yes' COMMENT 'Valor de mod apt opt autoload',
  `mod_apt_opt_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_apt_opt_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_appointments_options
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_appointments_payments
-- ----------------------------
CREATE TABLE `mod_appointments_payments` (
  `mod_apt_pay_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id del pago',
  `mod_apt_pay_apt_id` int NOT NULL COMMENT 'ID de apt pay apt',
  `mod_apt_pay_amount` decimal(10,2) NOT NULL COMMENT 'Valor de mod apt pay amount',
  `mod_apt_pay_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha del registro',
  `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' COMMENT 'Estado del proceso',
  `mod_apt_pay_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_apt_pay_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_appointments_payments
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_appointments_reviews
-- ----------------------------
CREATE TABLE `mod_appointments_reviews` (
  `mod_apt_rev_id` int NOT NULL AUTO_INCREMENT 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)',
  PRIMARY KEY (`mod_apt_rev_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_appointments_reviews
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_appointments_schedules
-- ----------------------------
CREATE TABLE `mod_appointments_schedules` (
  `mod_apt_sch_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de apt sch',
  `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',
  PRIMARY KEY (`mod_apt_sch_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_appointments_schedules
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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)',
  PRIMARY KEY (`mod_apt_type_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_appointments_types
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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',
  PRIMARY KEY (`mod_bd_key`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Dimensión de Tiempo (Usada en Fact Tables)';

-- ----------------------------
-- Records of mod_bi_dim_date
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_bi_dim_vendor
-- ----------------------------
CREATE TABLE `mod_bi_dim_vendor` (
  `mod_bv_key` int NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_bv_key`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Dimensión de Vendors (Analytics)';

-- ----------------------------
-- Records of mod_bi_dim_vendor
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_bi_fact_sales
-- ----------------------------
CREATE TABLE `mod_bi_fact_sales` (
  `mod_bfs_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_bfs_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Fact Table para análisis de GMV y Ventas del Marketplace';

-- ----------------------------
-- Records of mod_bi_fact_sales
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_brands
-- ----------------------------
CREATE TABLE `mod_brands` (
  `mod_brd_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de brd',
  `mod_brd_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_brd_img` int DEFAULT NULL COMMENT 'Valor de mod brd img',
  `mod_brd_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_brd_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_brands
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_campaigns_actions
-- ----------------------------
CREATE TABLE `mod_campaigns_actions` (
  `mod_cpa_act_cpa_id` int NOT NULL COMMENT 'ID de cpa act cpa',
  `mod_cpa_act_act_id` int NOT NULL COMMENT 'ID de cpa act act',
  `mod_cpa_act_rew` int DEFAULT NULL COMMENT 'Valor de mod cpa act rew',
  `mod_cpa_act_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_cpa_act_cpa_id`,`mod_cpa_act_act_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_campaigns_actions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_campaigns_ads
-- ----------------------------
CREATE TABLE `mod_campaigns_ads` (
  `mod_cpa_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cpa',
  `mod_cpa_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_cpa_description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `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 COMMENT 'Valor de mod cpa type customer',
  `mod_cpa_cpe_id` int DEFAULT NULL COMMENT 'ID de cpa cpe',
  `mod_cpa_cen_id` int NOT NULL COMMENT 'ID de cpa cen',
  `mod_cpa_target_init_age` int DEFAULT NULL COMMENT 'Valor de mod cpa target init age',
  `mod_cpa_target_end_age` int DEFAULT NULL COMMENT 'Valor de mod cpa target end age',
  `mod_cpa_target_gender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cpa target gender',
  `mod_cpa_init_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_cpa_end_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_cpa_register_date` datetime DEFAULT NULL COMMENT 'Fecha de registro',
  `mod_cpa_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Datos adicionales en formato JSON',
  `mod_cpa_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_cpa_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_campaigns_ads
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_candire_campaigns
-- ----------------------------
CREATE TABLE `mod_candire_campaigns` (
  `mod_cnd_cp_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cnd cp',
  `mod_cnd_cp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_cnd_cp_description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `mod_cnd_cp_tags` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cnd cp tags',
  `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 COMMENT 'Valor de mod cnd cp type customer',
  `mod_cnd_cp_cpe_id` int DEFAULT NULL COMMENT 'ID de cnd cp cpe',
  `mod_cnd_cp_cen_id` int NOT NULL COMMENT 'ID de cnd cp cen',
  `mod_cnd_cp_target_init_age` int DEFAULT NULL COMMENT 'Valor de mod cnd cp target init age',
  `mod_cnd_cp_target_end_age` int DEFAULT NULL COMMENT 'Valor de mod cnd cp target end age',
  `mod_cnd_cp_target_gender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cnd cp target gender',
  `mod_cnd_cp_init_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_cnd_cp_end_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_cnd_cp_register_date` datetime DEFAULT NULL COMMENT 'Fecha de registro',
  `mod_cnd_cp_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Datos adicionales en formato JSON',
  `mod_cnd_cp_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_cnd_cp_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_cnd_cp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_candire_campaigns
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_carts
-- ----------------------------
CREATE TABLE `mod_carts` (
  `mod_cart_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cart',
  `mod_cart_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_cart_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_cart_acu_id` int NOT NULL COMMENT 'ID de cart acu',
  `mod_cart_add_id` int DEFAULT NULL COMMENT 'ID de cart add',
  `mod_cart_ldz_id` int DEFAULT NULL COMMENT 'ID de cart ldz',
  `mod_cart_details` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cart details',
  `mod_cart_payment_method` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cart payment method',
  `mod_cart_invoice_id` int DEFAULT NULL COMMENT 'ID de cart invoice',
  `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 COMMENT 'ID de cart transaction',
  `mod_cart_gateway_url_payment` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cart gateway url payment',
  `mod_cart_gateway_payment` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cart gateway payment',
  `mod_cart_gateway_url_invoice` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cart gateway url invoice',
  `mod_cart_gateway_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_cart_state` int NOT NULL DEFAULT '0' COMMENT '0 Creada 1 Registrada 2. Pagada 3. Revertida 4. Anulada 4.Eliminada\r\n',
  PRIMARY KEY (`mod_cart_id`,`mod_cart_acu_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_carts
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_carts_products
-- ----------------------------
CREATE TABLE `mod_carts_products` (
  `mod_cart_prod_cart_id` int NOT NULL COMMENT 'ID de cart prod cart',
  `mod_cart_prod_prod_id` int NOT NULL COMMENT 'ID de cart prod prod',
  `mod_cart_prod_price` decimal(20,2) DEFAULT NULL COMMENT 'Valor de mod cart prod price',
  `mod_cart_prod_order` int DEFAULT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_cart_prod_cart_id`,`mod_cart_prod_prod_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_carts_products
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ccm_messages
-- ----------------------------
CREATE TABLE `mod_ccm_messages` (
  `mod_cm_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_cm_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Registro detallado de mensajes/chats';

-- ----------------------------
-- Records of mod_ccm_messages
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ccm_reviews
-- ----------------------------
CREATE TABLE `mod_ccm_reviews` (
  `mod_cr_id` bigint unsigned NOT NULL AUTO_INCREMENT 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)',
  PRIMARY KEY (`mod_cr_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Reseñas y ratings de productos';

-- ----------------------------
-- Records of mod_ccm_reviews
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ccm_tickets
-- ----------------------------
CREATE TABLE `mod_ccm_tickets` (
  `mod_ct_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_ct_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Sistema de gestión de tickets de soporte';

-- ----------------------------
-- Records of mod_ccm_tickets
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_classification_info
-- ----------------------------
CREATE TABLE `mod_classification_info` (
  `mod_clsi_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de clsi',
  `mod_clsi_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_clsi_description` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_clsi_color` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod clsi color',
  `mod_clsi_file_id` int DEFAULT NULL COMMENT 'ID de clsi file',
  `mod_clsi_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_clsi_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_classification_info
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_competitions
-- ----------------------------
CREATE TABLE `mod_competitions` (
  `mod_cmp_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cmp',
  `mod_cmp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_cmp_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta del recurso',
  `mod_cmp_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `mod_cmp_date_init` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Valor de mod cmp date init',
  `mod_cmp_date_end` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Valor de mod cmp date end',
  `mod_cmp_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_cmp_status` int NOT NULL DEFAULT '0' COMMENT 'Estado del proceso',
  PRIMARY KEY (`mod_cmp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_competitions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_competitions_accounts
-- ----------------------------
CREATE TABLE `mod_competitions_accounts` (
  `mod_cmp_cmp_id` int NOT NULL COMMENT 'ID de cmp cmp',
  `mod_cmp_acu_id` int NOT NULL COMMENT 'ID de cmp acu',
  `mod_cmp_rel` int DEFAULT NULL COMMENT 'Valor de mod cmp rel',
  `mod_cmp_date_register` datetime NOT NULL COMMENT 'Valor de mod cmp date register',
  PRIMARY KEY (`mod_cmp_cmp_id`,`mod_cmp_acu_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_competitions_accounts
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_competitions_mira
-- ----------------------------
CREATE TABLE `mod_competitions_mira` (
  `mod_cmp_mira_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cmp mira',
  `mod_cmp_mira_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_cmp_mira_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cmp mira lastname',
  `mod_cmp_mira_acu_id` int NOT NULL COMMENT 'ID de cmp mira acu',
  `mod_cmp_mira_cumple` date DEFAULT NULL COMMENT 'Valor de mod cmp mira cumple',
  `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 COMMENT 'Valor de mod cmp mira nacionalidad',
  `mod_cmp_mira_direccion` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cmp mira direccion',
  `mod_cmp_mira_ciudad` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cmp mira ciudad',
  `mod_cmp_mira_pais` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cmp mira pais',
  `mod_cmp_mira_websocial` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod cmp mira websocial',
  `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 COMMENT 'Valor de mod cmp mira link portafolio',
  `mod_cmp_mira_file_portafolio` int DEFAULT NULL COMMENT 'Valor de mod cmp mira file portafolio',
  `mod_cmp_mira_titulo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cmp mira titulo',
  `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 COMMENT 'Valor de mod cmp mira sintesis',
  `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 COMMENT 'Valor de mod cmp mira file declaracion',
  `mod_cmp_mira_file_ci` int DEFAULT NULL COMMENT 'Valor de mod cmp mira file ci',
  `mod_cmp_mira_informacion` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod cmp mira informacion',
  `mod_cmp_mira_date_register` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Valor de mod cmp mira date register',
  `mod_cmp_mira_state` int DEFAULT NULL COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_cmp_mira_id`,`mod_cmp_mira_acu_id`,`mod_cmp_mira_num_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_competitions_mira
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_contacts
-- ----------------------------
CREATE TABLE `mod_contacts` (
  `mod_con_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único del contacto',
  `mod_con_type` enum('lead','prospect','customer','partner','employee','supplier','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_ci NOT NULL COMMENT 'Nombre del contacto',
  `mod_con_lastname_father` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Apellido paterno',
  `mod_con_lastname_mother` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Apellido materno',
  `mod_con_email_primary` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Correo electrónico principal',
  `mod_con_email_secondary` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Correo electrónico secundario',
  `mod_con_dial_code_phone_primary` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código de país para teléfono principal',
  `mod_con_phone_primary` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Teléfono principal',
  `mod_con_dial_code_phone_secondary` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código de país para teléfono secundario',
  `mod_con_phone_secondary` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Teléfono secundario',
  `mod_con_company` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre de la empresa donde trabaja el contacto',
  `mod_con_position` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_ci DEFAULT NULL COMMENT 'Sitio web personal o de la empresa',
  `mod_con_linkedin_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'URL del perfil de LinkedIn del contacto',
  `mod_con_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Dirección física completa',
  `mod_con_city` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ciudad de residencia',
  `mod_con_country` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_ci DEFAULT NULL COMMENT 'Código postal',
  `mod_con_source` enum('web','phone','email','referral','social','event','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_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_general_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_general_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_general_ci 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` datetime 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',
  PRIMARY KEY (`mod_con_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_contacts
-- ----------------------------
BEGIN;
INSERT INTO `mod_contacts` VALUES (1, 'lead', 'Hermany', 'Terrazas', 'Cossio', 'hterrazas@gmail.com', 'hermany.terrazas@gmail.com', '+591', '75313126', '+591', '9546811596', 'Una de ella', 'carg', 22, 'http://hermany.com', 'https://linkein/hermany', '6511 NW 87th Ave #CLI424901', 'Miami', 'US', '33178', 'web', NULL, 'qualified', 47, 'notas', NULL, NULL, NULL, NULL, NULL, NULL, 1, 2, '2026-04-19 15:37:46', '2026-04-19 13:43:51', 1, '2026-04-19 13:43:51', 1);
COMMIT;

-- ----------------------------
-- Table structure for mod_crm_activities
-- ----------------------------
CREATE TABLE `mod_crm_activities` (
  `mod_crm_act_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de la actividad',
  `mod_crm_act_type` enum('call','email','meeting','task','note','deadline') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_ci NOT NULL COMMENT 'Asunto o título de la actividad',
  `mod_crm_act_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción detallada de la actividad',
  `mod_crm_act_status` enum('pending','completed','cancelled','overdue') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_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_general_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',
  PRIMARY KEY (`mod_crm_act_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_crm_activities
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_crm_contact_tags
-- ----------------------------
CREATE TABLE `mod_crm_contact_tags` (
  `mod_crm_cta_id` int NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_crm_cta_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_crm_contact_tags
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_crm_custom_field_values
-- ----------------------------
CREATE TABLE `mod_crm_custom_field_values` (
  `mod_crm_cfv_id` int NOT NULL AUTO_INCREMENT 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_general_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',
  PRIMARY KEY (`mod_crm_cfv_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_crm_custom_field_values
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_crm_custom_fields
-- ----------------------------
CREATE TABLE `mod_crm_custom_fields` (
  `mod_crm_cfi_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único del campo personalizado',
  `mod_crm_cfi_entity_type` enum('contact','opportunity','activity') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tipo de entidad: contact, opportunity o activity',
  `mod_crm_cfi_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre interno del campo (sin espacios, snake_case)',
  `mod_crm_cfi_label` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_ci NOT NULL COMMENT 'Tipo de campo',
  `mod_crm_cfi_options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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_general_ci 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',
  PRIMARY KEY (`mod_crm_cfi_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_crm_custom_fields
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_crm_customers
-- ----------------------------
CREATE TABLE `mod_crm_customers` (
  `mod_cc_id` bigint unsigned NOT NULL AUTO_INCREMENT 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)',
  PRIMARY KEY (`mod_cc_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Registro de Clientes (Consumidores Finales)';

-- ----------------------------
-- Records of mod_crm_customers
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_crm_documents
-- ----------------------------
CREATE TABLE `mod_crm_documents` (
  `mod_crm_doc_id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID único del documento',
  `mod_crm_doc_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del archivo',
  `mod_crm_doc_file_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_ci DEFAULT NULL COMMENT 'Tipo MIME del archivo',
  `mod_crm_doc_related_type` enum('contact','opportunity','activity') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_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',
  PRIMARY KEY (`mod_crm_doc_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_crm_documents
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_crm_email_templates
-- ----------------------------
CREATE TABLE `mod_crm_email_templates` (
  `mod_crm_emt_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de la plantilla',
  `mod_crm_emt_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre identificador de la plantilla',
  `mod_crm_emt_subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Asunto del email (puede incluir variables como {{first_name}})',
  `mod_crm_emt_body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Cuerpo del email en HTML (puede incluir variables)',
  `mod_crm_emt_variables` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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_general_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',
  PRIMARY KEY (`mod_crm_emt_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_crm_email_templates
-- ----------------------------
BEGIN;
INSERT INTO `mod_crm_email_templates` 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);
INSERT INTO `mod_crm_email_templates` VALUES (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);
INSERT INTO `mod_crm_email_templates` VALUES (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);
INSERT INTO `mod_crm_email_templates` VALUES (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);
COMMIT;

-- ----------------------------
-- Table structure for mod_crm_interactions
-- ----------------------------
CREATE TABLE `mod_crm_interactions` (
  `mod_crm_int_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de la interacción',
  `mod_crm_int_type` enum('call','email','meeting','chat','social','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_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_general_ci DEFAULT NULL COMMENT 'Asunto o tema de la interacción',
  `mod_crm_int_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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_general_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',
  PRIMARY KEY (`mod_crm_int_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_crm_interactions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_crm_notes
-- ----------------------------
CREATE TABLE `mod_crm_notes` (
  `mod_crm_note_id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID único de la nota',
  `mod_crm_note_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Contenido de la nota',
  `mod_crm_note_related_type` enum('contact','opportunity','activity') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_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',
  PRIMARY KEY (`mod_crm_note_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_crm_notes
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_customers_enterprises
-- ----------------------------
CREATE TABLE `mod_customers_enterprises` (
  `mod_cen_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cen',
  `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 COMMENT 'Nombre del registro',
  `mod_cen_username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cen username',
  `mod_cen_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_cen_email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Correo electrónico',
  `mod_cen_description` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_cen_img` int DEFAULT NULL COMMENT 'Valor de mod cen img',
  `mod_cen_register_date` datetime DEFAULT NULL COMMENT 'Fecha de registro',
  `mod_cen_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_cen_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_cen_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_cen_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_customers_enterprises
-- ----------------------------
BEGIN;
INSERT INTO `mod_customers_enterprises` VALUES (1, 0, 1, 'Wappcom', 'wappcom', 'wapp', NULL, '', 0, '2023-01-03 15:50:12', 0, 1, 1);
INSERT INTO `mod_customers_enterprises` VALUES (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);
INSERT INTO `mod_customers_enterprises` VALUES (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);
INSERT INTO `mod_customers_enterprises` VALUES (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);
INSERT INTO `mod_customers_enterprises` VALUES (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);
INSERT INTO `mod_customers_enterprises` VALUES (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);
INSERT INTO `mod_customers_enterprises` VALUES (7, 0, 7, 'Francisco Arce', 'franciscoarce', 'FA001', NULL, 'Francisco Arce 76342483 farcime@gmail.com', 0, '2023-01-03 20:24:58', 1, 1, 1);
INSERT INTO `mod_customers_enterprises` VALUES (8, 0, 8, 'Chaplin Show', 'chaplinshow', 'CHS-001', NULL, '', 0, '2023-01-03 20:57:24', 1, 1, 1);
INSERT INTO `mod_customers_enterprises` VALUES (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);
INSERT INTO `mod_customers_enterprises` VALUES (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);
INSERT INTO `mod_customers_enterprises` VALUES (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);
INSERT INTO `mod_customers_enterprises` VALUES (12, 0, 12, 'Networks Solitions', 'ns', 'ns-1', NULL, '', 0, '2024-09-18 15:26:46', 1, 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for mod_customers_enterprises_data
-- ----------------------------
CREATE TABLE `mod_customers_enterprises_data` (
  `mod_cen_data_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cen data',
  `mod_cen_data_cen_id` int NOT NULL COMMENT 'ID de cen data cen',
  `mod_cen_data_business_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_cen_data_nit` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cen data nit',
  `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 COMMENT 'Valor de mod cen data type contract',
  `mod_cen_data_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  PRIMARY KEY (`mod_cen_data_id`,`mod_cen_data_cen_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_customers_enterprises_data
-- ----------------------------
BEGIN;
INSERT INTO `mod_customers_enterprises_data` VALUES (1, 2, 'Eurochronos SRL', '150628027', 'AA', 0, '');
INSERT INTO `mod_customers_enterprises_data` VALUES (2, 4, 'Fundación UPSA', '1015227020', 'AA', 0, '');
INSERT INTO `mod_customers_enterprises_data` VALUES (3, 1, 'Wappcom Srl.', '251636025', 'AAA', 0, '');
INSERT INTO `mod_customers_enterprises_data` VALUES (4, 10, 'Edadsa S.A', '150782020', 'AA', 0, '');
COMMIT;

-- ----------------------------
-- Table structure for mod_customers_options
-- ----------------------------
CREATE TABLE `mod_customers_options` (
  `mod_cop_id` int NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_cop_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Opciones de clientes';

-- ----------------------------
-- Records of mod_customers_options
-- ----------------------------
BEGIN;
INSERT INTO `mod_customers_options` VALUES (1, 'primaryCustomerType', 'customerPerson', 'yes', '2025-04-16 04:34:48', '2026-03-14 23:43:00');
COMMIT;

-- ----------------------------
-- Table structure for mod_customers_persons
-- ----------------------------
CREATE TABLE `mod_customers_persons` (
  `mod_cpe_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de cpe',
  `mod_cpe_acu_id` int DEFAULT NULL COMMENT 'ID de cpe acu',
  `mod_cpe_plan_id` int DEFAULT NULL COMMENT 'ID de cpe plan',
  `mod_cpe_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_cpe_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cpe lastname',
  `mod_cpe_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Correo electrónico',
  `mod_cpe_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_cpe_phone` int DEFAULT NULL COMMENT 'Número de teléfono',
  `mod_cpe_ci` int DEFAULT NULL COMMENT 'Valor de mod cpe ci',
  `mod_cpe_ci_complemento` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cpe ci complemento',
  `mod_cpe_adder` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod cpe adder',
  `mod_cpe_register_date` datetime NOT NULL COMMENT 'Fecha de registro',
  `mod_cpe_user_id` int DEFAULT NULL COMMENT 'usuario que lo registro\r\n',
  `mod_cpe_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_cpe_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_cpe_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_customers_persons
-- ----------------------------
BEGIN;
INSERT INTO `mod_customers_persons` VALUES (1, 73, 1, 'Miguel', 'Montero Duran', 'montero@gmail.com', 'e1f6d2bc1d13', 2147483647, 4735799, '', '', '2026-04-07 18:11:30', 1, 1, 1);
COMMIT;

-- ----------------------------
-- Records of mod_customers_persons_data
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_departments
-- ----------------------------
CREATE TABLE `mod_departments` (
  `mod_dep_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de dep',
  `mod_dep_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_dep_parent_id` int NOT NULL COMMENT 'ID de dep parent',
  `mod_dep_description` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Descripción del registro',
  `mod_dep_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `mod_dep_order` int NOT NULL COMMENT 'Orden de visualización',
  `mod_dep_state` int NOT NULL COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_dep_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_departments
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_discount
-- ----------------------------
CREATE TABLE `mod_discount` (
  `mod_dis_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de dis',
  `mod_dis_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_dis_detail` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod dis detail',
  `mod_dis_rate` int DEFAULT NULL COMMENT 'Valor de mod dis rate',
  `mod_dis_start_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_dis_end_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_dis_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_dis_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_discount
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_discount_products
-- ----------------------------
CREATE TABLE `mod_discount_products` (
  `mod_dis_prod_dis_id` int NOT NULL COMMENT 'ID de dis prod dis',
  `mod_dis_prod_prod_id` int NOT NULL COMMENT 'ID de dis prod prod',
  `mod_dis_prod_orden` int NOT NULL COMMENT 'Valor de mod dis prod orden',
  PRIMARY KEY (`mod_dis_prod_dis_id`,`mod_dis_prod_prod_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_discount_products
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_events
-- ----------------------------
CREATE TABLE `mod_events` (
  `mod_eve_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de eve',
  `mod_eve_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_eve_description` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `mod_eve_register_date` datetime DEFAULT NULL COMMENT 'Fecha de registro',
  `mod_eve_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_eve_init_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_eve_end_date` datetime DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_eve_img_small` int DEFAULT NULL COMMENT 'Valor de mod eve img small',
  `mod_eve_img_medium` int DEFAULT NULL COMMENT 'Valor de mod eve img medium',
  `mod_eve_img_large` int DEFAULT NULL COMMENT 'Valor de mod eve img large',
  `mod_eve_seats` int DEFAULT NULL COMMENT 'Valor de mod eve seats',
  `mod_eve_hall` int DEFAULT NULL COMMENT 'Valor de mod eve hall',
  `mod_eve_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_eve_cost_seat` decimal(21,2) DEFAULT NULL COMMENT 'Valor de mod eve cost seat',
  `mod_eve_coin` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Bs' COMMENT 'Valor de mod eve coin',
  `mod_eve_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_eve_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_eve_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_events
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_events_halls
-- ----------------------------
CREATE TABLE `mod_events_halls` (
  `mod_eve_hall_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de eve hall',
  `mod_eve_hall_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `mod_eve_hall_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_eve_hall_details` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod eve hall details',
  `mod_eve_hall_url_draw_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ID de eve hall url draw',
  `mod_eve_hall_fn_js_draw` varchar(440) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod eve hall fn js draw',
  `mod_eve_hall_num_tables` int DEFAULT NULL COMMENT 'Valor de mod eve hall num tables',
  `mod_eve_hall_num_seats` int DEFAULT NULL COMMENT 'Valor de mod eve hall num seats',
  `mod_eve_hall_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod eve hall address',
  `mod_eve_hall_city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod eve hall city',
  `mod_eve_hall_country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod eve hall country',
  `mod_eve_hall_coord` varchar(440) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod eve hall coord',
  `mod_eve_hall_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_eve_hall_register_date` datetime DEFAULT NULL COMMENT 'Fecha de registro',
  `mod_eve_hall_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_eve_hall_id`,`mod_eve_hall_ent_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_events_halls
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_events_options
-- ----------------------------
CREATE TABLE `mod_events_options` (
  `mod_eve_option_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de eve option',
  `mod_eve_option_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_eve_option_value` int DEFAULT NULL COMMENT 'Valor de mod eve option value',
  `mod_eve_option_autoload` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod eve option autoload',
  PRIMARY KEY (`mod_eve_option_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_events_options
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_events_tickets
-- ----------------------------
CREATE TABLE `mod_events_tickets` (
  `mod_eve_tck_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de eve tck',
  `mod_eve_tck_eve_id` int DEFAULT NULL COMMENT 'ID de eve tck eve',
  `mod_eve_tck_hall_id` int DEFAULT NULL COMMENT 'ID de eve tck hall',
  `mod_eve_tck_table_id` int DEFAULT NULL COMMENT 'mesa id',
  `mod_eve_tck_seat_id` int DEFAULT NULL COMMENT 'ID de eve tck seat',
  `mod_eve_tck_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `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 COMMENT 'ID de eve tck reserve',
  `mod_eve_tck_acp_id` int DEFAULT NULL COMMENT 'mod_accounting_plan id\r\n',
  `mod_eve_tck_cpe_id` int DEFAULT NULL COMMENT 'ID de eve tck cpe',
  `mod_eve_tck_date_register` datetime DEFAULT NULL COMMENT 'Valor de mod eve tck date register',
  `mod_eve_tck_cost` decimal(22,2) DEFAULT NULL COMMENT 'Valor de mod eve tck cost',
  `mod_eve_tck_coin` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod eve tck coin',
  `mod_eve_tck_user_id` int NOT NULL COMMENT 'ID del usuario',
  `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 COMMENT 'Valor de mod eve tck date pay register',
  `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 ',
  PRIMARY KEY (`mod_eve_tck_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_events_tickets
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_external_docs
-- ----------------------------
CREATE TABLE `mod_external_docs` (
  `mod_edc_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de edc',
  `mod_edc_site` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod edc site',
  `mod_edc_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_edc_approver_id` int DEFAULT NULL COMMENT 'ID de edc approver',
  `mod_edc_tpl_id` int DEFAULT NULL COMMENT 'ID de edc tpl',
  `mod_edc_date_register` datetime DEFAULT NULL COMMENT 'Valor de mod edc date register',
  `mod_edc_key` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod edc key',
  `mod_edc_clsi_id` int DEFAULT NULL COMMENT 'mod_classification_info',
  `mod_edc_code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_edc_pw` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod edc pw',
  `mod_edc_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod edc data',
  `mod_edc_flags` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod edc flags',
  `mod_edc_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_edc_state` int DEFAULT NULL COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_edc_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_external_docs
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_external_docs_options
-- ----------------------------
CREATE TABLE `mod_external_docs_options` (
  `mod_edc_opt_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de edc opt',
  `mod_edc_opt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_edc_opt_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod edc opt value',
  `mod_edc_opt_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `mod_edc_opt_autoload` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod edc opt autoload',
  PRIMARY KEY (`mod_edc_opt_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_external_docs_options
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_external_docs_page_design
-- ----------------------------
CREATE TABLE `mod_external_docs_page_design` (
  `mod_edc_pd_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de edc pd',
  `mod_edc_pd_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_edc_pd_url` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ruta URL del recurso',
  `mod_edc_pd_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_edc_pd_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_edc_pd_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_edc_pd_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_external_docs_page_design
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_external_docs_templates
-- ----------------------------
CREATE TABLE `mod_external_docs_templates` (
  `mod_edc_tpl_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de edc tpl',
  `mod_edc_tpl_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_edc_tpl_description` varchar(445) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_edc_tpl_code` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_edc_tpl_tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod edc tpl tags',
  `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 COMMENT 'Valor de mod edc tpl body',
  `mod_edc_tpl_register_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_edc_tpl_register_date` datetime DEFAULT NULL COMMENT 'Fecha de registro',
  `mod_edc_tpl_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_edc_tpl_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_edc_tpl_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_edc_tpl_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_external_docs_templates
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_external_docs_types
-- ----------------------------
CREATE TABLE `mod_external_docs_types` (
  `mod_edc_type_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de edc type',
  `mod_edc_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_edc_type_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_edc_type_parent_id` int NOT NULL COMMENT 'ID de edc type parent',
  `mod_edc_type_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `mod_edc_type_color` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod edc type color',
  `mod_edc_type_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_edc_type_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_external_docs_types
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_fss_payouts
-- ----------------------------
CREATE TABLE `mod_fss_payouts` (
  `mod_fp_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_fp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Transferencias financieras ejecutadas a Vendors';

-- ----------------------------
-- Records of mod_fss_payouts
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_fss_vendor_balance
-- ----------------------------
CREATE TABLE `mod_fss_vendor_balance` (
  `mod_fvb_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_fvb_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Sub-Ledger de movimientos de saldo pendiente/liquidado del Vendor';

-- ----------------------------
-- Records of mod_fss_vendor_balance
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ganador_ganaderos
-- ----------------------------
CREATE TABLE `mod_ganador_ganaderos` (
  `mod_ggd_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de ggd',
  `mod_ggd_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_ggd_acu_id` int DEFAULT NULL COMMENT 'ID de ggd acu',
  `mod_ggd_perfil` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod ggd perfil',
  `mod_ggd_img_id` int DEFAULT NULL COMMENT 'ID de ggd img',
  `mod_ggd_dial` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '+591' COMMENT 'Valor de mod ggd dial',
  `mod_ggd_celular` int DEFAULT NULL COMMENT 'Valor de mod ggd celular',
  `mod_ggd_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_ggd_date_register` datetime DEFAULT NULL COMMENT 'Valor de mod ggd date register',
  `mod_ggd_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_ggd_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ganador_ganaderos
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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 COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_ggp_ggd_id`,`mod_ggp_gpr_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ganador_ganaderos_propiedades
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ganador_propiedades
-- ----------------------------
CREATE TABLE `mod_ganador_propiedades` (
  `mod_gpr_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de gpr',
  `mod_gpr_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_gpr_description` varchar(550) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_gpr_ubicacion` varchar(450) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod gpr ubicacion',
  `mod_gpr_coord` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod gpr coord',
  `mod_gpr_cover_id` int DEFAULT NULL COMMENT 'imagen portada',
  `mod_gpr_video` int DEFAULT NULL COMMENT 'Valor de mod gpr video',
  `mod_gpr_date_register` int NOT NULL COMMENT 'Valor de mod gpr date register',
  `mod_gpr_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_gpr_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ganador_propiedades
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ganador_propiedades_files
-- ----------------------------
CREATE TABLE `mod_ganador_propiedades_files` (
  `mod_gpf_file_id` int NOT NULL COMMENT 'ID de gpf file',
  `mod_gpf_gpr_id` int NOT NULL COMMENT 'ID de gpf gpr',
  `mod_gpf_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_gpf_file_id`,`mod_gpf_gpr_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ganador_propiedades_files
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ganador_propiedades_images
-- ----------------------------
CREATE TABLE `mod_ganador_propiedades_images` (
  `mod_gpi_img_id` int NOT NULL COMMENT 'ID de gpi img',
  `mod_gpi_gpr_id` int NOT NULL COMMENT 'ID de gpi gpr',
  `mod_gpi_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_gpi_img_id`,`mod_gpi_gpr_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ganador_propiedades_images
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_ganador_proyectos
-- ----------------------------
CREATE TABLE `mod_ganador_proyectos` (
  `mod_gp_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de gp',
  `mod_gp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `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 COMMENT 'Valor de mod gp periodo',
  `mod_gp_date_end_captacion` datetime DEFAULT NULL COMMENT 'Valor de mod gp date end captacion',
  `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 COMMENT 'Valor de mod gp date register',
  `mod_gp_user_id` int NOT NULL DEFAULT '0' COMMENT 'ID del usuario',
  `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',
  PRIMARY KEY (`mod_gp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_ganador_proyectos
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_gl_accounts
-- ----------------------------
CREATE TABLE `mod_gl_accounts` (
  `mod_gl_id` int unsigned NOT NULL AUTO_INCREMENT 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)',
  PRIMARY KEY (`mod_gl_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Catálogo de Cuentas (Chart of Accounts)';

-- ----------------------------
-- Records of mod_gl_accounts
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_gl_entries
-- ----------------------------
CREATE TABLE `mod_gl_entries` (
  `mod_ge_id` bigint unsigned NOT NULL AUTO_INCREMENT 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)',
  PRIMARY KEY (`mod_ge_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Asientos contables inmutables (Journal Entries)';

-- ----------------------------
-- Records of mod_gl_entries
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_gl_transactions
-- ----------------------------
CREATE TABLE `mod_gl_transactions` (
  `mod_gt_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_gt_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Eventos de negocio que generan movimientos contables';

-- ----------------------------
-- Records of mod_gl_transactions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_hrm_employees
-- ----------------------------
CREATE TABLE `mod_hrm_employees` (
  `mod_he_id` int unsigned NOT NULL AUTO_INCREMENT 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)',
  PRIMARY KEY (`mod_he_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Información del Recurso Humano y Empleados (Auditoría)';

-- ----------------------------
-- Records of mod_hrm_employees
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_hrm_positions
-- ----------------------------
CREATE TABLE `mod_hrm_positions` (
  `mod_hp_id` int unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_hp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Historial de puestos y posiciones de empleados';

-- ----------------------------
-- Records of mod_hrm_positions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_inventory_options
-- ----------------------------
CREATE TABLE `mod_inventory_options` (
  `mod_inv_opt_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de inv opt',
  `mod_inv_opt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_inv_opt_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod inv opt value',
  `mod_inv_opt_autoload` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod inv opt autoload',
  `mod_inv_opt_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  PRIMARY KEY (`mod_inv_opt_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_inventory_options
-- ----------------------------
BEGIN;
INSERT INTO `mod_inventory_options` VALUES (1, 'routeCategoryId', '3', '', 1);
COMMIT;

-- ----------------------------
-- Table structure for mod_inventory_units
-- ----------------------------
CREATE TABLE `mod_inventory_units` (
  `mod_inv_unt_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de inv unt',
  `mod_inv_unt_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_inv_unt_summary` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod inv unt summary',
  `mod_inv_unt_vars` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod inv unt vars',
  `mod_inv_unt_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_inv_unt_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_inventory_units
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_invoices
-- ----------------------------
CREATE TABLE `mod_invoices` (
  `mod_inv_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de inv',
  `mod_inv_px_id` int NOT NULL COMMENT 'Id del pago relacionado',
  `mod_inv_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha del registro',
  `mod_inv_total` decimal(10,2) NOT NULL COMMENT 'Valor de mod inv total',
  `mod_inv_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'pending' COMMENT 'Estado del proceso',
  `mod_inv_register_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de registro',
  `mod_inv_user_id` int NOT NULL COMMENT 'ID del usuario',
  `mod_inv_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `mod_inv_custom_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod inv custom data',
  `mod_inv_class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod inv class',
  `mod_inv_custom_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ID de inv custom',
  `mod_inv_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_inv_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_invoices
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_jobtitle
-- ----------------------------
CREATE TABLE `mod_jobtitle` (
  `mod_jbt_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de jbt',
  `mod_jbt_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod jbt title',
  `mod_jbt_description` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Descripción del registro',
  `mod_jbt_parent_id` int NOT NULL COMMENT 'ID de jbt parent',
  `mod_jpt_duties_manual` int NOT NULL COMMENT 'Valor de mod jpt duties manual',
  `mod_jbt_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `mod_jbt_order` int NOT NULL COMMENT 'Orden de visualización',
  `mod_jbt_state` int NOT NULL COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_jbt_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_jobtitle
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_kardex
-- ----------------------------
CREATE TABLE `mod_kardex` (
  `mod_kdx_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de kdx',
  `mod_kdx_user_id` int NOT NULL COMMENT 'ID del usuario',
  `mod_kdx_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_kdx_fathers_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx fathers lastname',
  `mod_kdx_mothers_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx mothers lastname',
  `mod_kdx_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_kdx_entry_date` date DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_kdx_ci` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx ci',
  `mod_kdx_ci_extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx ci extension',
  `mod_kdx_ci_expiration_date` date DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_kdx_drivers_licence_expiration_date` date DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_kdx_birth_date` date DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_kdx_nationality` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx nationality',
  `mod_kdx_birth_place` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx birth place',
  `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 COMMENT 'Valor de mod kdx dates contact',
  `mod_kdx_phone_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx phone address',
  `mod_kdx_phone_corp` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx phone corp',
  `mod_kdx_phone_corp_ext` int DEFAULT NULL COMMENT 'Valor de mod kdx phone corp ext',
  `mod_kdx_personal_mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx personal mobile',
  `mod_kdx_corp_mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx corp mobile',
  `mod_kdx_personal_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Correo electrónico',
  `mod_kdx_corp_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Correo electrónico',
  `mod_kdx_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx address',
  `mod_kdx_coordinates` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx coordinates',
  `mod_kdx_nro_cns` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx nro cns',
  `mod_kdx_nro_afp` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx nro afp',
  `mod_kdx_afp` int DEFAULT NULL COMMENT 'Valor de mod kdx afp',
  `mod_kdx_shirt_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx shirt size',
  `mod_kdx_pant_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx pant size',
  `mod_kdx_boot_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx boot size',
  `mod_kdx_blood_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Tipo de registro',
  `mod_kdx_removal_date` date DEFAULT NULL COMMENT 'Fecha del registro',
  `mod_kdx_cod_sap` int DEFAULT NULL COMMENT 'Valor de mod kdx cod sap',
  `mod_kdx_cv_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'ID de kdx cv',
  `mod_kdx_workhours` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod kdx workhours',
  `mod_kdx_trash` int DEFAULT NULL COMMENT 'Valor de mod kdx trash',
  `mod_kdx_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_kdx_id`,`mod_kdx_user_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=10012 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_kardex
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_kardex_jobtitle
-- ----------------------------
CREATE TABLE `mod_kardex_jobtitle` (
  `mod_kdx_jbt_jbt_id` int NOT NULL COMMENT 'ID de kdx jbt jbt',
  `mod_kdx_jbt_kdx_id` int NOT NULL COMMENT 'ID de kdx jbt kdx',
  `mod_kdx_jbt_ent_id` int NOT NULL COMMENT 'ID de la entidad',
  `mod_kdx_jbt_order` int NOT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_kdx_jbt_jbt_id`,`mod_kdx_jbt_kdx_id`,`mod_kdx_jbt_ent_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_kardex_jobtitle
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_leagues
-- ----------------------------
CREATE TABLE `mod_leagues` (
  `mod_lg_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de lg',
  `mod_lg_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_lg_description` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_lg_sport` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod lg sport',
  `mod_lg_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_lg_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_lg_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_lg_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_leagues
-- ----------------------------
BEGIN;
INSERT INTO `mod_leagues` VALUES (1, 'prueba', '', '', '', 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for mod_leagues_divisions
-- ----------------------------
CREATE TABLE `mod_leagues_divisions` (
  `mod_lg_div_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de lg div',
  `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 COMMENT 'Nombre del registro',
  `mod_lg_div_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Descripción del registro',
  `mod_lg_div_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_lg_div_state` int DEFAULT NULL COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_lg_div_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_leagues_divisions
-- ----------------------------
BEGIN;
INSERT INTO `mod_leagues_divisions` VALUES (1, 1, 'division 1', '', '', 1);
COMMIT;

-- ----------------------------
-- Table structure for mod_leagues_divisions_teams
-- ----------------------------
CREATE TABLE `mod_leagues_divisions_teams` (
  `mod_lg_div_tm_div_id` int NOT NULL COMMENT 'ID de lg div tm div',
  `mod_lg_div_tm_tm_id` int NOT NULL COMMENT 'ID de lg div tm tm',
  `mod_lg_div_tm_order` int DEFAULT NULL COMMENT 'Orden de visualización',
  PRIMARY KEY (`mod_lg_div_tm_div_id`,`mod_lg_div_tm_tm_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_leagues_divisions_teams
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_logistics_distribution_move
-- ----------------------------
CREATE TABLE `mod_logistics_distribution_move` (
  `mod_log_dtz_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de log dtz',
  `mod_log_dtz_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_log_dtz_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_log_dtz_perimetrer` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod log dtz perimetrer',
  `mod_log_dtz_cost` decimal(20,2) NOT NULL COMMENT 'Valor de mod log dtz cost',
  `mod_log_dtz_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_log_dtz_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_logistics_distribution_move
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_logistics_distribution_zone
-- ----------------------------
CREATE TABLE `mod_logistics_distribution_zone` (
  `mod_log_dtz_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de log dtz',
  `mod_log_dtz_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_log_dtz_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_log_dtz_perimetrer` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod log dtz perimetrer',
  `mod_log_dtz_cost` decimal(20,2) NOT NULL COMMENT 'Valor de mod log dtz cost',
  `mod_log_dtz_state` int DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_log_dtz_id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_logistics_distribution_zone
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_make
-- ----------------------------
CREATE TABLE `mod_make` (
  `mod_mak_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de mak',
  `mod_mak_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_mak_description` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Descripción del registro',
  `mod_mak_img_id` int NOT NULL COMMENT 'ID de mak img',
  `mod_mak_state` int NOT NULL COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_mak_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_make
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_management
-- ----------------------------
CREATE TABLE `mod_management` (
  `mod_mag_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de mag',
  `mod_mag_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Nombre del registro',
  `mod_mag_description` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Descripción del registro',
  `mod_mag_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_mag_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_management
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_oms_fulfillments
-- ----------------------------
CREATE TABLE `mod_oms_fulfillments` (
  `mod_of_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_of_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Unidad de Cumplimiento (una por item/vendor)';

-- ----------------------------
-- Records of mod_oms_fulfillments
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_oms_order_items
-- ----------------------------
CREATE TABLE `mod_oms_order_items` (
  `mod_oi_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_oi_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Detalle de las partidas de la Orden (Incluye Snapshot)';

-- ----------------------------
-- Records of mod_oms_order_items
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_oms_orders
-- ----------------------------
CREATE TABLE `mod_oms_orders` (
  `mod_oo_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_oo_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Cabecera de la Orden de Cliente';

-- ----------------------------
-- Records of mod_oms_orders
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_oms_refunds
-- ----------------------------
CREATE TABLE `mod_oms_refunds` (
  `mod_orf_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_orf_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Transacción financiera de Reembolso';

-- ----------------------------
-- Records of mod_oms_refunds
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_oms_returns
-- ----------------------------
CREATE TABLE `mod_oms_returns` (
  `mod_or_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_or_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Gestión de Solicitudes de Devolución (Returns)';

-- ----------------------------
-- Records of mod_oms_returns
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_oms_shipments
-- ----------------------------
CREATE TABLE `mod_oms_shipments` (
  `mod_os_id` bigint unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_os_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Entidad física del Envío y Tracking';

-- ----------------------------
-- Records of mod_oms_shipments
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_organization_chart
-- ----------------------------
CREATE TABLE `mod_organization_chart` (
  `mod_orc_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de orc',
  `mod_orc_position` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod orc position',
  `mod_orc_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_orc_functions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod orc functions',
  `mod_orc_doc_id` int DEFAULT NULL COMMENT 'rel functions',
  `mod_orc_location` int NOT NULL COMMENT 'Valor de mod orc location',
  `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 COMMENT 'Código interno',
  `mod_orc_user_id` int NOT NULL COMMENT 'id register',
  `mod_orc_date_register` datetime DEFAULT NULL COMMENT 'Valor de mod orc date register',
  `mod_orc_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_orc_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_orc_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_organization_chart
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_organization_chart_rel
-- ----------------------------
CREATE TABLE `mod_organization_chart_rel` (
  `mod_orc_rel_orc_id` int NOT NULL COMMENT 'ID de orc rel orc',
  `mod_orc_rel_user_id` int NOT NULL COMMENT 'ID del usuario',
  `mod_orc_rel_kdx_id` int DEFAULT NULL COMMENT 'ID de orc rel kdx',
  `mod_orc_rel_date_register` date DEFAULT NULL COMMENT 'Valor de mod orc rel date register',
  `mod_orc_rel_order` int DEFAULT NULL COMMENT 'Orden de visualización',
  `mod_org_rel_state` int NOT NULL DEFAULT '0' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_orc_rel_orc_id`,`mod_orc_rel_user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_organization_chart_rel
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_pay_tx_suscriptions
-- ----------------------------
CREATE TABLE `mod_pay_tx_suscriptions` (
  `mod_pay_tx_sbs_id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID de pay tx sbs',
  `mod_pay_tx_sbs_acu_id` bigint DEFAULT NULL COMMENT 'cuenta de usuario',
  `mod_pay_tx_sbs_cpe_id` bigint DEFAULT NULL COMMENT 'ID de pay tx sbs cpe',
  `mod_pay_tx_sbs_pay` decimal(22,2) DEFAULT NULL COMMENT 'Valor de mod pay tx sbs pay',
  `mod_pay_tx_sbs_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_pay_tx_sbs_coin` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod pay tx sbs coin',
  `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 COMMENT 'Valor de mod pay tx sbs nit',
  `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' COMMENT 'Valor de mod pay tx num invoice',
  `mod_pay_tx_sbs_mode` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod pay tx sbs mode',
  `mod_pay_tx_sbs_txr` bigint DEFAULT NULL COMMENT 'id transaccion',
  `mod_pay_tx_sbs_date_pay_register` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Valor de mod pay tx sbs date pay register',
  `mod_pay_tx_sbs_callback` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod pay tx sbs callback',
  `mod_pay_tx_sbs_mail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod pay tx sbs mail',
  `mod_pay_tx_sbs_user_id` bigint DEFAULT NULL COMMENT 'ID del usuario',
  `mod_pay_tx_sbs_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_pay_tx_sbs_return` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod pay tx sbs return',
  `mod_pay_tx_sbs_register_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha de registro',
  `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' COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_pay_tx_sbs_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_pay_tx_suscriptions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_pay_tx_temp
-- ----------------------------
CREATE TABLE `mod_pay_tx_temp` (
  `mod_pay_tx_tmp_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de pay tx tmp',
  `mod_pay_tx_tmp_acu_id` int NOT NULL COMMENT 'ID de pay tx tmp acu',
  `mod_pay_tx_tmp_cpe_id` int NOT NULL COMMENT 'ID de pay tx tmp cpe',
  `mod_pay_tx_tmp_code` int NOT NULL COMMENT 'Código interno',
  `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 COMMENT 'ID de la entidad',
  `mod_pay_tx_tmp_mode` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod pay tx tmp mode',
  `mod_pay_tx_tmp_register_date` datetime NOT NULL COMMENT 'Fecha de registro',
  `mod_pay_tx_tmp_nit` bigint NOT NULL COMMENT 'Valor de mod pay tx tmp nit',
  `mod_pay_tx_tmp_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_pay_tx_tmp_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod pay tx tmp response',
  `mod_pay_tx_tmp_state` int NOT NULL DEFAULT '0' COMMENT '0. agregado 1.pagado 2. con error \r\n',
  PRIMARY KEY (`mod_pay_tx_tmp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_pay_tx_temp
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_pay_tx_tickets
-- ----------------------------
CREATE TABLE `mod_pay_tx_tickets` (
  `mod_pay_tx_tck_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de pay tx tck',
  `mod_pay_tx_tck_acp_id` int DEFAULT NULL COMMENT 'ID de pay tx tck acp',
  `mod_pay_tx_tck_cpe_id` int NOT NULL COMMENT 'ID de pay tx tck cpe',
  `mod_pay_tx_tck_eve_id` int NOT NULL COMMENT 'ID de pay tx tck eve',
  `mod_pay_tx_tck_reserve_id` int NOT NULL COMMENT 'ID de pay tx tck reserve',
  `mod_pay_tx_tck_pay` decimal(22,2) NOT NULL DEFAULT '0.00' COMMENT 'Valor de mod pay tx tck pay',
  `mod_pay_tx_tck_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Código interno',
  `mod_pay_tx_tck_coin` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Valor de mod pay tx tck coin',
  `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 COMMENT 'Valor de mod pay tx tck nit',
  `mod_pay_tx_tck_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Tipo de registro',
  `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 COMMENT 'Valor de mod pay tx tck date pay register',
  `mod_pay_tx_tck_callback` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod pay tx tck callback',
  `mod_pay_tx_tck_mail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod pay tx tck mail',
  `mod_pay_tx_tck_user_id` int NOT NULL DEFAULT '0' COMMENT 'ID del usuario',
  `mod_pay_tx_tck_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_pay_tx_tck_return` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Valor de mod pay tx tck return',
  `mod_pay_tx_tck_register_date` datetime DEFAULT NULL COMMENT 'Fecha de registro',
  `mod_pay_tx_tck_state` int NOT NULL DEFAULT '0' COMMENT '0. Iniciado, 2.registrado, 3.Active/pagado, 4.Anulado 5.Delete',
  PRIMARY KEY (`mod_pay_tx_tck_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_pay_tx_tickets
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_persons
-- ----------------------------
CREATE TABLE `mod_persons` (
  `mod_person_id` int NOT NULL AUTO_INCREMENT 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_general_ci 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',
  PRIMARY KEY (`mod_person_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_persons
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_persons_types
-- ----------------------------
CREATE TABLE `mod_persons_types` (
  `mod_person_type_id` int NOT NULL AUTO_INCREMENT 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_general_ci COMMENT 'Datos adicionales en formato JSON',
  `mod_person_type_state` int DEFAULT '1' COMMENT 'Estado lógico del tipo (0: inactivo, 1: activo)',
  PRIMARY KEY (`mod_person_type_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_persons_types
-- ----------------------------
BEGIN;
INSERT INTO `mod_persons_types` VALUES (1, 'LEAD', 'Lead', 'Posible cliente potencial', NULL, 1);
INSERT INTO `mod_persons_types` VALUES (2, 'CUSTOMER', 'Cliente', 'Cliente activo', NULL, 1);
INSERT INTO `mod_persons_types` VALUES (3, 'PROVIDER', 'Proveedor', 'Proveedor de servicios o productos', NULL, 1);
COMMIT;

-- ----------------------------
-- Table structure for mod_pim_attribute_values
-- ----------------------------
CREATE TABLE `mod_pim_attribute_values` (
  `mod_pv_id` bigint unsigned NOT NULL AUTO_INCREMENT 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")',
  PRIMARY KEY (`mod_pv_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Valores de atributos dinámicos (EAV) para cada SKU';

-- ----------------------------
-- Records of mod_pim_attribute_values
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_pim_attributes
-- ----------------------------
CREATE TABLE `mod_pim_attributes` (
  `mod_pa_id` int unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_pa_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Definición de atributos dinámicos (EAV)';

-- ----------------------------
-- Records of mod_pim_attributes
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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',
  PRIMARY KEY (`mod_pcam_pc_id`,`mod_pcam_pa_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Mapeo de qué atributos aplican a qué categorías';

-- ----------------------------
-- Records of mod_pim_category_attribute_map
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_pim_collections
-- ----------------------------
CREATE TABLE `mod_pim_collections` (
  `mod_pcol_id` int unsigned NOT NULL AUTO_INCREMENT 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)',
  PRIMARY KEY (`mod_pcol_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Jerarquía de Colecciones de Productos';

-- ----------------------------
-- Records of mod_pim_collections
-- ----------------------------
BEGIN;
INSERT INTO `mod_pim_collections` VALUES (1, 'coleccion 1', '', '', '', '', '', '2025-10-19 02:56:10', 1, 1, '2025-10-19 22:21:23', 1);
INSERT INTO `mod_pim_collections` VALUES (2, 'coleccion 2', '', '', '', '', '', '2025-10-19 22:21:07', 1, 1, '2025-10-19 22:21:07', 1);
COMMIT;

-- ----------------------------
-- Table structure for mod_pim_config
-- ----------------------------
CREATE TABLE `mod_pim_config` (
  `mod_pconf_id` int unsigned NOT NULL AUTO_INCREMENT 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',
  PRIMARY KEY (`mod_pconf_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Configuraciones del módulo PIM (Key-Value Store)';

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

-- ----------------------------
-- Table structure for mod_pim_products
-- ----------------------------
CREATE TABLE `mod_pim_products` (
  `mod_pp_id` bigint unsigned NOT NULL AUTO_INCREMENT 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)',
  PRIMARY KEY (`mod_pp_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Producto Base (Entidad Lógica) y sus detalles principales';

-- ----------------------------
-- Records of mod_pim_products
-- ----------------------------
BEGIN;
INSERT INTO `mod_pim_products` VALUES (1, 'prueba 3', '<p>description</p>', 'tags', 1, 1, '2025-10-19 19:20:14', '2025-10-19 19:20:14', '', 1);
INSERT INTO `mod_pim_products` VALUES (2, 'prueba 4', '<p>descripción</p>', 'tag', 1, 1, '2025-10-19 21:35:40', '2025-10-19 21:58:19', 'json', 1);
COMMIT;

-- ----------------------------
-- Table structure for 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',
  PRIMARY KEY (`mod_ppc_pp_id`,`mod_ppc_cat_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Relación Muchos a Muchos entre Productos y Categorías';

-- ----------------------------
-- Records of mod_pim_products_categorys
-- ----------------------------
BEGIN;
INSERT INTO `mod_pim_products_categorys` VALUES (1, 2, 3);
INSERT INTO `mod_pim_products_categorys` VALUES (1, 5, 1);
INSERT INTO `mod_pim_products_categorys` VALUES (1, 6, 2);
INSERT INTO `mod_pim_products_categorys` VALUES (2, 4, 1);
COMMIT;

-- ----------------------------
-- Table structure for 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',
  PRIMARY KEY (`mod_ppcol_pp_id`,`mod_ppcol_pcol_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Relación Muchos a Muchos entre Productos y Colecciones';

-- ----------------------------
-- Records of mod_pim_products_collections
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for 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',
  PRIMARY KEY (`mod_ppf_pp_id`,`mod_ppf_file_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Relación Muchos a Muchos entre Productos y Archivos';

-- ----------------------------
-- Records of mod_pim_products_files
-- ----------------------------
BEGIN;
INSERT INTO `mod_pim_products_files` VALUES (1, 93, 1);
COMMIT;

-- ----------------------------
-- Table structure for mod_pim_skus
-- ----------------------------
CREATE TABLE `mod_pim_skus` (
  `mod_ps_id` bigint unsigned NOT NULL AUTO_INCREMENT 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)',
  PRIMARY KEY (`mod_ps_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Variantes de producto - Unidad Transaccional/Inventario';

-- ----------------------------
-- Records of mod_pim_skus
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for mod_places
-- ----------------------------
CREATE TABLE `mod_places` (
  `mod_plc_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID de plc',
  `mod_plc_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Nombre del registro',
  `mod_plc_tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc tags',
  `mod_plc_json` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Datos adicionales en formato JSON',
  `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 COMMENT 'Valor de mod plc city',
  `mod_plc_country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc country',
  `mod_plc_phone` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Número de teléfono',
  `mod_plc_celular_whatsapp` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc celular whatsapp',
  `mod_plc_info` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc info',
  `mod_plc_img` int NOT NULL COMMENT 'Valor de mod plc img',
  `mod_plc_profile_icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc profile icon',
  `mod_plc_main_coord` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc main coord',
  `mod_plc_perimeter` varchar(455) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc perimeter',
  `mod_plc_map_icon` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc map icon',
  `mod_plc_content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc content',
  `mod_plc_acu_id` int NOT NULL DEFAULT '0' COMMENT 'ID de plc acu',
  `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' COMMENT 'Valor de mod plc ranking',
  `mod_plc_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Código interno',
  `mod_plc_map_ubication` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Valor de mod plc map ubication',
  `mod_plc_24h` int NOT NULL COMMENT 'Valor de mod plc 24h',
  `mod_plc_ent_id` int DEFAULT NULL COMMENT 'ID de la entidad',
  `mod_plc_user_id` int DEFAULT NULL COMMENT 'ID del usuario',
  `mod_plc_state` int NOT NULL COMMENT 'Estado del registro',
  PRIMARY KEY (`mod_plc_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of mod_places
-- ----------------------------
BEGIN;
COMMIT;

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