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

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.util.DateFormatPatterns;
import cz.moneta.test.dsl.util.DateUtils;
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 Services {
    private SmokeData smokeData;
    private String card;

    @BeforeAll
    public void getInfo(Harness harness) {
        smokeData = SmokeData.getInstance(harness);
        card = smokeData.getCreditData().getCard();
    }

    @TestCase(environments = {Environment.TST3, Environment.FVE, Environment.PPE})
    @JiraTestCase(id = "FVP-T1971")
    public void MWFJA7getAddServicesRefundFeeCC(Harness harness) {
        String date = DateUtils.getFormattedTodayDate(DateFormatPatterns.FIRST_VISION_DATE_FORMAT_WITH_SEPARATOR);
        harness.tasks().wso2().restRequest()
                .prepareEmptyRequestFromUfo(smokeData.getPath("MWFJA7"))
                .addField("DSDatumPristoupeni", date)
                .addField("DSDatumZruseni", date)
                .addField("KodDS", "")
                .addField("CisloKarty", card)
                .postExtended()
                .andAssertStatus(200)
                .andAssertPresent("CastkaPoplatku");
    }
}
