package cz.moneta.test.regression.channels.branch.archive;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.ufo.banka.tasks.BankaTasks;
import cz.moneta.test.dsl.util.data.client.NonClient;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import cz.moneta.test.harness.support.auth.Credentials;
import cz.moneta.test.harness.support.auth.Key;
import org.junit.jupiter.api.Disabled;

import static cz.moneta.test.dsl.util.credentials.Keys.ufo;
import static cz.moneta.test.harness.annotations.Environment.EDU;
import static cz.moneta.test.harness.annotations.Environment.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;

@Disabled
@TestScenario(name = "Teller must be able to crate a new customer with a new loan application")
public class CreateNewLoanApplication {

    @TestCase(name = "Bank teller is able to login and create a new customer with a new loan application", environments = {TST1, PPE, EDU})
    @JiraTestCase(id = "POB-T10639")
    public void tc_bak_teller_is_able_create_new_customer_with_new_loan_application(Harness harness, @Key(ufo.banka.banker) Credentials banker) {
        BankaTasks bankaTasks = harness.tasks().ufo().banka();
        NonClient nonClient = harness.data().newNonClient()
                .withNetMonthlyIncome(50000)
                .withHomeIncome(100000);

        harness.withUfo()
                .openLoginPage()
                .then(bankaTasks.login().withCredentials(banker))
                .then(bankaTasks.login().turnSignpadOff())
                .then(bankaTasks.newClient().create(nonClient, banker.getUsername()))
                .then(bankaTasks.newLoanApplication().createNewLoanApplication(nonClient, 10000, 12));

    }
}
