package com.brilliance.isc.convert.mt1xx;

import com.brilliance.isc.swift.objmtconvert.manager.MtCreatorManager;
import com.brilliance.isc.swift.objmtconvert.model.commontag.ActnoBicAdrTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.commontag.DcDateCurAmtTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.mt1xx.MT103STPCreator;
import com.brilliance.isc.swift.objmtconvert.util.Constans;
import org.junit.Test;

import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;

public class Mt103STPTest {

    @Test
    public void mt103STP_Test()throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {



        List<String> list13C = new LinkedList<>();
        list13C.add("/SNDTIME/2124+0800");
        list13C.add("/RNCTIME/2330+0800");
        list13C.add("/CLSTIME/2221+0800");

        List<String> list23E = new LinkedList<>();
        list23E.add("SDVA");
        list23E.add("INTC");

        List<String> list71F = new LinkedList<>();
        list71F.add("QWE123456789987,,,");
        list71F.add("QWE123456789987,,,");

        DcDateCurAmtTagXXX dcdatecuramt32A=new DcDateCurAmtTagXXX("32");
        dcdatecuramt32A.setDate("220313");
        dcdatecuramt32A.setCurrency("USD");
        dcdatecuramt32A.setAmount(new BigDecimal("1000.00"));

        DcDateCurAmtTagXXX dcdatecuramt33B=new DcDateCurAmtTagXXX("33");
        //dcdatecuramt33B.setDate("220313");
        dcdatecuramt33B.setCurrency("USD");
        dcdatecuramt33B.setAmount(new BigDecimal("1000.00"));



        ActnoBicAdrTagXXX actnoBicAdrTag50a=new ActnoBicAdrTagXXX("50","103_STP");
        //actnoBicAdrTag50a.setInfo("A");
        //actnoBicAdrTag50a.setAddress("1/WHYHCNHBXXX");
        actnoBicAdrTag50a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag50a.setCode("THISIS41A");
        //actnoBicAdrTag50a.setBic("GCYXXXXXX12");
        actnoBicAdrTag50a.setAcctno("01111001759234567890");
        //actnoBicAdrTag50a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag50a.setLocation("WHYHCNHBXXX");

        ActnoBicAdrTagXXX actnoBicAdrTag52A=new ActnoBicAdrTagXXX("52");
        //actnoBicAdrTag52A.setInfo("A");
        //actnoBicAdrTag52A.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag52A.setCode("THISIS41A");
        actnoBicAdrTag52A.setBic("GCYXXXXXX52");
        //actnoBicAdrTag52A.setAcctno("01111001759234567890");
        actnoBicAdrTag52A.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag52A.setLocation("WHYHCNHBXXX");

        ActnoBicAdrTagXXX actnoBicAdrTag53a=new ActnoBicAdrTagXXX("53");
        //actnoBicAdrTag53a.setInfo("/P");
        //actnoBicAdrTag53a.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag53a.setCode("THISIS41A");
        actnoBicAdrTag53a.setBic("WERTYU12");
        //actnoBicAdrTag53a.setAcctno("6226TEST0001");
        actnoBicAdrTag53a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag53a.setLocation("WHYHCNHBXXX");

        ActnoBicAdrTagXXX actnoBicAdrTag54A=new ActnoBicAdrTagXXX("54");
        //actnoBicAdrTag54A.setInfo("A");
        //actnoBicAdrTag54A.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag54A.setCode("THISIS41A");
        actnoBicAdrTag54A.setBic("GCYXXXXXX54");
        //actnoBicAdrTag54A.setAcctno("01111001759234567890");
        actnoBicAdrTag54A.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag54A.setLocation("WHYHCNHBXXX");

        ActnoBicAdrTagXXX actnoBicAdrTag55A=new ActnoBicAdrTagXXX("55");
        //actnoBicAdrTag55A.setInfo("A");
        //actnoBicAdrTag55A.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag55A.setCode("THISIS41A");
        actnoBicAdrTag55A.setBic("GCYXXXXXX55");
        //actnoBicAdrTag55A.setAcctno("01111001759234567890");
        actnoBicAdrTag55A.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag55A.setLocation("WHYHCNHBXXX");

        ActnoBicAdrTagXXX actnoBicAdrTag56A=new ActnoBicAdrTagXXX("56");
        //actnoBicAdrTag56A.setInfo("A");
        //actnoBicAdrTag56A.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag56A.setCode("THISIS41A");
        actnoBicAdrTag56A.setBic("GCYXXXXXX56");
        //actnoBicAdrTag56A.setAcctno("01111001759234567890");
        actnoBicAdrTag56A.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag56A.setLocation("WHYHCNHBXXX");

        ActnoBicAdrTagXXX actnoBicAdrTag57A=new ActnoBicAdrTagXXX("57");
        //actnoBicAdrTag57A.setInfo("A");
        //actnoBicAdrTag57A.setAddress("WHYHCNHBXXX");
        //actnoBicAdrTag57A.setCode("THISIS41A");
        actnoBicAdrTag57A.setBic("GCYXXXXXX57");
        //actnoBicAdrTag57A.setAcctno("01111001759234567890");
        actnoBicAdrTag57A.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag57A.setLocation("WHYHCNHBXXX");

        ActnoBicAdrTagXXX actnoBicAdrTag59a=new ActnoBicAdrTagXXX("59","103_STP");
        //actnoBicAdrTag59a.setInfo("A");
        //actnoBicAdrTag59a.setAddress("WHYHCNHBXXX");
        actnoBicAdrTag59a.setAddress("1/WHYHCNHBXXX");
        //actnoBicAdrTag59a.setCode("THISIS411");
        //actnoBicAdrTag59a.setBic("GCYXXXXXX57");
        actnoBicAdrTag59a.setAcctno("6226TEST0001");
        //actnoBicAdrTag59a.setPartyIdentifier("1234-5678");
        //actnoBicAdrTag59a.setLocation("WHYHCNHBXXX");


        MT103STPCreator mt103STPCreator=new MT103STPCreator("103_STP");
        mt103STPCreator.setSendBic("PSBCADBJXXX");
        mt103STPCreator.setRecvBic("CIPSADSHXXX");
        mt103STPCreator.setSendersReference("TBEXO12345");
        mt103STPCreator.setBankOperationCode("SPRI");
        mt103STPCreator.setTransactionTypeCode("GCY");
        mt103STPCreator.setValueDateCurrencyInterbankSettledAmount32A(dcdatecuramt32A);
        mt103STPCreator.setCurrencyInstructedAmount33B(dcdatecuramt33B);
        //mt103STPCreator.setExchangeRate("17,435713");
        mt103STPCreator.setOrderingCustomer50a(actnoBicAdrTag50a);
        mt103STPCreator.setOrderingInstitution52A(actnoBicAdrTag52A);
        mt103STPCreator.setSendersCorrespondent53a(actnoBicAdrTag53a);
        mt103STPCreator.setReceiversCorrespondent54A(actnoBicAdrTag54A);
        mt103STPCreator.setThirdReimbursementInstitution55A(actnoBicAdrTag55A);
        //mt103STPCreator.setIntermediaryInstitution56A(actnoBicAdrTag56A);
        mt103STPCreator.setAccountWithInstitution57A(actnoBicAdrTag57A);
        mt103STPCreator.setBeneficiaryCustomer59a(actnoBicAdrTag59a);
        mt103STPCreator.setRemittanceInformation("RemittanceInformation");
        mt103STPCreator.setDetailsofCharges("OUR");
        mt103STPCreator.setReceiversCharges("USD123456789987,,,");
        mt103STPCreator.setSendertoReceiverInformation("SendertoReceiverInformation"+ Constans.CRLF+"RemittanceInformation");
        mt103STPCreator.setRegulatoryReporting("RegulatoryReporting"+ Constans.CRLF+"RemittanceInformation");
        mt103STPCreator.setTimeIndication(list13C);
        mt103STPCreator.setInstructionCode(list23E);
        //mt103STPCreator.setSendersCharges(list71F);



         MtCreatorManager.packMT(mt103STPCreator);



    }
}
