package cz.moneta.test.dsl.ufo.banka.tasks;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.ufo.banka.pages.loans.NEP002_S001_ApplicantPage;
import cz.moneta.test.dsl.util.data.client.NonClient;

import java.util.function.Function;

import static cz.moneta.test.dsl.ufo.banka.pages.loans.PopCheckboxes.AGE;
import static cz.moneta.test.dsl.ufo.banka.pages.loans.PopCheckboxes.BIRTHNUMBER;
import static cz.moneta.test.dsl.ufo.banka.pages.loans.PopCheckboxes.EMPLOYER_STAMP;
import static cz.moneta.test.dsl.ufo.banka.pages.loans.PopCheckboxes.NO_DEPENDANTS;
import static cz.moneta.test.dsl.ufo.banka.pages.loans.PopCheckboxes.SIGNED;

public final class MainApplicantInformationTasks {

    private final Harness harness;

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

    public Function<NEP002_S001_ApplicantPage, NEP002_S001_ApplicantPage> fillMainApplicantInformation(NonClient nonClient) {
        return start -> (NEP002_S001_ApplicantPage) start
                .fillOtherExpenses(nonClient.otherExpenses())
                .fillMonthlyPayments(nonClient.otherLoanPayments())
                .fillNetMonthlyIncome(nonClient.netMonthlyIncome())
                .fillHouseholdIncome(nonClient.homeIncome())
                .fillAllowances(nonClient.wageDeductions())
                .selectOccupation("manager/ředitel")
                .clickTelcoYes()
                .selectPOP("Potvrzení o příjmu")
                .clickPopCheckbox(SIGNED)
                .clickPopCheckbox(BIRTHNUMBER)
                .clickPopCheckbox(NO_DEPENDANTS)
                .clickPopCheckbox(AGE)
                .clickPopCheckbox(EMPLOYER_STAMP)
                .clickPoPContinue()
                .clickContinue();
    }
}