handling retrieveing find my epc when we're passing a flat

This commit is contained in:
Khalim Conn-Kowlessar 2025-05-06 19:56:36 +01:00
parent ca173c88ca
commit 7b0fd45fe2

View file

@ -509,10 +509,18 @@ async def model_engine(body: PlanTriggerRequest):
# if we have a remote assment data type, we pull the additional data and include it
if body.event_type == "remote_assessment":
logger.info("Retrieving find my epc data")
for k in ["address", "address1"]:
epc_searcher.newest_epc[k] = epc_searcher.address_clean
try:
property_non_invasive_recommendations, patch = RetrieveFindMyEpc.get_from_epc(
epc_searcher.newest_epc
)
except Exception as e:
logger.error(f"Failed to retrieve without cleaning address {e}")
for k in ["address", "address1"]:
epc_searcher.newest_epc[k] = epc_searcher.address_clean
property_non_invasive_recommendations, patch = RetrieveFindMyEpc.get_from_epc(
epc_searcher.newest_epc
)
property_non_invasive_recommendations, patch = RetrieveFindMyEpc.get_from_epc(epc_searcher.newest_epc)
# If we have a property type, this means when we pull the epc data, we might need to make a patch
epc_records = patch_epc(patch, epc_records)