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.MT950Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt9xx.MT970Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import org.junit.Test;

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

/**
 * @author zh
 * @create 2023-02-27-10:27
 */
public class MT970Test {
    @Test
    public void test_970(){
        MT970Creator mt970Creator = new MT970Creator("970");
        //20
        mt970Creator.setTranReferenceNum("654321");
        //25
        mt970Creator.setAccountIc("1234567891");
        //28C
        mt970Creator.setStatNumSeqNum("36589/58911");
        //60a
        DcDateCurAmtTagXXX dcDateCurAmt60a = new DcDateCurAmtTagXXX("60");
        dcDateCurAmt60a.setDcMark("C");
        dcDateCurAmt60a.setDate("170928");
        dcDateCurAmt60a.setCurrency("USD");
        dcDateCurAmt60a.setAmount(new BigDecimal("28000.00"));
        mt970Creator.setDateCurAmtTag60a(dcDateCurAmt60a);
        //61
        List<String> list61 = new LinkedList<>();
        list61.add("1901300130C17,93NTRFCBBA A/C DATE   ");
        list61.add("1901300130C18,93NTRFCBBA A/C DATE   ");
        mt970Creator.setStatLine(list61);
        //62a
        DcDateCurAmtTagXXX dcDateCurAmt62a = new DcDateCurAmtTagXXX("62");
        dcDateCurAmt62a.setDcMark("C");
        dcDateCurAmt62a.setDate("170928");
        dcDateCurAmt62a.setCurrency("USD");
        dcDateCurAmt62a.setAmount(new BigDecimal("81767.95"));
        mt970Creator.setDateCurAmtTag62a(dcDateCurAmt62a);
        //64
        DcDateCurAmtTagXXX dcDateCurAmt64a = new DcDateCurAmtTagXXX("64");
        dcDateCurAmt64a.setDcMark("C");
        dcDateCurAmt64a.setDate("170928");
        dcDateCurAmt64a.setCurrency("USD");
        dcDateCurAmt64a.setAmount(new BigDecimal("81767.95"));
        mt970Creator.setDateCurAmtTag64(dcDateCurAmt64a);

        MtResult mtResult= MtCreatorManager.packMT(mt970Creator);
    }

}
