def generate_create_company_response(
    name: str, domain: str | None = None, organisation_id: None | int = None
) -> FakeHubspotResponse:
    """
    Generate a sample response given by the Hubspot API when creating a company.

    This response was retrieved from the API directly, and then modified to allow us to set the
    properties dynamically.
    """

    properties = {
        "active_subscription": None,
        "createdate": "2024-04-23T17:36:50.158Z",
        "domain": domain,
        "hs_lastmodifieddate": "2024-04-23T17:36:50.158Z",
        "hs_object_id": "11349198823",
        "hs_object_source": "INTEGRATION",
        "hs_object_source_id": "2902325",
        "hs_object_source_label": "INTEGRATION",
        "name": name,
        "website": domain,
    }

    if organisation_id:
        properties["orgid_unique"] = organisation_id  # type: ignore[assignment]

    return FakeHubspotResponse(
        data={
            "archived": False,
            "archived_at": None,
            "created_at": datetime(2024, 4, 23, 17, 36, 50, 158000, tzinfo=tzlocal()),
            "id": "11349198823",
            "properties": properties,
            "properties_with_history": None,
            "updated_at": datetime(2024, 4, 23, 17, 36, 50, 158000, tzinfo=tzlocal()),
        }
    )

    Generate a sample response given by the Hubspot API when creating a company.

    This response was retrieved from the API directly, and then modified to allow us to set the
    properties dynamically.
    
api/tests/unit/integrations/lead_tracking/hubspot/_hubspot_responses.py