diff --git a/backend/src/dashboard/services/hubspot_client.py b/backend/src/dashboard/services/hubspot_client.py index 08f314c..20277b2 100644 --- a/backend/src/dashboard/services/hubspot_client.py +++ b/backend/src/dashboard/services/hubspot_client.py @@ -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" diff --git a/backend/src/dashboard/services/hubspot_client_async.py b/backend/src/dashboard/services/hubspot_client_async.py index 0b52ae7..7e2d484 100644 --- a/backend/src/dashboard/services/hubspot_client_async.py +++ b/backend/src/dashboard/services/hubspot_client_async.py @@ -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 + + diff --git a/backend/src/dashboard/services/json_reader.py b/backend/src/dashboard/services/json_reader.py index 03cc470..adb458e 100644 --- a/backend/src/dashboard/services/json_reader.py +++ b/backend/src/dashboard/services/json_reader.py @@ -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])