diff --git a/backend/Property.py b/backend/Property.py index 3ed42266..0715c40c 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -48,6 +48,7 @@ class Property(BaseUtility): self.number_of_open_fireplaces = None self.number_of_extensions = None self.number_of_storeys = None + self.heat_loss_corridor = None if epc_client: self.epc_client = epc_client @@ -282,6 +283,22 @@ class Property(BaseUtility): # We don't know when the property was built self.year_built = None + def set_heat_loss_corridor(self): + """ + cleans the heat-loss-corridor + :return: + """ + map = { + "no corridor": False, + "unheated corridor": True, + "heated corridor": False + } + + if self.data["heat-loss-corridor"] in self.DATA_ANOMALY_MATCHES: + self.heat_loss_corridor = False + else: + self.heat_loss_corridor = map[self.data["heat-loss-corridor"]] + def _clean_upload_data(self, to_update): for k, v in to_update.items(): if v in self.DATA_ANOMALY_MATCHES: @@ -358,7 +375,7 @@ class Property(BaseUtility): "number_of_extensions": self.number_of_extensions, "number_of_storeys": self.number_of_storeys, "mains_gas": self.data["mains-gas-flag"], - "energy_tarrif": self.data["energy-tariff"], + "energy_tariff": self.data["energy-tariff"], "primary_energy_consumption": self.energy["primary_energy_consumption"], "co2_emissions": self.energy["co2_emissions"], } diff --git a/backend/app/db/models/portfolio.py b/backend/app/db/models/portfolio.py index f073459c..80bebee3 100644 --- a/backend/app/db/models/portfolio.py +++ b/backend/app/db/models/portfolio.py @@ -125,12 +125,13 @@ class PropertyDetailsEpcModel(Base): windows_rating = Column(Enum(FeatureRating, )) heating = Column(Text) heating_rating = Column(Enum(FeatureRating, )) - heating_contols = Column(Text) - heating_contols_rating = Column(Enum(FeatureRating, )) + heating_controls = Column(Text) + heating_controls_rating = Column(Enum(FeatureRating, )) hot_water = Column(Text) hot_water_rating = Column(Enum(FeatureRating, )) lighting = Column(Text) lighting_rating = Column(Enum(FeatureRating)) + mainfuel = Column(Text) ventilation = Column(Text) solar_pv = Column(Text) solar_hot_water = Column(Text)