import pandas as pd
from utils.s3 import save_csv_to_s3


def app():
    """
    This script sets up
    :return:
    """

    portfolio_id = 108

    # Read in the portfolio EPC data
    epc_data = pd.read_excel(
        "/Users/khalimconn-kowlessar/Documents/hestia/Customers/sfr/20240820 portfolio_epc_data.xlsx"
    )

    asset_list = epc_data[
        [
            "ADDRESS1", "POSTCODE", "UPRN"
        ]
    ].copy().rename(
        columns={
            "ADDRESS1": "address",
            "POSTCODE": "postcode",
            "UPRN": "uprn"
        }
    )

    # Store data and prepare payload

    filename = f"{8}/{portfolio_id}/asset_list.csv"
    save_csv_to_s3(
        dataframe=asset_list,
        bucket_name="retrofit-plan-inputs-dev",
        file_name=filename
    )

    body = {
        "portfolio_id": str(portfolio_id),
        "housing_type": "Private",
        "goal": "Increasing EPC",
        "goal_value": "C",
        "trigger_file_path": filename,
        "already_installed_file_path": "",
        "patches_file_path": "",
        "non_invasive_recommendations_file_path": "",
        "budget": None,
        "scenario_name": "EPC C Package",
        "multi_plan": True,
    }
    print(body)
