mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-19 17:03:02 +00:00
A logged job's job_no is written to HubSpot and then the deal database 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
6912dabf22
commit
96f86aacac
2 changed files with 16 additions and 1 deletions
|
|
@ -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}
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue