package cz.moneta.test.dsl.util.task.auto.smartauto.newcalculation;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.smartauto.NewCalculationPage;
import cz.moneta.test.dsl.auto.smartauto.shared.CalculationData;
import cz.moneta.test.dsl.auto.smartauto.shared.Product;

import java.util.function.Function;

public class FinancialProductTasks {

    private final Harness harness;

    public FinancialProductTasks(Harness harness) {
        this.harness = harness;
    }

    public Function<NewCalculationPage, NewCalculationPage> chooseFinancialProduct(Product product) {
        return start -> start
                .clickVehicleFinanceProduct()
                .clickVehicleFinanceProductChoose(product)
                .waitForCalculationOutput();
    }

    public Function<NewCalculationPage, NewCalculationPage> chooseFinancialProductAdjust(CalculationData calculationData) {
        return start -> start
                .clickVehicleFinanceProduct()
                .clickVehicleFinanceProductChoose(calculationData.getProduct())
                .typeFirstPayment(calculationData.getFirstPayment())
                .waitForCalculationOutput();
    }
}
