mirror of
https://github.com/Hestia-Homes/insight.git
synced 2026-06-30 13:10:44 +00:00
Merge pull request #7 from Hestia-Homes/feature/make_dashboard_better_for_one
Feature/make dashboard better for one
This commit is contained in:
commit
8eb0c1f043
4 changed files with 16 additions and 12 deletions
4
.github/workflows/gather_hubspot_data.yml
vendored
4
.github/workflows/gather_hubspot_data.yml
vendored
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue