diff --git a/webapp/services/import_services/datex2/v3_5/datex2_v3_5_json_static_mapper.py b/webapp/services/import_services/datex2/v3_5/datex2_v3_5_json_static_mapper.py index 12e1c488..8f6dbed9 100644 --- a/webapp/services/import_services/datex2/v3_5/datex2_v3_5_json_static_mapper.py +++ b/webapp/services/import_services/datex2/v3_5/datex2_v3_5_json_static_mapper.py @@ -354,6 +354,17 @@ def _apply_energy_infrastructure_stations( location.charging_pool.append(charge_station) + # Some sources (e.g. Taubert) provide the operator / owner only on station level. Use it as a + # fallback if the site did not provide one. + if location.operator is None: + operator = self._organization_to_business(energy_infrastructure_station.operator) + if operator: + location.operator = operator + if location.owner is None: + owner = self._organization_to_business(energy_infrastructure_station.owner) + if owner: + location.owner = owner + for refill_point in energy_infrastructure_station.refillPoint: self._apply_refill_point(refill_point, charge_station, location, source) diff --git a/webapp/services/import_services/datex2/v3_7/datex2_v3_7_json_static_mapper.py b/webapp/services/import_services/datex2/v3_7/datex2_v3_7_json_static_mapper.py index e941c6cc..08e3c3f0 100644 --- a/webapp/services/import_services/datex2/v3_7/datex2_v3_7_json_static_mapper.py +++ b/webapp/services/import_services/datex2/v3_7/datex2_v3_7_json_static_mapper.py @@ -345,6 +345,17 @@ def _apply_energy_infrastructure_stations( location.charging_pool.append(charge_station) + # Some sources (e.g. Taubert) provide the operator / owner only on station level. Use it as a + # fallback if the site did not provide one. + if location.operator is None: + operator = self._organization_to_business(energy_infrastructure_station.operator) + if operator: + location.operator = operator + if location.owner is None: + owner = self._organization_to_business(energy_infrastructure_station.owner) + if owner: + location.owner = owner + for refill_point in energy_infrastructure_station.refillPoint: self._apply_refill_point(refill_point, charge_station, location, source)