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.MT900Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.brilliance.isc.swift.objmtconvert.util.Constans;
import com.brilliance.isc.swift.objmtconvert.util.JsonUtil;
import org.junit.Test;

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

/**
 * @author zh
 * @create 2023-02-27-16:29
 */
public class MT900Test {
    @Test
    public void test_900(){
        MT900Creator mt900Creator = new MT900Creator("900");
        mt900Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt900Creator.setSendBic("PSBCCNBJXXX");//发报行
        //13D
        mt900Creator.setDateTimeIndication("1401081515+1300");
        //20
        mt900Creator.setTransactionReferenceNumber("C11126A1378");
        //21
        mt900Creator.setRelatedReference("5482ABC");
        //25
        ActnoBicAdrTagXXX accountIdentification = new ActnoBicAdrTagXXX("25");
        accountIdentification.setAcctno("9-9876543");
        accountIdentification.setBic("PSBCCNBJ");
        mt900Creator.setAccountIdentification(accountIdentification);
        //32
        DcDateCurAmtTagXXX dateCurrencyAmount = new DcDateCurAmtTagXXX("32");
        dateCurrencyAmount.setDate("220602");
        dateCurrencyAmount.setCurrency("EUR");
        dateCurrencyAmount.setAmount(new BigDecimal("111.2"));
        mt900Creator.setDateCurrencyAmount(dateCurrencyAmount);
        //52 52A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setInfo("D");
        orderingInstitution.setPartyIdentifier("FINANZBANK AG");
        orderingInstitution.setBic("ABOCCNBJ110");
        mt900Creator.setOrderingInstitution(orderingInstitution);
        //72
        mt900Creator.setSenderToReceiverInformation("/COMM/USD15,");
        MtResult mtResult = MtCreatorManager.packMT(mt900Creator);
    }
    @Test
    public void test_900_2(){
        MT900Creator mt900Creator = new MT900Creator("900");
        mt900Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt900Creator.setSendBic("PSBCCNBJXXX");//发报行
        //13D
        mt900Creator.setDateTimeIndication("1401081515+1300");
        //20
        mt900Creator.setTransactionReferenceNumber("C11126A1378");
        //21
        mt900Creator.setRelatedReference("5482ABC");
        //25
        ActnoBicAdrTagXXX accountIdentification = new ActnoBicAdrTagXXX("25");
        accountIdentification.setAcctno("9-9876543");
        mt900Creator.setAccountIdentification(accountIdentification);
        //32
        DcDateCurAmtTagXXX dateCurrencyAmount = new DcDateCurAmtTagXXX("32");
        dateCurrencyAmount.setDate("220602");
        dateCurrencyAmount.setCurrency("EUR");
        dateCurrencyAmount.setAmount(new BigDecimal("111.2"));
        mt900Creator.setDateCurrencyAmount(dateCurrencyAmount);
        //52 52D
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setInfo("D");
        orderingInstitution.setPartyIdentifier("FINANZBANK AG");
        orderingInstitution.setAddress("HU BEI");
        mt900Creator.setOrderingInstitution(orderingInstitution);
        //72
        mt900Creator.setSenderToReceiverInformation("/COMM/USD15,");
        MtResult mtResult = MtCreatorManager.packMT(mt900Creator);
    }
    @Test
    public void test_900_3(){
        MT900Creator mt900Creator = new MT900Creator("900");
        mt900Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt900Creator.setSendBic("PSBCCNBJXXX");//发报行
        //13D
        mt900Creator.setDateTimeIndication("1401081515+1300AAAA");
        //20
        mt900Creator.setTransactionReferenceNumber("C11126A1378AAAA");
        //21
        mt900Creator.setRelatedReference("5482ABCAAAAAAAAA");
        //25
        ActnoBicAdrTagXXX accountIdentification = new ActnoBicAdrTagXXX("25");
        accountIdentification.setAcctno("9-9876543");
        accountIdentification.setBic("PSBCCNBJAAAA");
        mt900Creator.setAccountIdentification(accountIdentification);
        //32
        DcDateCurAmtTagXXX dateCurrencyAmount = new DcDateCurAmtTagXXX("32");
        dateCurrencyAmount.setDate("220602");
        dateCurrencyAmount.setCurrency("EUR");
        dateCurrencyAmount.setAmount(new BigDecimal("111.2"));
        mt900Creator.setDateCurrencyAmount(dateCurrencyAmount);
        //52 52A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setInfo("D");
        orderingInstitution.setPartyIdentifier("FINANZBANK AG");
        orderingInstitution.setBic("ABOCCNBJ110");
        mt900Creator.setOrderingInstitution(orderingInstitution);
        //72
        mt900Creator.setSenderToReceiverInformation("/COMM/USD15,");
        MtResult mtResult = MtCreatorManager.packMT(mt900Creator);
    }
    @Test
    public void test_900_4(){
        MT900Creator mt900Creator = new MT900Creator("900");
        mt900Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt900Creator.setSendBic("PSBCCNBJXXX");//发报行
        //13D
        mt900Creator.setDateTimeIndication("1401081515+1300");
        //20
        mt900Creator.setTransactionReferenceNumber("C11126A1378");
        //21
        mt900Creator.setRelatedReference("5482ABC");
        //25
        ActnoBicAdrTagXXX accountIdentification = new ActnoBicAdrTagXXX("25");
        accountIdentification.setAcctno("9-9876543");
        accountIdentification.setBic("PSBCCNBJ");
        mt900Creator.setAccountIdentification(accountIdentification);
        //32
        DcDateCurAmtTagXXX dateCurrencyAmount = new DcDateCurAmtTagXXX("32");
        dateCurrencyAmount.setDate("220602");
        dateCurrencyAmount.setCurrency("EUR");
        dateCurrencyAmount.setAmount(new BigDecimal("111.2"));
        mt900Creator.setDateCurrencyAmount(dateCurrencyAmount);
        //52 52A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setInfo("D");
        orderingInstitution.setPartyIdentifier("FINANZBANK AG");
        orderingInstitution.setBic("ABOCCNBJ110");
        mt900Creator.setOrderingInstitution(orderingInstitution);
        //72
        mt900Creator.setSenderToReceiverInformation("/COMM/USD15,");
        MtResult mtResult = MtCreatorManager.packMT(mt900Creator);
    }

}
