package cz.moneta.test.regression.channels.digital.ml.hypos;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.hypos.enums.HyposContractState;
import cz.moneta.test.dsl.hypos.enums.HyposProfile;
import cz.moneta.test.dsl.hypos.tasks.HyposDbTasks;
import cz.moneta.test.dsl.hypos.tasks.HyposTasks;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;

@TestScenario(name = "Contract detail tests")
public class ContractDetailTest {

    @TestCase(name = "Check manual fee collection")
    @JiraTestCase(id = "ML-T512")
    public void tcManualFeeCollection(Harness harness) {
        HyposTasks tasks = harness.tasks().hypos();
        String contractId = new HyposDbTasks(harness).getContractIdWithBuByState(HyposContractState.UVER_SPLACENI);

        harness.withHypos()
                .openLoginPage()
                .then(tasks.loginToHyposWithProfile(HyposProfile.EMERGENCY))
                .then(tasks.searchAndOpenContract(contractId))
                .then(tasks.contractTasks().cashCollectedFee());
    }

    @TestCase(name = "Check contract detail pages")
    @JiraTestCase(id = "ML-T511")
    public void tcCheckContractPages(Harness harness) {
        HyposTasks tasks = harness.tasks().hypos();
        String contractId = new HyposDbTasks(harness).getContractIdByState(HyposContractState.UVER_SPLACENI);

        harness.withHypos()
                .openLoginPage()
                .then(tasks.loginToHyposWithProfile(HyposProfile.EMERGENCY))
                .then(tasks.searchAndOpenContract(contractId))
                .clickProcessChecklist()
                .clickClients()
                .clickLoan()
                .clickLifeInsurance()
                .clickRealtyInsurance()
                .clickRealty()
                .clickForms()
                .clickDocuments()
                .clickApprovalChecklist()
                .clickCommunication()
                .clickNotifications()
                .clickWithdrawalRequests()
                .clickFees()
                .clickPktu()
                .clickExternalSources()
                .clickUrgent()
                .clickScoring()
                .clickRetention()
                .clickService()
                .clickBackOffice()
                .clickComplaints();
    }
}