mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
30 lines
808 B
Python
30 lines
808 B
Python
"""
|
|
README.md
|
|
|
|
This is a simple script to showcase how a new organisation can be
|
|
added to AraDb.
|
|
|
|
This has been made reduntant due to doing this process when ever
|
|
hubspot has a webhook
|
|
"""
|
|
|
|
from etl.hubspot.hubspotClient import HubspotClient, Companies
|
|
|
|
from etl.hubspot.hubspotDataTodB import HubspotDataToDb, CompanyData
|
|
|
|
hubspot = HubspotClient()
|
|
dbRead = HubspotDataToDb()
|
|
companies_to_add_or_ensure_it_exists = [
|
|
Companies.THE_GUINESS_PARTNERSHIP,
|
|
Companies.SOUTHERN_HOUSING_GROUP,
|
|
Companies.CALICO_HOMES,
|
|
]
|
|
|
|
for company in companies_to_add_or_ensure_it_exists:
|
|
company_info: CompanyData = hubspot.get_company_information(company.value)
|
|
dbRead.upsert_organisation(company_info)
|
|
|
|
|
|
dbRead = HubspotDataToDb()
|
|
names = dbRead.get_org_names()
|
|
print(f"Organisations in database: {names}")
|