diff --git a/backend/Property.py b/backend/Property.py index 5507876a..fe848c26 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -365,7 +365,7 @@ class Property: for rec in property_recommendations_by_phase: # We simulate the impact of the recommendation at this current phase, and all of the prior phases - if rec["type"] == "mechanical_ventilation": + if rec["type"] in ["mechanical_ventilation", "trickle_vents", "draught_proofing"]: continue scoring_dict = self.create_recommendation_scoring_data( diff --git a/recommendations/DraughtProofingRecommendations.py b/recommendations/DraughtProofingRecommendations.py index fd6d4ee9..9ce9aa1b 100644 --- a/recommendations/DraughtProofingRecommendations.py +++ b/recommendations/DraughtProofingRecommendations.py @@ -8,7 +8,7 @@ class DraughtProofingRecommendations: self.recommendation = [] - def recommend(self): + def recommend(self, phase): """ In some cases, we can identify the need for draught proofing from the EPC recommendations, however the initial implementation of this class will just assume that we are picking up a non-invasive recommendation from the @@ -28,7 +28,7 @@ class DraughtProofingRecommendations: # We recommend installing two mechanical ventilation systems self.recommendation = [ { - "phase": None, + "phase": phase, "parts": [], "type": "draught_proofing", "description": description, diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index fa02c2c8..45169b30 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -137,8 +137,9 @@ class Recommendations: if "draught_proofing" in measures: # This is a recommendation that in some instances we can recommend, by deducing it from the SAP # recommendations, however we will implement this later - self.draught_proofing_recommender.recommend() + self.draught_proofing_recommender.recommend(phase=phase) property_recommendations.append(self.draught_proofing_recommender.recommendation) + phase += 1 if "floor_insulation" in measures: self.floor_recommender.recommend(phase=phase, measures=measures) @@ -154,7 +155,8 @@ class Recommendations: if "mixed_glazing" in measures: # This is a recommendation that comes exclusively from an energy assessment - property_recommendations.append(self.windows_recommender.recommend_mixed_glazing()) + property_recommendations.append(self.windows_recommender.recommend_mixed_glazing(phase=phase)) + phase += 1 if "fireplace" in measures: self.fireplace_recommender.recommend(phase=phase) diff --git a/recommendations/WindowsRecommendations.py b/recommendations/WindowsRecommendations.py index c74c2fac..137b721e 100644 --- a/recommendations/WindowsRecommendations.py +++ b/recommendations/WindowsRecommendations.py @@ -130,7 +130,7 @@ class WindowsRecommendations: } ] - def recommend_mixed_glazing(self): + def recommend_mixed_glazing(self, phase): """ This function will recommend mixed glazing to the property. This is a more specific recommendation than the general windows recommendation, but is almost certain to arise from a survey @@ -161,7 +161,7 @@ class WindowsRecommendations: return [ { - "phase": None, + "phase": phase, "parts": [], "type": "mixed_glazing", "description": description,