import pandas as pd
from utils.s3 import read_excel_from_s3
from utils.s3 import save_csv_to_s3

PORTFOLIO_ID = 75
USER_ID = 8


def app():
    asset_list = [
        {
            "address": "19 Emily Gardens",
            "postcode": "B16 0ED",
        },
        {
            "address": "Flat 6 41 Bradford Street",
            "postcode": "B5 6HX",
        },
        {
            "address": "197 FIELD LANE",
            "postcode": "B32 4HL",
        },
        {
            "address": "FLAT 4 108 SUMMER ROAD",
            "postcode": "B23 6DY",
        },
        {
            "address": "1, St. Benedicts Road",
            "postcode": "B10 9DP",
        },
        {
            "address": "29 COOKSEY LANE",
            "postcode": "B44 9QL",
        },
        {
            "address": "40 TRITTIFORD ROAD",
            "postcode": "B13 0HG",
        }
    ]

    asset_list = pd.DataFrame(asset_list)

    # Store the asset list in s3
    filename = f"{USER_ID}/{PORTFOLIO_ID}/pilot.csv"
    save_csv_to_s3(
        dataframe=asset_list,
        bucket_name="retrofit-plan-inputs-dev",
        file_name=filename
    )

    # EPC C portoflio
    body = {
        "portfolio_id": str(PORTFOLIO_ID),
        "housing_type": "Private",
        "goal": "Increase EPC",
        "goal_value": "B",
        "trigger_file_path": filename,
        "already_installed_file_path": "",
        "patches_file_path": "",
        "non_invasive_recommendations_file_path": "",
        "budget": None,
    }
    print(body)
