package com.brilliance.isc.convert.mt2xx;

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.mt2xx.MT203Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt2xx.mt2XXAbsCreator.MT203AbsCreator;
import org.junit.Test;

import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;

/**
 * @author huangmengyuan
 * @create 2023/2/27
 */
public class MT203Test {
    @Test
    public void mt203_Test(){



        //52A 52D
        ActnoBicAdrTagXXX actnoBicAdr52a = new ActnoBicAdrTagXXX("52");
        actnoBicAdr52a.setPartyIdentifier("1235-5624");
        actnoBicAdr52a.setBic("KMHNIJYG");

        //53A 53B 53D
        ActnoBicAdrTagXXX actnoBicAdr53a = new ActnoBicAdrTagXXX("53");
        actnoBicAdr53a.setPartyIdentifier("4821-5624");
        actnoBicAdr53a.setLocation("KMHNILLMM");

        //54A 54B 54D
        ActnoBicAdrTagXXX actnoBicAdr54a = new ActnoBicAdrTagXXX("54");
        actnoBicAdr54a.setPartyIdentifier("4821-0213");
        actnoBicAdr54a.setAddress("KBBVFLLMM");


        //循环1
        List<MT203AbsCreator> list = new LinkedList<>();
        MT203AbsCreator MT203AbsCreator = new MT203AbsCreator();
        //20
        MT203AbsCreator.setTransactionReferenceNumber("LKNNJHB");//16x
        //21
        MT203AbsCreator.setRelatedReference("LMBHV");//16x

        //56A 56D
        ActnoBicAdrTagXXX actnoBicAdrTag56a=new ActnoBicAdrTagXXX("56");
        actnoBicAdrTag56a.setAddress("LKMNBNMI");
      //  actnoBicAdrTag56a.setPartyIdentifier("5630-8561");
        MT203AbsCreator.setActnoBicAdr56a(actnoBicAdrTag56a);
        //57A 57B 57D
        ActnoBicAdrTagXXX actnoBicAdrTag57a=new ActnoBicAdrTagXXX("57");
        actnoBicAdrTag57a.setAddress("LMKNG");
        actnoBicAdrTag57a.setPartyIdentifier("5630-2563");
        MT203AbsCreator.setActnoBicAdr57a(actnoBicAdrTag57a);
        //58A 58D
        ActnoBicAdrTagXXX actnoBicAdrTag58a=new ActnoBicAdrTagXXX("58");
        actnoBicAdrTag58a.setAddress("LMKNGLMk");
        actnoBicAdrTag58a.setPartyIdentifier("5321-2563");
        MT203AbsCreator.setActnoBicAdr58a(actnoBicAdrTag58a);
        //72
        MT203AbsCreator.setSendertoReceiverInformationB("LMHBFCX");//6*35x
        //32B
        DcDateCurAmtTagXXX dcDateCurAmt32B= new DcDateCurAmtTagXXX("32");
        dcDateCurAmt32B.setCurrency("USD");
        dcDateCurAmt32B.setAmount(new BigDecimal("3000"));//3!a15d
        MT203AbsCreator.setDateCurAmt32B(dcDateCurAmt32B);
        list.add(MT203AbsCreator);


        //循环2
        MT203AbsCreator MT203AbsCreator2 = new MT203AbsCreator();
        //20
        MT203AbsCreator2.setTransactionReferenceNumber("LKNNJHB");//16x
        //21
        MT203AbsCreator2.setRelatedReference("LMBHV");//16x
        //32B
        DcDateCurAmtTagXXX dcDateCurAmt32B2= new DcDateCurAmtTagXXX("32");
        dcDateCurAmt32B2.setCurrency("USD");
        dcDateCurAmt32B2.setAmount(new BigDecimal("3000.1"));//3!a15d
        MT203AbsCreator2.setDateCurAmt32B(dcDateCurAmt32B2);
        //56A 56D
        ActnoBicAdrTagXXX actnoBicAdrTag56a2=new ActnoBicAdrTagXXX("56");
        actnoBicAdrTag56a2.setAddress("LKMNBNMI");
        actnoBicAdrTag56a2.setPartyIdentifier("5630-8561");
        MT203AbsCreator2.setActnoBicAdr56a(actnoBicAdrTag56a2);
        //57A 57B 57D
        ActnoBicAdrTagXXX actnoBicAdrTag57a2=new ActnoBicAdrTagXXX("57");
        actnoBicAdrTag57a2.setAddress("LMKNG");
        actnoBicAdrTag57a2.setPartyIdentifier("5630-2563");
//        absMT203Creator2.setActnoBicAdr57a(actnoBicAdrTag57a2);
        //58A 58D
        ActnoBicAdrTagXXX actnoBicAdrTag58a2=new ActnoBicAdrTagXXX("58");
        actnoBicAdrTag58a2.setAddress("LMKNGLMk");
        actnoBicAdrTag58a2.setPartyIdentifier("5321-2563");
        MT203AbsCreator2.setActnoBicAdr58a(actnoBicAdrTag58a2);
        //72
        MT203AbsCreator2.setSendertoReceiverInformationB("LMHBFCX");//6*35x

        list.add(MT203AbsCreator2);
        MT203Creator mt203Creator = new MT203Creator("203");
       //19
        mt203Creator.setSumofAmounts(new BigDecimal("6000.1"));//17d
        //30
        mt203Creator.setValueDate("230659");//6!n
        //52A 52D
        mt203Creator.setActnoBicAdr52a(actnoBicAdr52a);//A,D
        //53A 53B 53D
        mt203Creator.setActnoBicAdr53a(actnoBicAdr53a);//A,B,D
        //54A 54B 54D
        mt203Creator.setActnoBicAdr54a(actnoBicAdr54a);//A,B,D
        //72
        mt203Creator.setSendertoReceiverInformation("PLKJGNN\r\nNVJJK");//6*35x

        mt203Creator.setCycleDomain(list);


       MtCreatorManager.packMT(mt203Creator);

    }
    @Test
    public void mt203_Test2(){

        MT203Creator mt203Creator = new MT203Creator("203");

        //52A 52D
        ActnoBicAdrTagXXX actnoBicAdr52a = new ActnoBicAdrTagXXX("52");
        actnoBicAdr52a.setPartyIdentifier("1235-5624");
        actnoBicAdr52a.setBic("KMHNIJYG");

        //53A 53B 53D
        ActnoBicAdrTagXXX actnoBicAdr53a = new ActnoBicAdrTagXXX("53");
        actnoBicAdr53a.setPartyIdentifier("4821-5624");
        actnoBicAdr53a.setLocation("KMHNILLMM");

        //54A 54B 54D
        ActnoBicAdrTagXXX actnoBicAdr54a = new ActnoBicAdrTagXXX("54");
        actnoBicAdr54a.setPartyIdentifier("4821-0213");
        actnoBicAdr54a.setAddress("KBBVFLLMM");


        //循环1
        LinkedList<MT203AbsCreator> list = new LinkedList<>();
        MT203AbsCreator MT203AbsCreator = new MT203AbsCreator();
        //20
        MT203AbsCreator.setTransactionReferenceNumber("LKNNJHB");//16x
        //21
        MT203AbsCreator.setRelatedReference("LMBHV");//16x
        //32B
        DcDateCurAmtTagXXX dcDateCurAmt32B= new DcDateCurAmtTagXXX("32");
        dcDateCurAmt32B.setCurrency("USD");
        dcDateCurAmt32B.setAmount(new BigDecimal(3000));//3!a15d
        MT203AbsCreator.setDateCurAmt32B(dcDateCurAmt32B);
        //56A 56D
        ActnoBicAdrTagXXX actnoBicAdrTag56a=new ActnoBicAdrTagXXX("56");
        actnoBicAdrTag56a.setBic("LKMNB");
        actnoBicAdrTag56a.setPartyIdentifier("5630-8561");
        MT203AbsCreator.setActnoBicAdr56a(actnoBicAdrTag56a);
        //57A 57B 57D
        ActnoBicAdrTagXXX actnoBicAdrTag57a=new ActnoBicAdrTagXXX("57");
        actnoBicAdrTag57a.setAddress("LMKNG");
        actnoBicAdrTag57a.setPartyIdentifier("5630-2563");
        MT203AbsCreator.setActnoBicAdr57a(actnoBicAdrTag57a);
        //58A 58D
        ActnoBicAdrTagXXX actnoBicAdrTag58a=new ActnoBicAdrTagXXX("58");
        actnoBicAdrTag58a.setAddress("LMKNGLMk");
        actnoBicAdrTag58a.setPartyIdentifier("5321-2563");
        MT203AbsCreator.setActnoBicAdr58a(actnoBicAdrTag58a);
        //72
        MT203AbsCreator.setSendertoReceiverInformationB("LMHBFCX");//6*35x
        list.add(MT203AbsCreator);
        //19
        mt203Creator.setSumofAmounts(new BigDecimal("3000"));//17d
        //30
        mt203Creator.setValueDate("23069");//6!n
        //52A 52D
        mt203Creator.setActnoBicAdr52a(actnoBicAdr52a);//A,D
        //53A 53B 53D
        mt203Creator.setActnoBicAdr53a(actnoBicAdr53a);//A,B,D
        //54A 54B 54D
        mt203Creator.setActnoBicAdr54a(actnoBicAdr54a);//A,B,D
        //72
        mt203Creator.setSendertoReceiverInformation("PLKJGNN\r\nNVJJK");//6*35x
        mt203Creator.setCycleDomain(list);


        MtCreatorManager.packMT(mt203Creator);

    }
}
