diff --git a/backend/src/dashboard/scripts/quick_one.py b/backend/src/dashboard/scripts/quick_one.py index 1f70cd4..4a89a7c 100644 --- a/backend/src/dashboard/scripts/quick_one.py +++ b/backend/src/dashboard/scripts/quick_one.py @@ -1,8 +1,14 @@ -from dashboard.services.file_manager import FileManager -from dashboard.services.json_reader import jsonReader -s3 = FileManager() +#from dashboard.services.file_manager import FileManager +#from dashboard.services.json_reader import jsonReader +#s3 = FileManager() -key, path, data = s3.download_and_read_latest() -hubspot_data = jsonReader(data) +#key, path, data = s3.download_and_read_latest() +#hubspot_data = jsonReader(data) + +#df = hubspot_data.generate_df_via_product_type("Empty Cavity - ECO4") + + +#one = df.iloc(0) + +from dashboard.service -df = hubspot_data.generate_df_via_product_type("Empty Cavity - ECO4") \ No newline at end of file diff --git a/backend/src/dashboard/services/hubspot_client_async.py b/backend/src/dashboard/services/hubspot_client_async.py index 7e2d484..f5a52e8 100644 --- a/backend/src/dashboard/services/hubspot_client_async.py +++ b/backend/src/dashboard/services/hubspot_client_async.py @@ -128,6 +128,9 @@ class HubSpotClientAsync: deal_info = dict(deal.properties) deal_info["deal_id"] = deal_id + expected_commencement_history = await self.get_expected_commencement_history(deal_id) + deal_info["expected_commencement_history"] = expected_commencement_history + line_items = await self.from_deal_get_line_items(deal_id) company_id = await self.from_deal_get_associated_company_id(deal_id) company_info = await self.get_company_information(company_id) if company_id else {} @@ -293,5 +296,16 @@ class HubSpotClientAsync: results.append(await task) return results - + + async def get_expected_commencement_history(self, deal_id: str): + """Fetch historical values for expected_commencement_date.""" + deal = await self._run( + self.client.crm.deals.basic_api.get_by_id, + deal_id, + properties=[], + properties_with_history=["expected_commencement_date"] + ) + + return deal.properties_with_history.get("expected_commencement_date", []) +