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.Brand;
import cz.moneta.test.dsl.auto.smartauto.shared.Model;

import java.util.function.Function;

public class BrandModelTasks {

    private final Harness harness;

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

    public Function<NewCalculationPage, NewCalculationPage> chooseBrandAndModel(Brand brand, Model model) {
        return start -> start
                .typeVehicleBrand(brand.getValue())
                .clickVehicleBrandSearchedOption(brand)
                .typeVehicleModel(model.getValue())
                .clickVehicleModelSearchedOption(model);
    }

    public Function<NewCalculationPage, NewCalculationPage> chooseAgroBrand (Brand brand) {
        return start -> start
                .clickAgroSearchBrandArrow()
                .clickAgroBrand(brand);
    }

    public Function<NewCalculationPage, NewCalculationPage> chooseAgroBrandWithoutTP (Brand brand) {
        return start -> start
                .typeAgroBrandWithoutTP(brand.getValue());
    }

    public Function<NewCalculationPage, NewCalculationPage> chooseAgroModel (Model model) {
        return start -> start
                .typeAgroModel(model.getValue());
    }

    public Function<NewCalculationPage, NewCalculationPage> clickAgroModel (Model model) {
        return start -> start
                .searchAgroModel()
                .clickAgroModel(model);
    }
}
