package com.brilliance.isc.convert.mt9xx;

import com.brilliance.isc.swift.objmtconvert.manager.MtCreatorManager;
import com.brilliance.isc.swift.objmtconvert.model.commontag.DcDateCurAmtTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.mt9xx.MT972Creator;
import org.junit.Test;

import java.math.BigDecimal;
import java.util.*;

/**
 * @author hedonghao
 * @date 2023/2/24
 */
public class Mt972Test {
    @Test
    public void mt972_Test(){
        MT972Creator mt972Creator = new MT972Creator("972");
        // 组报文
        //20
        mt972Creator.setTranReferenceNum("Tran");
        //25
        mt972Creator.setAccIdentifi("AccId");
        //28C
        mt972Creator.setStatSeqNumber("1/1");
        //60a
        DcDateCurAmtTagXXX dcDateCurAmtTag60a = new DcDateCurAmtTagXXX("60");
        dcDateCurAmtTag60a.setDcMark("D");
        dcDateCurAmtTag60a.setCurrency("CNY");
        dcDateCurAmtTag60a.setDate("201231");
        dcDateCurAmtTag60a.setAmount(new BigDecimal(10000));
        mt972Creator.setDcDateCurAmtTag60a(dcDateCurAmtTag60a);
        //61
        List<String> tag61 = new ArrayList<>();
        tag61.add("2012311231C1000SIDCAccountOwner0123");
        tag61.add("2012311231C1000SIDCAccountOwner4321//Reference\r\nSupplementaryDetails");
        mt972Creator.setStatLine(tag61);
        //62a
        DcDateCurAmtTagXXX dcDateCurAmtTag62a = new DcDateCurAmtTagXXX("62");
        dcDateCurAmtTag62a.setDcMark("C");
        dcDateCurAmtTag62a.setCurrency("CNY");
        dcDateCurAmtTag62a.setDate("220101");
        dcDateCurAmtTag62a.setAmount(new BigDecimal(200000));
        mt972Creator.setDcDateCurAmtTag62a(dcDateCurAmtTag62a);
        //64
        DcDateCurAmtTagXXX dcDateCurAmtTag64 = new DcDateCurAmtTagXXX("64");
        dcDateCurAmtTag64.setDcMark("C");
        dcDateCurAmtTag64.setCurrency("CNY");
        dcDateCurAmtTag64.setDate("230101");
        dcDateCurAmtTag64.setAmount(new BigDecimal(10000));
        mt972Creator.setDcDateCurAmtTag64(dcDateCurAmtTag64);

        MtCreatorManager.packMT(mt972Creator);

    }

}
