diff --git a/etl/hubspot/scripts/scraper/main.py b/etl/hubspot/scripts/scraper/main.py index f7dc1076..3ed208a2 100644 --- a/etl/hubspot/scripts/scraper/main.py +++ b/etl/hubspot/scripts/scraper/main.py @@ -55,7 +55,7 @@ def handler(body: dict[str, Any], context: Any) -> None: logger.info( f"Triggering Pas Hub file fetcher for HubSpot deal ID {hubspot_deal_id}" ) - _trigger_pashub_fetcher(sqs_client, hubspot_deal) + _trigger_pashub_fetcher(sqs_client, hubspot_deal_id, hubspot_deal) else: # Deal already in db, check whether anything has changed logger.info( @@ -91,7 +91,7 @@ def handler(body: dict[str, Any], context: Any) -> None: logger.info( f"Triggering Pas Hub file fetcher for HubSpot deal ID {hubspot_deal_id}" ) - _trigger_pashub_fetcher(sqs_client, hubspot_deal) + _trigger_pashub_fetcher(sqs_client, hubspot_deal_id, hubspot_deal) else: logger.info( f"Not Triggering PasHub file fetcher for HubSpot deal ID {hubspot_deal_id}" @@ -100,10 +100,13 @@ def handler(body: dict[str, Any], context: Any) -> None: print("done") -def _trigger_pashub_fetcher(sqs_client: Any, hubspot_deal: Dict[str, str]) -> None: +def _trigger_pashub_fetcher( + sqs_client: Any, deal_id: str, hubspot_deal: Dict[str, str] +) -> None: message_body: Dict[str, Optional[str]] = { "pashub_link": hubspot_deal["pashub_link"], "address": None, # potentially available from Listing, leave as None for now + "hubspot_deal_id": deal_id, "sharepoint_link": hubspot_deal.get("sharepoint_link", None), "uprn": hubspot_deal.get("national_uprn", None), "landlord_property_id": hubspot_deal.get("owner_property_id", None),