"""
This script will create an input csv for the recommendation engine and upload it to S3, which can be used for
testing
"""
import pandas as pd
from utils.s3 import save_csv_to_s3

USER_ID = 8
PORTFOLIO_ID = 56


def app():
    """
    This portfolio is for testing windows recommendations
    :return:
    """

    test_file = pd.DataFrame(
        [
            {"address": "3 Church Terrace", "postcode": "LE13 0PW", "Notes": None},
            {"address": "3, Main Street, Redmile", "postcode": "NG13 0GA", "Notes": None},
            {"address": "Manor House, Kennel Lane, Reepham", "postcode": "LN3 4DZ", "Notes": None},
            {"address": "13 Main Street", "postcode": "LE14 2JU", "Notes": None},
            {"address": "8 The Crescent, Coston Road, Buckminster", "postcode": "NG33 5SF", "Notes": None},
        ]
    )

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

    body = {
        "portfolio_id": str(PORTFOLIO_ID),
        "housing_type": "Social",
        "goal": "Increase EPC",
        "goal_value": "A",
        "trigger_file_path": filename
    }
    print(body)
