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

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.smartauto.CustomerPage;
import cz.moneta.test.dsl.auto.smartauto.shared.Employment;

import java.util.function.Function;

public class EmploymentTasks {

    private final Harness harness;

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

    public Function<CustomerPage, CustomerPage> fillEmployment(Employment employment, String emplymentStartDate, String occupation) {
        return start -> start.clickEmployment()
                .chooseEmployment(employment)
                .typeEmploymentStartDate(emplymentStartDate)
                .typeOccupation(occupation);
    }

    public Function<CustomerPage, CustomerPage> fillEmploymentRetirement(String emplymentStartDate) {
        return start -> start.clickEmployment()
                .chooseEmployment(Employment.RETIREMENT)
                .typeEmploymentStartDate(emplymentStartDate);
    }

    public Function<CustomerPage, CustomerPage> fillEmploymentCertainPeriodNoticePeriod(String emplymentStartDate, String emplymentEndDate, String employmentPeriodDate, String occupation) {
        return start -> start.clickEmployment()
                .chooseEmployment(Employment.CERTAIN_TIME)
                .typeEmploymentStartDate(emplymentStartDate)
                .typeEmploymentEndDate(emplymentEndDate)
                .clickClientInNoticePeriod()
                .typeEmploymentEndPeriodDate(employmentPeriodDate)
                .typeOccupation(occupation);
    }
}
