Skip to content

JSONB Fields

Several models use PostgreSQL JSONB columns for flexible, module-specific data.

config_data (EMS Configuration)

The structure of config_data depends on module_type.

{
  "l_extra": 10.0,
  "l_market_buy": 500.0,
  "l_market_sell": -500.0,
  "solver": "CPLEX"
}
Field Type Description
l_extra float Extra cost penalty (€/kWh) for constraint violations
l_market_buy float Upper bound on market buy price (€/kWh)
l_market_sell float Lower bound on market sell price (€/kWh, negative)
solver string MILP solver: CPLEX, CBC, or GLPK
{
  "gdbn_api_url": "https://api.gdbn.example.com",
  "gdbn_community_id": "ext-community-123"
}

calculation_metadata (Energy Setpoints)

Set by the EMS module after optimization. Schema varies by module.

{
  "solver_status": "optimal",
  "solve_time_ms": 234,
  "objective_value": -12.45,
  "horizon_start": "2024-01-15T00:00:00",
  "horizon_end": "2024-01-15T23:00:00"
}

offer_data (Flexibility Offers)

Module-specific offer metadata. For GDBN_BEFLEXIBLE:

{
  "gdbn_offer_reference": "offer-ref-456",
  "activation_window_minutes": 60,
  "product_type": "UP"
}

zone_metadata (Flexibility Zones)

{
  "country": "PT",
  "region": "Norte",
  "tso_zone_id": "PT_NORTH_1",
  "external_ids": {
    "gdbn": "zone-abc-123"
  }
}