package cz.moneta.test.sanity.transactional.cards.wso2;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.wso2.data.CardData;
import cz.moneta.test.harness.annotations.Environment;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import cz.moneta.test.sanity.transactional.SmokeData;
import org.junit.jupiter.api.BeforeAll;

@TestScenario(name = "GET_ADD_SERVICES_REFUND_FEE_CC")
public class CardServices {
    private SmokeData smokeData;
    private String bu;
    private String cif;
    private String prodInstKey;

    @BeforeAll
    public void getInfo(Harness harness) {
        smokeData = SmokeData.getInstance(harness);
        CardData debitData = smokeData.getDebitData();
        bu = debitData.getBu();
        cif = debitData.getCif();
        prodInstKey = debitData.getProdInstKey();
    }

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T2423")
    public void MWF5F0_ADD_SERVICES_SET_PACKAGE_STATE(Harness harness) {
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromUfo(smokeData.getPath("MWF5F0"))
                .addField("AccountNumber", bu)
                .addField("CIF", cif)
                .addField("ChannelId", "POS")
                .addField("Currency", "0")
                .addField("EmployeeRoleId", "5")
                .addField("PackageId", "ATM")
                .addField("Period", "2")
                .addField("Price", 2)
                .addField("ProductCode", "2713999")
                .addField("ProductType", "1299001")
                .addField("SSO", "543830626")
                .addField("ProdInstKey", prodInstKey)
                .addField("AdditionalServiceState", "15")
                .postExtended()
                .andAssertStatus(200)
                .andAssertFieldValue("DebitCardExist", "TRUE");
    }
}
