package cz.moneta.test.regression.commercial.smallbusiness.digital;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.util.BankaUtils;

import static cz.moneta.test.dsl.ufo.banka.pages.main.HKO101_S001_MainClientPage.BIRTH_NUMBER_STORE_KEY;
import static cz.moneta.test.dsl.ufo.banka.pages.main.HKO101_S001_MainClientPage.CLIENT_CIF_STORE_KEY;
import static cz.moneta.test.dsl.ufo.banka.pages.main.HKO101_S001_MainClientPage.FULL_NAME_KEY;
import static cz.moneta.test.dsl.ufo.banka.pages.main.HKO101_S001_MainClientPage.ICO_KEY;
import static cz.moneta.test.dsl.ufo.banka.pages.main.PSP004_S001_PrintPage.DOCUMENT_URLS_STORE_KEY;

public final class TearDown {

    public static void storeIcoFullNameCifSessionId(Harness harness) {
        harness.store("reports.tmfj.execution.comment",
                "\nIČO klienta: " + harness.get(ICO_KEY, true) +
                        "\nJméno klienta: " + harness.get(FULL_NAME_KEY, true) +
                        "\nCIF klienta: " + harness.get(CLIENT_CIF_STORE_KEY, true) +
                        "\nUFO Session ID: " + harness.get("reports.tmfj.execution.commentufosessionid") +
                        "\nURL dokumentov: \n" + BankaUtils.formatDocumentUrls(harness.get(DOCUMENT_URLS_STORE_KEY, true)));
    }

    public static void storeBirthNumberFullNameCifSessionId(Harness harness) {
        harness.store("reports.tmfj.execution.comment",
                "\nRČ klienta: " + harness.get(BIRTH_NUMBER_STORE_KEY, true) +
                        "\nJméno klienta: " + harness.get(FULL_NAME_KEY, true) +
                        "\nCIF klienta: " + harness.get(CLIENT_CIF_STORE_KEY, true) +
                        "\nUFO Session ID: " + harness.get("reports.tmfj.execution.commentufosessionid") +
                        "\nURL dokumentov: \n" + BankaUtils.formatDocumentUrls(harness.get(DOCUMENT_URLS_STORE_KEY, true)));
    }

    public static void depersonalizeFopClient(Harness harness, String ico, String cif) {
        harness.tasks().wso2().depersonalization().depersonalizeClientFOP(ico, cif);
    }

    public static void depersonalizeFonClient(Harness harness, String rc, String cif) {
        harness.tasks().wso2().depersonalization().depersonalizeClientFON(rc, cif);
    }
}