mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-22 08:48:38 +00:00
37 lines
1 KiB
Python
37 lines
1 KiB
Python
from dataclasses import dataclass
|
|
from typing import Tuple, Union
|
|
|
|
from domain.abri.models import AbriRequestRejected, PlaceRef
|
|
from etl.hubspot.deal_contacts_client import HubspotDealContactsClient
|
|
from infrastructure.abri.abri_client import AbriClient
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class TenantDataSyncSummary:
|
|
"""PII-free record of what a sync run did: safe to log and persist."""
|
|
|
|
tenancy_reference: str
|
|
contact_ids: Tuple[str, ...]
|
|
vulnerable_contact_count: int
|
|
|
|
|
|
TenantDataSyncResult = Union[TenantDataSyncSummary, AbriRequestRejected]
|
|
|
|
|
|
class TenantDataSyncOrchestrator:
|
|
"""Syncs an Abri tenancy's signatories to a HubSpot deal.
|
|
|
|
Tenant data flows straight from Abri to HubSpot; nothing is persisted
|
|
in Domna's database or logs.
|
|
"""
|
|
|
|
def __init__(
|
|
self,
|
|
abri_client: AbriClient,
|
|
hubspot: HubspotDealContactsClient,
|
|
) -> None:
|
|
self._abri = abri_client
|
|
self._hubspot = hubspot
|
|
|
|
def run(self, place_ref: PlaceRef, deal_id: str) -> TenantDataSyncResult:
|
|
raise NotImplementedError
|