cmabridge done for now

This commit is contained in:
Khalim Conn-Kowlessar 2025-01-14 14:29:04 +00:00
parent 75c5f0a712
commit 0af0e3a22a
3 changed files with 18 additions and 18 deletions

View file

@ -138,7 +138,7 @@ def upload_recommendations(session: Session, recommendations_to_upload, property
"recommendation_id": recommendation_id,
"material_id": part["id"],
"depth": int(part["depth"]) if part["depth"] else None,
"quantity": part["quantity"],
"quantity": float(part["quantity"]),
"quantity_unit": part["quantity_unit"],
"estimated_cost": part["total"],
}

View file

@ -753,22 +753,22 @@ async def trigger_plan(body: PlanTriggerRequest):
# Funding
# ~~~~~~~~~~~~~~~~
for p in input_properties:
funding_calulator = Funding(
tenure=body.housing_type,
starting_epc=p.data["current-energy-rating"],
starting_sap=int(p.data["current-energy-efficiency"]),
floor_area=p.floor_area,
council_tax_band=None, # This is seemingly always None at the moment
property_recommendations=recommendations[p.id],
project_scores_matrix=eco_project_scores_matrix,
gbis_abs_rate=20,
eco4_abs_rate=20,
)
funding_calulator.check_eligibiltiy()
# Insert finding
p.insert_funding(funding_calulator)
# for p in input_properties:
# funding_calulator = Funding(
# tenure=body.housing_type,
# starting_epc=p.data["current-energy-rating"],
# starting_sap=int(p.data["current-energy-efficiency"]),
# floor_area=p.floor_area,
# council_tax_band=None, # This is seemingly always None at the moment
# property_recommendations=recommendations[p.id],
# project_scores_matrix=eco_project_scores_matrix,
# gbis_abs_rate=20,
# eco4_abs_rate=20,
# )
# funding_calulator.check_eligibiltiy()
# # Insert finding
# p.insert_funding(funding_calulator)
logger.info("Uploading recommendations to the database")
# If we have any work to do, we create a new scenario
engine_scenario = create_scenario(

View file

@ -28,7 +28,7 @@ def app():
valuations_data = [
{'uprn': 100071188496, "valuation": 175_000},
{'uprn': 100090136026, "valuation": 183_000},
{'uprn': 100071136271, "valuation": 183_000},
{'uprn': 100071194376, "valuation": 221_000},
{'uprn': 100071176297, "valuation": 208_000},
]