mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
The deal upsert lands client_booking_reference in the job_no column 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
0cd4efbf83
commit
62d9bbf147
1 changed files with 40 additions and 0 deletions
|
|
@ -85,3 +85,43 @@ def test_update_existing_deal__no_project__clears_project_id() -> None:
|
|||
)
|
||||
|
||||
assert existing.project_id is None
|
||||
|
||||
|
||||
def test_update_existing_deal__client_booking_reference_maps_to_job_no() -> None:
|
||||
existing = HubspotDealData(deal_id="MOCK_DEAL_ID", job_no=None)
|
||||
deal_data = {"client_booking_reference": "AD0226519"}
|
||||
|
||||
_make_instance()._update_existing_deal(
|
||||
existing=existing,
|
||||
deal_data=deal_data,
|
||||
listing=None,
|
||||
company=None,
|
||||
)
|
||||
|
||||
assert existing.job_no == "AD0226519"
|
||||
|
||||
|
||||
def test_update_existing_deal__client_booking_reference_cleared__nulls_job_no() -> None:
|
||||
existing = HubspotDealData(deal_id="MOCK_DEAL_ID", job_no="AD0226519")
|
||||
deal_data = {}
|
||||
|
||||
_make_instance()._update_existing_deal(
|
||||
existing=existing,
|
||||
deal_data=deal_data,
|
||||
listing=None,
|
||||
company=None,
|
||||
)
|
||||
|
||||
assert existing.job_no is None
|
||||
|
||||
|
||||
def test_build_new_deal__client_booking_reference_maps_to_job_no() -> None:
|
||||
new_deal = _make_instance()._build_new_deal(
|
||||
deal_id="MOCK_DEAL_ID",
|
||||
deal_data={"client_booking_reference": "AD0226519"},
|
||||
listing=None,
|
||||
company=None,
|
||||
project=None,
|
||||
)
|
||||
|
||||
assert new_deal.job_no == "AD0226519"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue