From 96f86aacac05c7a6f0aa4ad1d1c53dc54e3e26d6 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 6 Jul 2026 15:54:05 +0000 Subject: [PATCH] =?UTF-8?q?A=20logged=20job's=20job=5Fno=20is=20written=20?= =?UTF-8?q?to=20HubSpot=20and=20then=20the=20deal=20database=20?= =?UTF-8?q?=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- infrastructure/hubspot/deal_properties_client.py | 8 +++++++- orchestration/abri_log_job_orchestrator.py | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/infrastructure/hubspot/deal_properties_client.py b/infrastructure/hubspot/deal_properties_client.py index eb2e132d4..24cf5fca8 100644 --- a/infrastructure/hubspot/deal_properties_client.py +++ b/infrastructure/hubspot/deal_properties_client.py @@ -1,4 +1,5 @@ from hubspot.client import Client # type: ignore[reportMissingTypeStubs] +from hubspot.crm.deals import SimplePublicObjectInput # type: ignore[reportMissingTypeStubs] class HubspotDealPropertiesClient: @@ -15,4 +16,9 @@ class HubspotDealPropertiesClient: def write_deal_property( self, deal_id: str, property_name: str, value: str ) -> None: - raise NotImplementedError + self._client.crm.deals.basic_api.update( # type: ignore[reportUnknownMemberType] + deal_id, + simple_public_object_input=SimplePublicObjectInput( + properties={property_name: value} + ), + ) diff --git a/orchestration/abri_log_job_orchestrator.py b/orchestration/abri_log_job_orchestrator.py index b80d39bf5..811d008af 100644 --- a/orchestration/abri_log_job_orchestrator.py +++ b/orchestration/abri_log_job_orchestrator.py @@ -98,4 +98,13 @@ class AbriLogJobOrchestrator: if isinstance(outcome, AbriRequestRejected): return outcome + self._hubspot.write_deal_property( + deal_id=booking.deal_id, + property_name=JOB_NO_DEAL_PROPERTY, + value=outcome.job_no, + ) + self._deal_database.record_job_no( + deal_id=booking.deal_id, job_no=outcome.job_no + ) + return LogJobSummary(deal_id=booking.deal_id, job_no=outcome.job_no)