diff --git a/backend/ecmk_fetcher/address_list.py b/backend/ecmk_fetcher/address_list.py index a2834366..ba636a70 100644 --- a/backend/ecmk_fetcher/address_list.py +++ b/backend/ecmk_fetcher/address_list.py @@ -9,6 +9,7 @@ from openpyxl.worksheet.worksheet import Worksheet class PropertyRow: row_index: int address: str + listing_id: str def extract_addresses_from_spreadsheet( @@ -20,6 +21,7 @@ def extract_addresses_from_spreadsheet( header_row: int = 1 id_col: Optional[int] = None deal_name_col: Optional[int] = None + listing_id_col: Optional[int] = None # find columns for col in range(1, ws.max_column + 1): @@ -30,8 +32,10 @@ def extract_addresses_from_spreadsheet( id_col = col elif value == "deal name": deal_name_col = col + elif value == "associated listing ids": + listing_id_col = col - if id_col is None or deal_name_col is None: + if id_col is None or deal_name_col is None or listing_id_col is None: raise Exception("Missing required columns") properties: Dict[str, PropertyRow] = {} @@ -39,8 +43,9 @@ def extract_addresses_from_spreadsheet( for row in range(2, ws.max_row + 1): id_val: Any = ws.cell(row=row, column=id_col).value deal_name: Any = ws.cell(row=row, column=deal_name_col).value + listing_id: Any = ws.cell(row=row, column=listing_id_col).value - if not id_val or not deal_name: + if not id_val or not deal_name or not listing_id: continue property_id: str = str(id_val).strip() @@ -48,6 +53,7 @@ def extract_addresses_from_spreadsheet( properties[property_id] = PropertyRow( row_index=row, address=extract_succinct_address(str(deal_name)), + listing_id=listing_id, ) return properties diff --git a/backend/ecmk_fetcher/processor.py b/backend/ecmk_fetcher/processor.py index e774fc9a..4c841a19 100644 --- a/backend/ecmk_fetcher/processor.py +++ b/backend/ecmk_fetcher/processor.py @@ -92,6 +92,9 @@ def run_job() -> None: sharepoint_address: str = property_row.address + # Check whether files have already been processed before continuing with this property + # hubspot_listing_id: str = property_row.listing_id + go_to_assessment_details(page, row) for report_type in REPORT_TYPES: