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

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

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

--
-- Indices de la tabla `mod_accounts_addresses`
--
ALTER TABLE `mod_accounts_addresses`
  ADD PRIMARY KEY (`mod_acu_add_acu_id`,`mod_acu_add_add_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_accounts_ads`
--
ALTER TABLE `mod_accounts_ads`
  ADD PRIMARY KEY (`mod_aca_id`,`mod_aca_cen_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_accounts_ads`
--
ALTER TABLE `mod_accounts_ads`
  MODIFY `mod_aca_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_accounts_invoices_data`
--
ALTER TABLE `mod_accounts_invoices_data`
  ADD PRIMARY KEY (`mod_acu_invd_id`,`mod_acu_invd_acu_id`,`mod_acu_invd_nit`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_accounts_invoices_data`
--
ALTER TABLE `mod_accounts_invoices_data`
  MODIFY `mod_acu_invd_id` int NOT NULL AUTO_INCREMENT;

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

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

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

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

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

--
-- Indices de la tabla `mod_accounts_plans`
--
ALTER TABLE `mod_accounts_plans`
  ADD PRIMARY KEY (`mod_ap_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_accounts_plans`
--
ALTER TABLE `mod_accounts_plans`
  MODIFY `mod_ap_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

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

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

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

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

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

--
-- Indices de la tabla `mod_accounts_roles`
--
ALTER TABLE `mod_accounts_roles`
  ADD PRIMARY KEY (`mod_acu_rol_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_accounts_roles`
--
ALTER TABLE `mod_accounts_roles`
  MODIFY `mod_acu_rol_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

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

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

--
-- Indices de la tabla `mod_accounts_services`
--
ALTER TABLE `mod_accounts_services`
  ADD PRIMARY KEY (`mod_acu_sv_sv_id`,`mod_acu_sv_acu_id`) USING BTREE;

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

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

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

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

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

--
-- Indices de la tabla `mod_accounts_users_plans`
--
ALTER TABLE `mod_accounts_users_plans`
  ADD PRIMARY KEY (`mod_acu_ap_acu_id`,`mod_acu_ap_ap_id`,`mod_acu_ap_mode`) USING BTREE;

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

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

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

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

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

--
-- Indices de la tabla `mod_accounts_users_roles`
--
ALTER TABLE `mod_accounts_users_roles`
  ADD PRIMARY KEY (`mod_acu_user_rol_acu_id`,`mod_acu_user_rol_rol_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_actions`
--
ALTER TABLE `mod_actions`
  ADD PRIMARY KEY (`mod_act_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_actions`
--
ALTER TABLE `mod_actions`
  MODIFY `mod_act_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_actions_register`
--
ALTER TABLE `mod_actions_register`
  ADD PRIMARY KEY (`mod_act_reg_act_id`,`mod_act_reg_cpa_id`,`mod_act_reg_aca_id`,`mod_act_reg_acu_id`,`mod_act_reg_plc_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_acuse`
--
ALTER TABLE `mod_acuse`
  ADD PRIMARY KEY (`mod_ac_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_acuse`
--
ALTER TABLE `mod_acuse`
  MODIFY `mod_ac_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_addresses`
--
ALTER TABLE `mod_addresses`
  ADD PRIMARY KEY (`mod_add_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_addresses`
--
ALTER TABLE `mod_addresses`
  MODIFY `mod_add_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_addresses_logistics_distribution_zone`
--
ALTER TABLE `mod_addresses_logistics_distribution_zone`
  ADD PRIMARY KEY (`mod_add_ldz_add_id`,`mod_add_ldz_ldz_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_advised_calendars`
--
ALTER TABLE `mod_advised_calendars`
  ADD PRIMARY KEY (`mod_adv_cal_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_advised_calendars`
--
ALTER TABLE `mod_advised_calendars`
  MODIFY `mod_adv_cal_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_advised_calendars_blocked`
--
ALTER TABLE `mod_advised_calendars_blocked`
  ADD PRIMARY KEY (`mod_adv_cb_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_advised_calendars_blocked`
--
ALTER TABLE `mod_advised_calendars_blocked`
  MODIFY `mod_adv_cb_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_advised_counselors`
--
ALTER TABLE `mod_advised_counselors`
  ADD PRIMARY KEY (`mod_adv_cou_acu_id`,`mod_adv_cou_cou_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_advised_counselors_fields`
--
ALTER TABLE `mod_advised_counselors_fields`
  ADD PRIMARY KEY (`mod_adv_fds_user_id`,`mod_adv_fds_fds_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_advised_counselors_fields`
--
ALTER TABLE `mod_advised_counselors_fields`
  MODIFY `mod_adv_fds_user_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_advised_history`
--
ALTER TABLE `mod_advised_history`
  ADD PRIMARY KEY (`mod_adv_his_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_advised_history`
--
ALTER TABLE `mod_advised_history`
  MODIFY `mod_adv_his_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_advised_history_calendars`
--
ALTER TABLE `mod_advised_history_calendars`
  ADD PRIMARY KEY (`mod_adv_his_cal_cal_id`,`mod_adv_his_cal_his_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_advised_options`
--
ALTER TABLE `mod_advised_options`
  ADD PRIMARY KEY (`mod_adv_opt_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_advised_options`
--
ALTER TABLE `mod_advised_options`
  MODIFY `mod_adv_opt_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_advised_schedules`
--
ALTER TABLE `mod_advised_schedules`
  ADD PRIMARY KEY (`mod_adv_sch_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_advised_schedules`
--
ALTER TABLE `mod_advised_schedules`
  MODIFY `mod_adv_sch_id` int NOT NULL AUTO_INCREMENT;

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

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

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

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

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

--
-- Indices de la tabla `mod_advised_types_appointments`
--
ALTER TABLE `mod_advised_types_appointments`
  ADD PRIMARY KEY (`mod_adv_tya_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_advised_types_appointments`
--
ALTER TABLE `mod_advised_types_appointments`
  MODIFY `mod_adv_tya_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

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

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

--
-- Indices de la tabla `mod_advised_user`
--
ALTER TABLE `mod_advised_user`
  ADD PRIMARY KEY (`mod_adv_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_advised_user`
--
ALTER TABLE `mod_advised_user`
  MODIFY `mod_adv_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;

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

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

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

--
-- Indices de la tabla `mod_appointments_calendars`
--
ALTER TABLE `mod_appointments_calendars`
  ADD PRIMARY KEY (`mod_apt_cal_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_calendars`
--
ALTER TABLE `mod_appointments_calendars`
  MODIFY `mod_apt_cal_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la cita';

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

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

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

--
-- Indices de la tabla `mod_appointments_calendars_blocked`
--
ALTER TABLE `mod_appointments_calendars_blocked`
  ADD PRIMARY KEY (`mod_apt_cb_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_calendars_blocked`
--
ALTER TABLE `mod_appointments_calendars_blocked`
  MODIFY `mod_apt_cb_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_appointments_exceptions`
--
ALTER TABLE `mod_appointments_exceptions`
  ADD PRIMARY KEY (`mod_apt_exc_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_exceptions`
--
ALTER TABLE `mod_appointments_exceptions`
  MODIFY `mod_apt_exc_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_appointments_logs`
--
ALTER TABLE `mod_appointments_logs`
  ADD PRIMARY KEY (`mod_apt_log_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_logs`
--
ALTER TABLE `mod_appointments_logs`
  MODIFY `mod_apt_log_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_appointments_options`
--
ALTER TABLE `mod_appointments_options`
  ADD PRIMARY KEY (`mod_apt_opt_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_options`
--
ALTER TABLE `mod_appointments_options`
  MODIFY `mod_apt_opt_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_appointments_payments`
--
ALTER TABLE `mod_appointments_payments`
  ADD PRIMARY KEY (`mod_apt_pay_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_payments`
--
ALTER TABLE `mod_appointments_payments`
  MODIFY `mod_apt_pay_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id del pago';

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

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

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

--
-- Indices de la tabla `mod_appointments_reviews`
--
ALTER TABLE `mod_appointments_reviews`
  ADD PRIMARY KEY (`mod_apt_rev_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_reviews`
--
ALTER TABLE `mod_appointments_reviews`
  MODIFY `mod_apt_rev_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la reseña';

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

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

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

--
-- Indices de la tabla `mod_appointments_schedules`
--
ALTER TABLE `mod_appointments_schedules`
  ADD PRIMARY KEY (`mod_apt_sch_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_appointments_schedules`
--
ALTER TABLE `mod_appointments_schedules`
  MODIFY `mod_apt_sch_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_appointments_types`
--
ALTER TABLE `mod_appointments_types`
  ADD PRIMARY KEY (`mod_apt_type_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_brands`
--
ALTER TABLE `mod_brands`
  ADD PRIMARY KEY (`mod_brd_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_brands`
--
ALTER TABLE `mod_brands`
  MODIFY `mod_brd_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

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

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

--
-- Indices de la tabla `mod_campaigns_actions`
--
ALTER TABLE `mod_campaigns_actions`
  ADD PRIMARY KEY (`mod_cpa_act_cpa_id`,`mod_cpa_act_act_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_campaigns_ads`
--
ALTER TABLE `mod_campaigns_ads`
  ADD PRIMARY KEY (`mod_cpa_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_campaigns_ads`
--
ALTER TABLE `mod_campaigns_ads`
  MODIFY `mod_cpa_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_candire_campaigns`
--
ALTER TABLE `mod_candire_campaigns`
  ADD PRIMARY KEY (`mod_cnd_cp_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_candire_campaigns`
--
ALTER TABLE `mod_candire_campaigns`
  MODIFY `mod_cnd_cp_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_carts`
--
ALTER TABLE `mod_carts`
  ADD PRIMARY KEY (`mod_cart_id`,`mod_cart_acu_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_carts`
--
ALTER TABLE `mod_carts`
  MODIFY `mod_cart_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_carts_products`
--
ALTER TABLE `mod_carts_products`
  ADD PRIMARY KEY (`mod_cart_prod_cart_id`,`mod_cart_prod_prod_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_classification_info`
--
ALTER TABLE `mod_classification_info`
  ADD PRIMARY KEY (`mod_clsi_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_classification_info`
--
ALTER TABLE `mod_classification_info`
  MODIFY `mod_clsi_id` int NOT NULL AUTO_INCREMENT;

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

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

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

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

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

--
-- Indices de la tabla `mod_customers_enterprises`
--
ALTER TABLE `mod_customers_enterprises`
  ADD PRIMARY KEY (`mod_cen_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_customers_enterprises`
--
ALTER TABLE `mod_customers_enterprises`
  MODIFY `mod_cen_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

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

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

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

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

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

--
-- Indices de la tabla `mod_customers_enterprises_data`
--
ALTER TABLE `mod_customers_enterprises_data`
  ADD PRIMARY KEY (`mod_cen_data_id`,`mod_cen_data_cen_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_customers_enterprises_data`
--
ALTER TABLE `mod_customers_enterprises_data`
  MODIFY `mod_cen_data_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

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

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

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

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

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

--
-- Indices de la tabla `mod_customers_options`
--
ALTER TABLE `mod_customers_options`
  ADD PRIMARY KEY (`mod_cop_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_customers_options`
--
ALTER TABLE `mod_customers_options`
  MODIFY `mod_cop_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de opción', AUTO_INCREMENT=11;

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

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

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

--
-- Indices de la tabla `mod_customers_persons`
--
ALTER TABLE `mod_customers_persons`
  ADD PRIMARY KEY (`mod_cpe_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_customers_persons`
--
ALTER TABLE `mod_customers_persons`
  MODIFY `mod_cpe_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_departments`
--
ALTER TABLE `mod_departments`
  ADD PRIMARY KEY (`mod_dep_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_departments`
--
ALTER TABLE `mod_departments`
  MODIFY `mod_dep_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

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

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

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

--
-- Indices de la tabla `mod_discount`
--
ALTER TABLE `mod_discount`
  ADD PRIMARY KEY (`mod_dis_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_discount`
--
ALTER TABLE `mod_discount`
  MODIFY `mod_dis_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

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

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

--
-- Indices de la tabla `mod_discount_products`
--
ALTER TABLE `mod_discount_products`
  ADD PRIMARY KEY (`mod_dis_prod_dis_id`,`mod_dis_prod_prod_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_external_docs_options`
--
ALTER TABLE `mod_external_docs_options`
  ADD PRIMARY KEY (`mod_edc_opt_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_external_docs_options`
--
ALTER TABLE `mod_external_docs_options`
  MODIFY `mod_edc_opt_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_external_docs_page_design`
--
ALTER TABLE `mod_external_docs_page_design`
  ADD PRIMARY KEY (`mod_edc_pd_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_external_docs_page_design`
--
ALTER TABLE `mod_external_docs_page_design`
  MODIFY `mod_edc_pd_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_external_docs_templates`
--
ALTER TABLE `mod_external_docs_templates`
  ADD PRIMARY KEY (`mod_edc_tpl_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_external_docs_templates`
--
ALTER TABLE `mod_external_docs_templates`
  MODIFY `mod_edc_tpl_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_external_docs_types`
--
ALTER TABLE `mod_external_docs_types`
  ADD PRIMARY KEY (`mod_edc_type_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_external_docs_types`
--
ALTER TABLE `mod_external_docs_types`
  MODIFY `mod_edc_type_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_ganador_ganaderos`
--
ALTER TABLE `mod_ganador_ganaderos`
  ADD PRIMARY KEY (`mod_ggd_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_ganador_ganaderos`
--
ALTER TABLE `mod_ganador_ganaderos`
  MODIFY `mod_ggd_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_ganador_ganaderos_propiedades`
--
ALTER TABLE `mod_ganador_ganaderos_propiedades`
  ADD PRIMARY KEY (`mod_ggp_ggd_id`,`mod_ggp_gpr_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_ganador_propiedades`
--
ALTER TABLE `mod_ganador_propiedades`
  ADD PRIMARY KEY (`mod_gpr_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_ganador_propiedades`
--
ALTER TABLE `mod_ganador_propiedades`
  MODIFY `mod_gpr_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_ganador_propiedades_files`
--
ALTER TABLE `mod_ganador_propiedades_files`
  ADD PRIMARY KEY (`mod_gpf_file_id`,`mod_gpf_gpr_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_ganador_propiedades_images`
--
ALTER TABLE `mod_ganador_propiedades_images`
  ADD PRIMARY KEY (`mod_gpi_img_id`,`mod_gpi_gpr_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_ganador_proyectos`
--
ALTER TABLE `mod_ganador_proyectos`
  ADD PRIMARY KEY (`mod_gp_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_ganador_proyectos`
--
ALTER TABLE `mod_ganador_proyectos`
  MODIFY `mod_gp_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_hrm_employees`
--
ALTER TABLE `mod_hrm_employees`
  ADD PRIMARY KEY (`mod_he_id`) USING BTREE,
  ADD UNIQUE KEY `mod_he_code` (`mod_he_code`) USING BTREE,
  ADD UNIQUE KEY `mod_he_email` (`mod_he_email`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_hrm_employees`
--
ALTER TABLE `mod_hrm_employees`
  MODIFY `mod_he_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único del empleado';

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

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

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

--
-- Indices de la tabla `mod_hrm_positions`
--
ALTER TABLE `mod_hrm_positions`
  ADD PRIMARY KEY (`mod_hp_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_hrm_positions`
--
ALTER TABLE `mod_hrm_positions`
  MODIFY `mod_hp_id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identificador único de la posición';

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

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

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

--
-- Indices de la tabla `mod_invoices`
--
ALTER TABLE `mod_invoices`
  ADD PRIMARY KEY (`mod_inv_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_invoices`
--
ALTER TABLE `mod_invoices`
  MODIFY `mod_inv_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_jobtitle`
--
ALTER TABLE `mod_jobtitle`
  ADD PRIMARY KEY (`mod_jbt_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_jobtitle`
--
ALTER TABLE `mod_jobtitle`
  MODIFY `mod_jbt_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

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

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

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

--
-- Indices de la tabla `mod_kardex`
--
ALTER TABLE `mod_kardex`
  ADD PRIMARY KEY (`mod_kdx_id`,`mod_kdx_user_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_kardex`
--
ALTER TABLE `mod_kardex`
  MODIFY `mod_kdx_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10012;

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

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

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

--
-- Indices de la tabla `mod_kardex_jobtitle`
--
ALTER TABLE `mod_kardex_jobtitle`
  ADD PRIMARY KEY (`mod_kdx_jbt_jbt_id`,`mod_kdx_jbt_kdx_id`,`mod_kdx_jbt_ent_id`) USING BTREE;

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

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

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

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

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

--
-- Indices de la tabla `mod_leagues`
--
ALTER TABLE `mod_leagues`
  ADD PRIMARY KEY (`mod_lg_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_leagues`
--
ALTER TABLE `mod_leagues`
  MODIFY `mod_lg_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

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

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

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

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

--
-- Indices de la tabla `mod_leagues_divisions`
--
ALTER TABLE `mod_leagues_divisions`
  ADD PRIMARY KEY (`mod_lg_div_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_leagues_divisions`
--
ALTER TABLE `mod_leagues_divisions`
  MODIFY `mod_lg_div_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

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

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

--
-- Indices de la tabla `mod_leagues_divisions_teams`
--
ALTER TABLE `mod_leagues_divisions_teams`
  ADD PRIMARY KEY (`mod_lg_div_tm_div_id`,`mod_lg_div_tm_tm_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_logistics_distribution_move`
--
ALTER TABLE `mod_logistics_distribution_move`
  ADD PRIMARY KEY (`mod_log_dtz_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_logistics_distribution_move`
--
ALTER TABLE `mod_logistics_distribution_move`
  MODIFY `mod_log_dtz_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_logistics_distribution_zone`
--
ALTER TABLE `mod_logistics_distribution_zone`
  ADD PRIMARY KEY (`mod_log_dtz_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_logistics_distribution_zone`
--
ALTER TABLE `mod_logistics_distribution_zone`
  MODIFY `mod_log_dtz_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

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

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

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

--
-- Indices de la tabla `mod_make`
--
ALTER TABLE `mod_make`
  ADD PRIMARY KEY (`mod_mak_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_make`
--
ALTER TABLE `mod_make`
  MODIFY `mod_mak_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_management`
--
ALTER TABLE `mod_management`
  ADD PRIMARY KEY (`mod_mag_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_management`
--
ALTER TABLE `mod_management`
  MODIFY `mod_mag_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_organization_chart`
--
ALTER TABLE `mod_organization_chart`
  ADD PRIMARY KEY (`mod_orc_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_organization_chart`
--
ALTER TABLE `mod_organization_chart`
  MODIFY `mod_orc_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_organization_chart_rel`
--
ALTER TABLE `mod_organization_chart_rel`
  ADD PRIMARY KEY (`mod_orc_rel_orc_id`,`mod_orc_rel_user_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_pay_tx_suscriptions`
--
ALTER TABLE `mod_pay_tx_suscriptions`
  ADD PRIMARY KEY (`mod_pay_tx_sbs_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_pay_tx_suscriptions`
--
ALTER TABLE `mod_pay_tx_suscriptions`
  MODIFY `mod_pay_tx_sbs_id` bigint NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_pay_tx_temp`
--
ALTER TABLE `mod_pay_tx_temp`
  ADD PRIMARY KEY (`mod_pay_tx_tmp_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_pay_tx_temp`
--
ALTER TABLE `mod_pay_tx_temp`
  MODIFY `mod_pay_tx_tmp_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_pay_tx_tickets`
--
ALTER TABLE `mod_pay_tx_tickets`
  ADD PRIMARY KEY (`mod_pay_tx_tck_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_pay_tx_tickets`
--
ALTER TABLE `mod_pay_tx_tickets`
  MODIFY `mod_pay_tx_tck_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_persons`
--
ALTER TABLE `mod_persons`
  ADD PRIMARY KEY (`mod_person_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_persons`
--
ALTER TABLE `mod_persons`
  MODIFY `mod_person_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único de la persona';

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

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

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

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

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

--
-- Indices de la tabla `mod_persons_types`
--
ALTER TABLE `mod_persons_types`
  ADD PRIMARY KEY (`mod_person_type_id`) USING BTREE,
  ADD UNIQUE KEY `mod_person_type_code_UNIQUE` (`mod_person_type_code`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_persons_types`
--
ALTER TABLE `mod_persons_types`
  MODIFY `mod_person_type_id` int NOT NULL AUTO_INCREMENT COMMENT 'Id único del tipo de persona', AUTO_INCREMENT=4;

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

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

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

--
-- Indices de la tabla `mod_places`
--
ALTER TABLE `mod_places`
  ADD PRIMARY KEY (`mod_plc_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_places`
--
ALTER TABLE `mod_places`
  MODIFY `mod_plc_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_places_accounts_ads`
--
ALTER TABLE `mod_places_accounts_ads`
  ADD PRIMARY KEY (`mod_plc_aca_aca_id`,`mod_plc_aca_plc_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_places_categorys`
--
ALTER TABLE `mod_places_categorys`
  ADD PRIMARY KEY (`mod_plc_cat_plc_id`,`mod_plc_cat_cat_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_prices_list`
--
ALTER TABLE `mod_prices_list`
  ADD PRIMARY KEY (`mod_prl_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_prices_list`
--
ALTER TABLE `mod_prices_list`
  MODIFY `mod_prl_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_producers`
--
ALTER TABLE `mod_producers`
  ADD PRIMARY KEY (`mod_prd_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_producers`
--
ALTER TABLE `mod_producers`
  MODIFY `mod_prd_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_providers`
--
ALTER TABLE `mod_providers`
  ADD PRIMARY KEY (`mod_prov_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_providers`
--
ALTER TABLE `mod_providers`
  MODIFY `mod_prov_id` int NOT NULL AUTO_INCREMENT;

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

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

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

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

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

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

--
-- Indices de la tabla `mod_rewards_register`
--
ALTER TABLE `mod_rewards_register`
  ADD PRIMARY KEY (`mod_rwd_reg_rwd_id`,`mod_rwd_reg_acu_id`,`mod_rwd_reg_cpa_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_services`
--
ALTER TABLE `mod_services`
  ADD PRIMARY KEY (`mod_srv_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_services`
--
ALTER TABLE `mod_services`
  MODIFY `mod_srv_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_services_roles`
--
ALTER TABLE `mod_services_roles`
  ADD PRIMARY KEY (`mod_srv_id`) USING BTREE;

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

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

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

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

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

--
-- Indices de la tabla `mod_sliders`
--
ALTER TABLE `mod_sliders`
  ADD PRIMARY KEY (`mod_sli_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_sliders`
--
ALTER TABLE `mod_sliders`
  MODIFY `mod_sli_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

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

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

--
-- Indices de la tabla `mod_sliders_categorys`
--
ALTER TABLE `mod_sliders_categorys`
  ADD PRIMARY KEY (`mod_sli_cat_sli_id`,`mod_sli_cat_cat_id`) USING BTREE;

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

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

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

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

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

--
-- Indices de la tabla `mod_sliders_files`
--
ALTER TABLE `mod_sliders_files`
  ADD PRIMARY KEY (`mod_sli_file_id`) USING BTREE,
  ADD KEY `idx_slider_id` (`mod_sli_file_sli_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_sliders_files`
--
ALTER TABLE `mod_sliders_files`
  MODIFY `mod_sli_file_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

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

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

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

--
-- Indices de la tabla `mod_stock`
--
ALTER TABLE `mod_stock`
  ADD PRIMARY KEY (`mod_stk_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_stock`
--
ALTER TABLE `mod_stock`
  MODIFY `mod_stk_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_stock_receipt`
--
ALTER TABLE `mod_stock_receipt`
  ADD PRIMARY KEY (`mod_str_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_stock_receipt`
--
ALTER TABLE `mod_stock_receipt`
  MODIFY `mod_str_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_surveys`
--
ALTER TABLE `mod_surveys`
  ADD PRIMARY KEY (`mod_svy_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_surveys`
--
ALTER TABLE `mod_surveys`
  MODIFY `mod_svy_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_surveys_options`
--
ALTER TABLE `mod_surveys_options`
  ADD PRIMARY KEY (`mod_svy_so_id`) USING BTREE,
  ADD KEY `mod_so_sq_id` (`mod_svy_so_sq_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_surveys_options`
--
ALTER TABLE `mod_surveys_options`
  MODIFY `mod_svy_so_id` int NOT NULL AUTO_INCREMENT;

--
-- Restricciones para tablas volcadas
--

--
-- Filtros para la tabla `mod_surveys_options`
--
ALTER TABLE `mod_surveys_options`
  ADD CONSTRAINT `mod_surveys_options_ibfk_1` FOREIGN KEY (`mod_svy_so_sq_id`) REFERENCES `mod_surveys_questions` (`mod_svy_sq_id`) ON DELETE RESTRICT ON UPDATE RESTRICT;

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

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

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

--
-- Indices de la tabla `mod_surveys_questions`
--
ALTER TABLE `mod_surveys_questions`
  ADD PRIMARY KEY (`mod_svy_sq_id`) USING BTREE,
  ADD KEY `mod_sq_svy_id` (`mod_svy_sq_svy_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_surveys_questions`
--
ALTER TABLE `mod_surveys_questions`
  MODIFY `mod_svy_sq_id` int NOT NULL AUTO_INCREMENT;

--
-- Filtros para la tabla `mod_surveys_questions`
--
ALTER TABLE `mod_surveys_questions`
  ADD CONSTRAINT `mod_surveys_questions_ibfk_1` FOREIGN KEY (`mod_svy_sq_svy_id`) REFERENCES `mod_surveys` (`mod_svy_id`) ON DELETE RESTRICT ON UPDATE RESTRICT;

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

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

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

--
-- Indices de la tabla `mod_syllabus`
--
ALTER TABLE `mod_syllabus`
  ADD PRIMARY KEY (`mod_syl_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_syllabus`
--
ALTER TABLE `mod_syllabus`
  MODIFY `mod_syl_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_syllabus_categorys`
--
ALTER TABLE `mod_syllabus_categorys`
  ADD PRIMARY KEY (`mod_syl_cat_syl_id`,`mod_syl_cat_cat_id`) USING BTREE;

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

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

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

--
-- Indices de la tabla `mod_syllabus_contents`
--
ALTER TABLE `mod_syllabus_contents`
  ADD PRIMARY KEY (`mod_syl_cont_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_syllabus_contents`
--
ALTER TABLE `mod_syllabus_contents`
  MODIFY `mod_syl_cont_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_syllabus_periods`
--
ALTER TABLE `mod_syllabus_periods`
  ADD PRIMARY KEY (`mod_syl_per_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_syllabus_periods`
--
ALTER TABLE `mod_syllabus_periods`
  MODIFY `mod_syl_per_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_syllabus_relations_periods`
--
ALTER TABLE `mod_syllabus_relations_periods`
  ADD PRIMARY KEY (`mod_syl_rel_per_syl_id`,`mod_syl_rel_per_per_id`) USING BTREE;

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

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

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

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

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

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

--
-- Indices de la tabla `mod_tributes_facturas_cliente`
--
ALTER TABLE `mod_tributes_facturas_cliente`
  ADD PRIMARY KEY (`mod_tb_fac_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_facturas_cliente`
--
ALTER TABLE `mod_tributes_facturas_cliente`
  MODIFY `mod_tb_fac_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_tributes_facturas_filter`
--
ALTER TABLE `mod_tributes_facturas_filter`
  ADD PRIMARY KEY (`mod_tb_fcf_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_facturas_filter`
--
ALTER TABLE `mod_tributes_facturas_filter`
  MODIFY `mod_tb_fcf_id` int NOT NULL AUTO_INCREMENT;

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

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

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

--
-- Indices de la tabla `mod_tributes_options`
--
ALTER TABLE `mod_tributes_options`
  ADD PRIMARY KEY (`mod_tb_op_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_options`
--
ALTER TABLE `mod_tributes_options`
  MODIFY `mod_tb_op_id` int NOT NULL AUTO_INCREMENT;

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

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

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

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

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

--
-- Indices de la tabla `mod_tributes_periods`
--
ALTER TABLE `mod_tributes_periods`
  ADD PRIMARY KEY (`mod_tb_pr_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_periods`
--
ALTER TABLE `mod_tributes_periods`
  MODIFY `mod_tb_pr_id` int NOT NULL AUTO_INCREMENT COMMENT 'ej:202409 se refiere al periodo 2024-09 año/mes siempre seran 6 digitos', AUTO_INCREMENT=202513;

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

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

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

--
-- Indices de la tabla `mod_tributes_plans_periods`
--
ALTER TABLE `mod_tributes_plans_periods`
  ADD PRIMARY KEY (`mod_tb_plpr_cpe_id`,`mod_tb_plpr_pl_id`,`mod_tb_plpr_pr_id`) USING BTREE;

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

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

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

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

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

--
-- Indices de la tabla `mod_tributes_relations_periods`
--
ALTER TABLE `mod_tributes_relations_periods`
  ADD PRIMARY KEY (`mod_tb_rpd_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_tributes_relations_periods`
--
ALTER TABLE `mod_tributes_relations_periods`
  MODIFY `mod_tb_rpd_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

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

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

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

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

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

--
-- Indices de la tabla `mod_types_contribuyentes`
--
ALTER TABLE `mod_types_contribuyentes`
  ADD PRIMARY KEY (`mod_typc_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_types_contribuyentes`
--
ALTER TABLE `mod_types_contribuyentes`
  MODIFY `mod_typc_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

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

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

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

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

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

--
-- Indices de la tabla `mod_types_forms`
--
ALTER TABLE `mod_types_forms`
  ADD PRIMARY KEY (`mod_type_form_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_types_forms`
--
ALTER TABLE `mod_types_forms`
  MODIFY `mod_type_form_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=611;

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

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

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

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

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

--
-- Indices de la tabla `mod_types_oficios`
--
ALTER TABLE `mod_types_oficios`
  ADD PRIMARY KEY (`mod_tb_tof_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_types_oficios`
--
ALTER TABLE `mod_types_oficios`
  MODIFY `mod_tb_tof_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

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

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

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

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

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

--
-- Indices de la tabla `mod_validme_applicants`
--
ALTER TABLE `mod_validme_applicants`
  ADD PRIMARY KEY (`mod_va_id`) USING BTREE,
  ADD UNIQUE KEY `mod_va_email` (`mod_va_email`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_validme_applicants`
--
ALTER TABLE `mod_validme_applicants`
  MODIFY `mod_va_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

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

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

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

--
-- Indices de la tabla `mod_validme_callback_logs`
--
ALTER TABLE `mod_validme_callback_logs`
  ADD PRIMARY KEY (`mod_vcl_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_validme_callback_logs`
--
ALTER TABLE `mod_validme_callback_logs`
  MODIFY `mod_vcl_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único del log';

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

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

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

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

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

--
-- Indices de la tabla `mod_validme_checks`
--
ALTER TABLE `mod_validme_checks`
  ADD PRIMARY KEY (`mod_vc_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_validme_checks`
--
ALTER TABLE `mod_validme_checks`
  MODIFY `mod_vc_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

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

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

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

--
-- Indices de la tabla `mod_validme_options`
--
ALTER TABLE `mod_validme_options`
  ADD PRIMARY KEY (`mod_vo_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_validme_options`
--
ALTER TABLE `mod_validme_options`
  MODIFY `mod_vo_id` int NOT NULL AUTO_INCREMENT COMMENT 'ID único de opción';

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

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

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

--
-- Indices de la tabla `mod_warehouses`
--
ALTER TABLE `mod_warehouses`
  ADD PRIMARY KEY (`mod_wrh_id`) USING BTREE;

--
-- AUTO_INCREMENT de la tabla `mod_warehouses`
--
ALTER TABLE `mod_warehouses`
  MODIFY `mod_wrh_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
