package cz.moneta.test.regression.cvm.api.callcentrum;


import cz.moneta.test.dsl.Harness;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;

import static cz.moneta.test.harness.annotations.Environment.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;

@TestScenario(name = "Call API CRT_CRC_CONTACT_RTDM to WSO2 and assert response parameters")
public class ApiCrtCrcContactRtdm {

    @TestCase(name = "Call API CRT_CRC_CONTACT_RTDM to WSO2", environments = {TST1, PPE})
    public void postCrtCrcContactRtdm(Harness harness) {
        harness.tasks().wso2().restRequest().prepareRequestFromCvm("callcentrum.cluster/CRT_CRC_CONTACT_RTDM/001", true,
                "{\n" +
                        "  \"TS_CIS_SUBJEKTU\": 1,\n" +
                        "  \"HODNOTA_SUBJEKTU\": 461119129,\n" +
                        "  \"JMENO\": \"Jiří\",\n" +
                        "  \"PRIJMENI\": \"Postman\",\n" +
                        "  \"TELEFON\": 776192982,\n" +
                        "  \"TELEFON2\": null,\n" +
                        "  \"TELEFON3\": null,\n" +
                        "  \"TELEFON4\": null,\n" +
                        "  \"TELEFON5\": null,\n" +
                        "  \"EXC_CAMPAIGN_SK\": 10390,\n" +
                        "  \"EXC_CAMPAIGN_CD\": \"2857\",\n" +
                        "  \"EXC_CAMPAIGN_NM\": \"Nenačerpaná žádost s dokončením v IB, klient se souhlasem.\",\n" +
                        "  \"EXC_CAMPAIGN_DESC\": \"Nenačerpání předschválené žádosti o Expres půjčku. Klient a může dokončit žádost v " +
                        "IB, se zaškrtnutím mkt. souhlasu.\",\n" +
                        "  \"EXC_USER_BUSINESS\": \"GEMCB\",\n" +
                        "  \"EXC_EVD_PURPOSE\": \"MARKETING\",\n" +
                        "  \"EXC_COMM_SK\": null,\n" +
                        "  \"EXC_COMM_CD\": null,\n" +
                        "  \"EXC_COMM_NM\": null,\n" +
                        "  \"EXC_COMM_DESC\": null,\n" +
                        "  \"EXC_EXPORT_DTTM\": null,\n" +
                        "  \"EXC_EXPORT_OPERATOR\": \"123066435\",\n" +
                        "  \"EXC_EXECUTION_MODE\": 3,\n" +
                        "  \"EXC_CRM_CHANNEL\": 201,\n" +
                        "  \"EXC_ACTION_CODE\": \"XS_WEB_EXP_SCHV_NEC_DOKL_DOK_V_IB\",\n" +
                        "  \"ONLY_RTDM_PHONES\": 1,\n" +
                        "  \"POZNAMKA\": \"Rámec: 50000 Kč, Splatnost: 75 měsíců, Splátka: 1050 Kč, Úrok: 15.4 %, RPSN: 17.72 %, PPI: Ne," +
                        " Poplatek: 0 Kč\",\n" +
                        "  \"SYNCHRON_TELEF\": 0\n" +
                        "}")
                .post()
                .andAssertStatus(200)
                .andAssertFieldValue("tifResponseStatus.resultCode", "0")
                .andAssertPresent("ID_TS_KAMPANE")
                .andAssertPresent("ID_TS_KAMPANE_KLIENTI");
    }
}
