package cz.moneta.test.dsl.util.task.auto.smartauto.setman.dealers;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.smartauto.setman.DealersPage;
import cz.moneta.test.dsl.auto.smartauto.setman.MainPage;
import cz.moneta.test.dsl.auto.smartauto.setman.NewDealersPage;
import cz.moneta.test.dsl.util.task.auto.smartauto.setman.SmartAutoSetmanTasks;

import java.util.function.Function;

public class DealersTasks {

    private final Harness harness;
    private SmartAutoSetmanTasks smartAutoSetmanTasks;

    public DealersTasks(Harness harness) {
        this.harness = harness;
        this.smartAutoSetmanTasks = harness.tasks().auto().smartAutoSetman();
    }

    public Function<MainPage, DealersPage> goToDealersPage() {
        return start -> start.clickMenuPartners()
                .clickDealers()
                .then(smartAutoSetmanTasks.verification().checkDealersPage());
    }

    public Function<MainPage, NewDealersPage> goToNewDealersPage() {
        return start -> start.clickMenuPartners()
                .clickNewDealers()
                .then(smartAutoSetmanTasks.verification().checkNewDealersPage());
    }
}