Entidades de Gestión¶
Esta sección cubre las 20 entidades del dominio mng_*, que representan los datos de configuración central del ecosistema AClimate.
MngCountry¶
Representa los países configurados en el sistema con códigos ISO.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| name | String(255) | NOT NULL | Nombre del país |
| iso2 | String(2) | NOT NULL | Código ISO 3166-1 alpha-2 |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngAdmin1, Forecast, MngCultivar, MngSoil, MngDataSource, UserAccess, MngCountryIndicator, MngCountryClimateMeasure
MngAdmin1¶
Divisiones administrativas de primer nivel (departamentos, estados, provincias) dentro de un país.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Identificador único |
| country_id | Integer | FK -> mng_country.id, NOT NULL | País padre |
| name | String(255) | NOT NULL | Nombre de la división |
| ext_id | String(255) | Default: '' | Identificador externo |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngCountry (padre), MngAdmin2 (hijos)
MngAdmin2¶
Divisiones administrativas de segundo nivel (municipios, distritos) dentro de un nivel admin 1.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Identificador único |
| admin_1_id | BigInteger | FK -> mng_admin_1.id, NOT NULL | Nivel admin 1 padre |
| name | String(255) | NOT NULL | Nombre de la división |
| ext_id | String(255) | Default: '' | Identificador externo |
| visible | Boolean | Default: true | Flag de visibilidad |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngAdmin1 (padre), MngLocation (hijos)
MngLocation¶
Ubicaciones geográficas que representan estaciones meteorológicas, puntos de monitoreo o puntos de interés.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Identificador único |
| admin_2_id | BigInteger | FK -> mng_admin_2.id, NOT NULL | Nivel admin 2 padre |
| source_id | Integer | FK -> mng_source.id, NOT NULL | Fuente de datos |
| name | String(255) | NOT NULL | Nombre de la ubicación |
| machine_name | String(120) | NOT NULL, UNIQUE | Identificador del sistema |
| ext_id | String(255) | NOT NULL | Identificador externo |
| latitude | Float | NOT NULL | Latitud geográfica |
| longitude | Float | NOT NULL | Longitud geográfica |
| altitude | Float | NOT NULL | Altitud en metros |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
| visible | Boolean | Default: true | Flag de visibilidad |
Índices: admin_2_id, source_id, ext_id, machine_name
Relaciones: MngAdmin2 (padre), MngSource (padre), ClimateHistoricalDaily, ClimateHistoricalMonthly, ClimateHistoricalClimatology, ClimateHistoricalIndicator, MngSeason, HistoricalAgroclimaticIndicator
MngCrop¶
Definiciones de tipos de cultivo.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| name | String(255) | NOT NULL | Nombre del cultivo |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngSoil, MngCultivar, MngPhenologicalStage, MngSeason
MngCultivar¶
Variedades de cultivares por país y cultivo.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| country_id | Integer | FK -> mng_country.id, NOT NULL | País |
| crop_id | Integer | FK -> mng_crop.id, NOT NULL | Cultivo padre |
| name | String(255) | NOT NULL | Nombre del cultivar |
| sort_order | Integer | NOT NULL | Orden de visualización |
| rainfed | Boolean | Default: false | Flag de agricultura de secano |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngCrop (padre), MngSetup (hijos), MngCountry (padre)
MngSoil¶
Definiciones de tipos de suelo por país y cultivo.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| country_id | Integer | FK -> mng_country.id, NOT NULL | País |
| crop_id | Integer | FK -> mng_crop.id, NOT NULL | Cultivo padre |
| name | String(255) | NOT NULL | Nombre del tipo de suelo |
| sort_order | Integer | NOT NULL | Orden de visualización |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngCrop (padre), MngSetup (hijos), MngCountry (padre)
MngSeason¶
Temporadas de cultivo definidas por ubicación y cultivo.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Identificador único |
| location_id | BigInteger | FK -> mng_location.id, NOT NULL | Ubicación |
| crop_id | Integer | FK -> mng_crop.id, NOT NULL | Tipo de cultivo |
| planting_start | Date | NOT NULL | Inicio de la ventana de siembra |
| planting_end | Date | NOT NULL | Fin de la ventana de siembra |
| season_start | Date | NOT NULL | Fecha de inicio de temporada |
| season_end | Date | NOT NULL | Fecha de fin de temporada |
| enable | Boolean | Default: true | Flag de borrado suave |
Relaciones: MngLocation (padre), MngCrop (padre), MngSetup (hijos)
MngSetup¶
Configuraciones de cultivo que conectan cultivares, suelos y temporadas.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Identificador único |
| cultivar_id | Integer | FK -> mng_cultivar.id, NOT NULL | Cultivar |
| soil_id | Integer | FK -> mng_soil.id, NOT NULL | Tipo de suelo |
| season_id | BigInteger | FK -> mng_season.id, NOT NULL | Temporada de cultivo |
| frequency | Integer | NOT NULL | Frecuencia de siembra |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngCultivar (padre), MngSoil (padre), MngSeason (padre), MngConfigurationFile (hijos)
MngSource¶
Definiciones de fuentes de datos que clasifican estaciones meteorológicas y orígenes de datos espaciales.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| name | String(255) | NOT NULL | Nombre de la fuente |
| source_type | Enum(SourceType) | NOT NULL | MA, AU, SP, PL, TP |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngLocation (hijos)
MngDataSource¶
Asignaciones de fuentes de datos por país.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| country_id | Integer | FK -> mng_country.id, NOT NULL | País |
| name | String(255) | NOT NULL | Nombre de la fuente de datos |
| description | Text | Descripción | |
| type | String(50) | NOT NULL | Tipo de fuente |
| enable | Boolean | Default: true | Flag de borrado suave |
| created_at | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| content | Text | Contenido |
Relaciones: MngCountry (padre)
MngClimateMeasure¶
Definiciones de medidas climáticas que describen variables climáticas medibles.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| name | String(150) | NOT NULL | Nombre de la medida |
| short_name | String(75) | NOT NULL | Nombre corto/código |
| unit | String(50) | NOT NULL | Unidad de medida |
| description | Text | Descripción | |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: ClimateHistoricalDaily, ClimateHistoricalMonthly, ClimateHistoricalClimatology, MngCountryClimateMeasure
MngIndicator¶
Definiciones de indicadores para índices climáticos y agroclimáticos.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| type | Enum(IndicatorsType) | NOT NULL | climate, agroclimatic, hydrological, scenario |
| name | String(150) | NOT NULL | Nombre del indicador |
| short_name | String(50) | NOT NULL | Nombre corto/código |
| unit | String(25) | NOT NULL | Unidad de medida |
| temporality | Enum(Period) | NOT NULL | daily, monthly, annual, etc. |
| description | Text | Descripción | |
| indicator_category_id | Integer | FK -> mng_indicator_category.id | Categoría |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: ClimateHistoricalIndicator, HistoricalAgroclimaticIndicator, MngCountryIndicator, MngIndicatorCategory
MngIndicatorCategory¶
Categorías para agrupar indicadores.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| name | String(100) | NOT NULL | Nombre de la categoría |
| description | Text | Descripción | |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngIndicator (hijos)
MngIndicatorsFeatures¶
Características asociadas con indicadores por país.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| country_indicator_id | Integer | FK -> mng_country_indicator.id, NOT NULL | Indicador por país padre |
| title | String(150) | NOT NULL | Título de la característica |
| description | Text | Descripción | |
| type | Enum(IndicatorFeatureType) | NOT NULL | recommendation o feature |
Relaciones: MngCountryIndicator (padre)
MngPhenologicalStage¶
Definiciones de etapas fenológicas de cultivos por cultivo.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| crop_id | Integer | FK -> mng_crop.id, NOT NULL | Cultivo padre |
| name | String(255) | NOT NULL | Nombre de la etapa |
| short_name | String(50) | Nombre corto | |
| description | Text | Descripción | |
| order_stage | Integer | NOT NULL | Orden de la etapa |
| duration_avg_day | Integer | Duración promedio en días | |
| start_model | String(100) | Parámetro de inicio del modelo | |
| end_model | String(100) | Parámetro de fin del modelo | |
| enable | Boolean | Default: true | Flag de borrado suave |
Relaciones: MngCrop (padre), HistoricalAgroclimaticIndicator, PhenologicalStageStress
MngStress¶
Definiciones de tipos de estrés para factores de estrés de cultivos.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| name | String(255) | NOT NULL | Nombre del estrés |
| short_name | String(100) | NOT NULL | Nombre corto/código |
| category | Enum(StressCategory) | NOT NULL | CROP o WEATHER |
| description | Text | Descripción | |
| enable | Boolean | Default: true | Flag de borrado suave |
Relaciones: PhenologicalStageStress (hijos)
MngConfigurationFile¶
Archivos de configuración asociados con configuraciones (setups).
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | BigInteger | PK, Auto-increment | Identificador único |
| setup_id | BigInteger | FK -> mng_setup.id, NOT NULL | Configuración padre |
| name | String(255) | NOT NULL | Nombre del archivo |
| path | String(255) | NOT NULL | Ruta del archivo |
| enable | Boolean | Default: true | Flag de borrado suave |
| register | DateTime(tz) | NOT NULL | Marca de tiempo de creación |
| updated | DateTime(tz) | NOT NULL | Marca de tiempo de última actualización |
Relaciones: MngSetup (padre)
MngCountryIndicator¶
Configuraciones de indicadores específicas por país.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| country_id | Integer | FK -> mng_country.id, NOT NULL | País |
| indicator_id | Integer | FK -> mng_indicators.id, NOT NULL | Indicador |
| spatial_forecast | Boolean | Default: false | Pronóstico espacial disponible |
| spatial_climate | Boolean | Default: false | Clima espacial disponible |
| location_forecast | Boolean | Default: false | Pronóstico por ubicación disponible |
| location_climate | Boolean | Default: false | Clima por ubicación disponible |
| criteria | JSON | Criterios de filtrado | |
| description | Text | Descripción | |
| store | String(255) | Identificador de tienda | |
| workspace | String(255) | Workspace de GeoServer |
Relaciones: MngCountry (padre), MngIndicator (padre), MngIndicatorsFeatures (hijos)
MngCountryClimateMeasure¶
Configuraciones de medidas climáticas específicas por país.
| Columna | Tipo | Restricciones | Descripción |
|---|---|---|---|
| id | Integer | PK, Auto-increment | Identificador único |
| country_id | Integer | FK -> mng_country.id, NOT NULL | País |
| measure_id | Integer | FK -> mng_climate_measure.id, NOT NULL | Medida climática |
| spatial_forecast | Boolean | Default: false | Pronóstico espacial disponible |
| spatial_climate | Boolean | Default: false | Clima espacial disponible |
| location_forecast | Boolean | Default: false | Pronóstico por ubicación disponible |
| location_climate | Boolean | Default: false | Clima por ubicación disponible |
| description | Text | Descripción | |
| store | String(255) | Identificador de tienda | |
| workspace | String(255) | Workspace de GeoServer |
Relaciones: MngCountry (padre), MngClimateMeasure (padre)