Merge pull request #7 from Hestia-Homes/feature/make_dashboard_better_for_one

Feature/make dashboard better for one
This commit is contained in:
Jun-te Kim 2025-11-24 13:55:19 +00:00 committed by GitHub
commit 8eb0c1f043
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 12 deletions

View file

@ -7,7 +7,9 @@ on:
jobs:
gather_hubspot_data_and_upload_to_s3:
runs-on: ubuntu-22.04
runs-on:
group: [self-hosted]
timeout-minutes: 120 # <-- 2 hour timeout

View file

@ -9,6 +9,7 @@ class Companies(Enum):
ABRI = "237615001799"
SOUTHERN_HOUSING_GROUP = "109343619305"
LIVEWEST = "86205872354"
HOMEGROUP = "94946071794"
class DealStage(Enum):
SURVEYED_COMPLETE_NEEDS_SIGN_OFF = "1617223914"

View file

@ -116,6 +116,7 @@ class HubSpotClientAsync:
'dealname',
'dealstage',
'expected_commencement_date',
'last_submission_date',
'mtp_planned_week',
'mtp_completion_date',
'design_planned_week',
@ -292,3 +293,5 @@ class HubSpotClientAsync:
results.append(await task)
return results

View file

@ -38,7 +38,6 @@ class jsonReader:
def generate_df_via_product_type(self, product_type):
rows = []
for deals in self.deals_by_line_item[product_type]:
if deals['attempts'] != []:
row = self._return_df_from_deal_info(deals, product_type)
rows.append(row)
break
@ -50,16 +49,15 @@ class jsonReader:
def _return_df_from_deal_info(self, deal, product_type):
for attempts in deal["attempts"]:
data = {
"submission_date": deal.get("submission_date", None),
"expected_commencement_date": deal.get("expected_commencement_date", None),
"work_type": product_type,
"price": next(
(item["price"] for item in deal["line_items"] if product_type in item["name"]),
None
)
}
data = {
"submission_date": deal["deal_properties"].get("submission_date", None),
"expected_commencement_date": deal["deal_properties"].get("expected_commencement_date", None),
"work_type": product_type,
"price": next(
(item["price"] for item in deal["line_items"] if product_type in item["name"]),
None
)
}
return pd.DataFrame([data])