Updating recommendation engine for new cost data

This commit is contained in:
Khalim Conn-Kowlessar 2023-11-24 11:01:44 +00:00
parent bf2e6c1ebc
commit 02b76cd9fe
4 changed files with 5 additions and 6 deletions

View file

@ -75,7 +75,7 @@ def upload_recommendations(session: Session, recommendations_to_upload, property
"property_id": property_id,
"type": rec["type"],
"description": rec["description"],
"estimated_cost": rec["cost"],
"estimated_cost": rec["total"],
"default": rec["default"],
"starting_u_value": rec.get("starting_u_value"),
"new_u_value": rec.get("new_u_value"),
@ -102,10 +102,10 @@ def upload_recommendations(session: Session, recommendations_to_upload, property
{
"recommendation_id": recommendation_id,
"material_id": part["id"],
"depth": part["depths"][0] if part["depths"] else None,
"depth": int(part["depth"]) if part["depth"] else None,
"quantity": part["quantity"],
"quantity_unit": part["quantity_unit"],
"estimated_cost": part["estimated_cost"],
"estimated_cost": part["total"],
}
for rec, recommendation_id in zip(recommendations_to_upload, uploaded_recommendation_ids)
for part in rec["parts"]

View file

@ -318,7 +318,6 @@ async def trigger_plan(body: PlanTriggerRequest):
batch_properties = input_properties[i:i + BATCH_SIZE]
for p in batch_properties:
# Your existing operations
property_details_epc = p.get_property_details_epc(
portfolio_id=body.portfolio_id, rating_lookup=rating_lookup

View file

@ -52,7 +52,7 @@ class VentilationRecommendations(Definitions):
estimated_cost = n_units * part[0]["cost"]
part[0]["estimated_cost"] = estimated_cost
part[0]["total"] = estimated_cost
part[0]["quantity"] = n_units
part[0]["quantity_unit"] = "part"

View file

@ -22,7 +22,7 @@ def prepare_input_measures(property_recommendations, goal):
[
{
"id": rec["recommendation_id"],
"cost": rec["cost"],
"cost": rec["total"],
"gain": rec[goal_key],
"type": rec["type"]
}