package com.brilliance.isc.convert.mt9xx;

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.mt9xx.MT910Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt9xx.MT920Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt9xx.mt9XXAbsCreator.MT920AbsCreator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.brilliance.isc.swift.objmtconvert.util.JsonUtil;
import org.junit.Test;

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

/**
 * @author zh
 * @create 2023-02-27-16:29
 */
public class MT920Test {

    @Test
    public void test_920(){
        // 组报文
        MT920Creator mt920Creator = new MT920Creator("920");
        mt920Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt920Creator.setSendBic("PSBCCNBJXXX");//发报行
        //20
        mt920Creator.setTransactionReferenceNumber("3948");
        //12,25,34F
        List<MT920AbsCreator> list = new LinkedList<>();
        //生成循环域对象
        MT920AbsCreator mt920AbsCreator = new MT920AbsCreator();
        mt920AbsCreator.setMessageRequested("942");
        mt920AbsCreator.setAccountIdentification("123-45678");
        mt920AbsCreator.setDebitFloorLimitIndicator("CHFD1000000,");
        mt920AbsCreator.setCreditFloorLimitIndicator("CHFC100000,");
        list.add(mt920AbsCreator);
        list.add(mt920AbsCreator);
        mt920Creator.setMt920AbsCreators(list);
        MtResult mtResult = MtCreatorManager.packMT(mt920Creator);
    }
    @Test
    public void test_920_2(){
        // 组报文
        MT920Creator mt920Creator = new MT920Creator("920");
        mt920Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt920Creator.setSendBic("PSBCCNBJXXX");//发报行
        //20
        mt920Creator.setTransactionReferenceNumber("3948");
        //12,25,34F
        List<MT920AbsCreator> list = new LinkedList<>();
        //生成循环域对象
        MT920AbsCreator mt920AbsCreator = new MT920AbsCreator();
        mt920AbsCreator.setMessageRequested("942AAAAAAAAAAAAA");
        mt920AbsCreator.setAccountIdentification("123-45678AAAAAAAAAAAAAAAAAA");
        mt920AbsCreator.setDebitFloorLimitIndicator("CHFD1000000,");
        mt920AbsCreator.setCreditFloorLimitIndicator("CHFC100000,");
        list.add(mt920AbsCreator);
        list.add(mt920AbsCreator);
        mt920Creator.setMt920AbsCreators(list);
        MtResult mtResult = MtCreatorManager.packMT(mt920Creator);
    }
    @Test
    public void test_920_3(){
        // 组报文
        MT920Creator mt920Creator = new MT920Creator("920");
        mt920Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt920Creator.setSendBic("PSBCCNBJXXX");//发报行
        //20
        mt920Creator.setTransactionReferenceNumber("3948");
        //12,25,34F
        List<MT920AbsCreator> list = new LinkedList<>();
        //生成循环域对象
        MT920AbsCreator mt920AbsCreator = new MT920AbsCreator();
        mt920AbsCreator.setMessageRequested("942");
        mt920AbsCreator.setAccountIdentification("123-45678");
        mt920AbsCreator.setDebitFloorLimitIndicator("CHFD1000000,");
        mt920AbsCreator.setCreditFloorLimitIndicator("USDD100000,");
        list.add(mt920AbsCreator);

        MT920AbsCreator mt920AbsCreator2 = new MT920AbsCreator();
        mt920AbsCreator2.setMessageRequested("942");
        mt920AbsCreator2.setAccountIdentification("123-45678");
        mt920AbsCreator2.setDebitFloorLimitIndicator("CHFD1000000,");
        list.add(mt920AbsCreator2);

        mt920Creator.setMt920AbsCreators(list);
        MtResult mtResult = MtCreatorManager.packMT(mt920Creator);
    }

}
