Merge pull request #992 from Hestia-Homes/feature/pashub-to-ara

Correctly trigger pashub fetcher from hubspot fetcher
This commit is contained in:
Daniel Roth 2026-04-17 14:32:03 +01:00 committed by GitHub
commit 50dcaa9d2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 11 deletions

View file

@ -6,9 +6,9 @@ from etl.hubspot.utils import parse_hs_date
class HubspotDealDiffer:
COORDINATION_COMPLETE: List[str] = [
"v1 ioe/mtp complete",
"v2 ioe/mtp complete",
"v3 ioe/mtp complete",
"(v1) ioe/mtp complete",
"(v2) ioe/mtp complete",
"(v3) ioe/mtp complete",
]
RETROFIT_DESIGN_COMPLETE = "uploaded"
LODGEMENT_COMPLETE: List[str] = ["lodgement complete", "measures lodged"]
@ -152,7 +152,7 @@ class HubspotDealDiffer:
new_status: str = new_deal.get("coordination_status", "")
return (
new_status != ""
and new_status in HubspotDealDiffer.COORDINATION_COMPLETE
and new_status.lower() in HubspotDealDiffer.COORDINATION_COMPLETE
and new_status != old_deal.coordination_status
)
@ -161,7 +161,7 @@ class HubspotDealDiffer:
new_status: str = new_deal.get("design_status", "")
return (
new_status != ""
and new_status == HubspotDealDiffer.RETROFIT_DESIGN_COMPLETE
and new_status.lower() == HubspotDealDiffer.RETROFIT_DESIGN_COMPLETE
and new_status != old_deal.design_status
)
@ -172,6 +172,6 @@ class HubspotDealDiffer:
new_status: str = new_deal.get("lodgement_status", "")
return (
new_status != ""
and new_status in HubspotDealDiffer.LODGEMENT_COMPLETE
and new_status.lower() in HubspotDealDiffer.LODGEMENT_COMPLETE
and new_status != old_deal.lodgement_status
)

View file

@ -104,10 +104,10 @@ def _trigger_pashub_fetcher(sqs_client: Any, hubspot_deal: Dict[str, str]) -> No
message_body: Dict[str, Optional[str]] = {
"pashub_link": hubspot_deal["pashub_link"],
"address": None, # potentially available from Listing, leave as None for now
"sharepoint_link": hubspot_deal["sharepoint_link"],
"uprn": hubspot_deal["national_uprn"],
"landlord_property_id": hubspot_deal["owner_property_id"],
"deal_stage": hubspot_deal["deal_stage"],
"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),
"deal_stage": hubspot_deal.get("deal_stage", None),
}
response = sqs_client.send_message(
@ -121,5 +121,5 @@ def _trigger_pashub_fetcher(sqs_client: Any, hubspot_deal: Dict[str, str]) -> No
if __name__ == "__main__":
handler({"hubspot_deal_id": "371470706915"}, "")
handler({"hubspot_deal_id": "498926855369"}, "")
print("beep")