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

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.ufo.ufoframework.pages.otherjarda.ValidationValueTypesPanel;

import java.util.function.Function;

public class VerificationsTasks {

    private final Harness harness;

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

    public Function<ValidationValueTypesPanel, ValidationValueTypesPanel> verifyHAccountNumber(String validHAccountNumber, String notValidHAccountNumber) {
        return start -> start
                .fillHAccountNumber(validHAccountNumber)
                .clickHAccountNumberValidateAndAcceptValidAlert()
                .checkValidationIsSuccessful(validHAccountNumber)
                .fillHAccountNumber(notValidHAccountNumber)
                .clickHAccountNumberValidateAndAcceptNotValidAlert();
    }

    public Function<ValidationValueTypesPanel, ValidationValueTypesPanel> verifyHEmail(String validHEmail, String notValidHEmail) {
        return start -> start
                .fillHEmail(validHEmail)
                .clickHEmailValidateAndAcceptValidAlert()
                .checkValidationIsSuccessful(validHEmail)
                .fillHEmail(notValidHEmail)
                .clickHEmailValidateAndAcceptNotValidAlert();
    }

    public Function<ValidationValueTypesPanel, ValidationValueTypesPanel> verifyHDate(String validHDate, String notValidHDate) {
        return start -> start
                .fillHDate(validHDate)
                .clickHDateValidateAndAcceptValidAlert()
                .checkValidationIsSuccessful(validHDate)
                .fillHDate(notValidHDate)
                .clickHDateValidateAndAcceptNotValidAlert();
    }

    public Function<ValidationValueTypesPanel, ValidationValueTypesPanel> verifyHBirthNumber(String validHBirthNumber, String notValidHBirthNumber) {
        return start -> start
                .fillHBirthNumber(validHBirthNumber)
                .clickHBirthNumberValidateAndAcceptValidAlert()
                .checkValidationIsSuccessful(validHBirthNumber)
                .fillHBirthNumber(notValidHBirthNumber)
                .clickHBirthNumberValidateAndAcceptNotValidAlert();
    }

    public Function<ValidationValueTypesPanel, ValidationValueTypesPanel> verifyHIco(String validHIco, String notValidHIco) {
        return start -> start
                .fillHIco(validHIco)
                .clickHIcoValidateAndAcceptValidAlert()
                .checkValidationIsSuccessful(validHIco)
                .fillHIco(notValidHIco)
                .clickHIcoValidateAndAcceptNotValidAlert();
    }

    public Function<ValidationValueTypesPanel, ValidationValueTypesPanel> verifyHFullName(String validHFullName, String notValidHFullName) {
        return start -> start
                .fillHFullName(validHFullName)
                .clickHFullNameValidateAndAcceptValidAlert()
                .checkValidationIsSuccessful(validHFullName)
                .fillHFullName(notValidHFullName)
                .clickHFullNameValidateAndAcceptNotValidAlert();
    }
}
