added db save

This commit is contained in:
Khalim Conn-Kowlessar 2024-07-29 15:01:39 +01:00
parent eec453670c
commit 754d46073e

View file

@ -539,6 +539,16 @@ async def trigger_plan(body: PlanTriggerRequest):
uprn=p.uprn
)
# Store the data in the database
# TODO: Rather than just doing a straight insert, we should overwrite what's already there if it exists
solar_api_client.save_to_db(
session=session,
uprns_to_location=[
{"uprn": p.uprn, "longitude": p.spatial["longitude"], "latitude": p.spatial["latitude"]}
],
scenario_type="unit"
)
# TODO: Insert the pitched roof area into the property class as we store the solar performance
# in the property class
print("Implement me")