package cz.moneta.test.regression.risk.applications.newclient;

import cz.moneta.test.dataprepare.risk.DefaultLoan;
import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.ufo.banka.tasks.accountenums.CurrentAccountsEnum;
import cz.moneta.test.dsl.util.code.lists.HCisAllStavZadosti;
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 static cz.moneta.test.dsl.util.credentials.Keys.ufo.banka.banker;

@TestScenario(name = "Test for Risk Retail - Data preparation - client with Flexikredit application")
public class FlexikreditApplication extends DefaultLoan {

    @TestCase
    public void newClientWithFlexikreditApplication(Harness harness, @Key(banker) Credentials credentials) {
        bankaTasks.newClient().openUfoAndCreateClient(harness, credentials, applicant)
                .then(bankaTasks.newProduct().createIBAndCurrentAccount(CurrentAccountsEnum.TOM_PLUS, applicant.mobileNumber()))
                .then(bankaTasks.flexiCreditTasks().createNewFlexiCreditApplication(applicant, 10000, HCisAllStavZadosti.APPLICATION_CONDITIONALLY_APROVED));
    }

}
