package cz.moneta.test.dataprepare.ml.hypos;

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

import static cz.moneta.test.dsl.hypos.enums.Client.*;

@TestScenario(name = "Process checklist")
public class ChecklistAtomPrepare {

    @TestCase(name = "Process checklist", environments = {Environment.TST1, Environment.PPE})
    public void tcChecklistAtom(Harness harness) {
        HyposTasks tasks = harness.tasks().hypos();
        String contractId = harness.getSystemOrConfigValue("yamlData");

        harness.withHypos()
                .openLoginPage()
                .then(tasks.loginToHyposWithProfile(HyposProfile.EMERGENCY))
                .then(tasks.searchAndOpenContract(contractId))
                .then(tasks.contractTasks().setChecklistClient(FIRST_CLIENT))
                .then(tasks.contractTasks().setChecklistClient(SECOND_CLIENT))
                .then(tasks.contractTasks().setChecklistClient(THIRD_CLIENT))
                .then(tasks.contractTasks().setChecklistClient(FOURTH_CLIENT))
                .then(tasks.contractTasks().setChecklistLoan())
                .then(tasks.contractTasks().setChecklistAllocatedCollateral());
    }
}