from typing import Optional
from pydantic import BaseModel


class PashubToAraTriggerRequest(BaseModel):
    pashub_link: (
        str  # e.g. https://pashub.net/jobs/12345-abcd-1234-abcd-12345abcde/details
    )

    address: Optional[str] = None
    sharepoint_link: Optional[str] = None
    uprn: Optional[str] = None
    landlord_property_id: Optional[str] = None
    deal_stage: Optional[str] = None
    hubspot_listing_id: Optional[int] = None
    hubspot_deal_id: Optional[str] = None

    @property
    def pashub_job_id(self) -> str:
        return self.pashub_link.split("/")[-2]
