check all hubspot submissions

This commit is contained in:
Jun-te Kim 2025-04-14 14:01:43 +00:00
parent 2fccf6b8a3
commit aa232621b8
2 changed files with 23 additions and 3 deletions

View file

@ -1,4 +1,5 @@
from etl.scraper.scraper import SharePointScraper, SharePointInstaller
from etl.hubSpotClient.hubspot import HubSpotClient, DealStage
import pandas as pd
@ -9,6 +10,7 @@ class SurveyPrice():
def __init__(self):
self.sharepoint_client = SharePointScraper(SharePointInstaller.WARMFRONT)
self.master_rate_card_path = None
self.all_hubspot_submissions = None
self.download_price_card()
self.required_sheets = [
'JJC - EMPTIES',
@ -80,9 +82,26 @@ class SurveyPrice():
pricing_table = pd.DataFrame(pricing_table)
return pricing_table
def get_all_surveys_from_hubspot():
# TODO Get all hubspot data and make a dataframe
pass
def get_all_surveys_from_hubspot(self):
hubSpotClient = HubSpotClient()
deals = hubSpotClient.get_deals_from_deal_stage(DealStage.SURVEYED_COMPLETE_NEEDS_SIGN_OFF)
all_deals = []
for deal in deals:
all_deals.append({
"HUBSPOT_WORK_TYPE": deal.work_type,
"HUBSPOT_DEAL_ADDRESS": deal.deal_name,
"HUBSPOT_TRICKLE_VENT":1 if deal.needs_trickle_ventilation else 0,
"HUBSPOT_WALL_INSULATION": deal.existing_wall_insulation,
"HUBSPOT_POST_INSTALL_SAP_SCORE": deal.post_sap_score,
"HUBSPOT_INSTALLER": deal.installer
})
self.all_hubspot_submissions = pd.DataFrame(all_deals)
return self.all_hubspot_submissions
# TODO

View file

@ -34,3 +34,4 @@ def test_get_price_matrix_jjc_foam(sp):