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.result.MtResult;
import com.brilliance.isc.swift.objmtconvert.util.Constans;
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 MT910Test {

    @Test
    public void test_910(){
        MT910Creator mt910Creator = new MT910Creator("910");
        mt910Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt910Creator.setSendBic("PSBCCNBJXXX");//发报行
        //13D
        mt910Creator.setDateTimeIndication("1401081515+1300");
        //20
        mt910Creator.setTransactionReferenceNumber("C11126A1378");
        //21
        mt910Creator.setRelatedReference("5482ABC");
        //25
        ActnoBicAdrTagXXX actnoBicAdrTag25X = new ActnoBicAdrTagXXX("25");
        actnoBicAdrTag25X.setAcctno("9-9876543");
        actnoBicAdrTag25X.setBic("PSBCCNBJ");
        mt910Creator.setAccountIdentification(actnoBicAdrTag25X);
        //32A
        DcDateCurAmtTagXXX dateCurrencyAmount = new DcDateCurAmtTagXXX("32");
        dateCurrencyAmount.setDate("220602");
        dateCurrencyAmount.setCurrency("EUR");
        dateCurrencyAmount.setAmount(new BigDecimal("111.2"));
        mt910Creator.setDateCurrencyAmount(dateCurrencyAmount);
        //50 50A
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50","910");
        orderingCustomer.setAcctno("183793938223");
        orderingCustomer.setBic("PSBCCNBJ");
        mt910Creator.setOrderingCustomer(orderingCustomer);
        //52 52A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setInfo("C");
        orderingInstitution.setPartyIdentifier("FINANZBANK AG");
        orderingInstitution.setBic("ABOCCNBJ110");
        mt910Creator.setOrderingInstitution(orderingInstitution);
        //56 56A
        ActnoBicAdrTagXXX intermediary = new ActnoBicAdrTagXXX("56");
        intermediary.setInfo("C");
        intermediary.setPartyIdentifier("FINANZBANK AG");
        intermediary.setBic("ABOCCNBJ110");
        mt910Creator.setIntermediary(intermediary);
        mt910Creator.setSenderToReceiverInformation("/COMM/USD15,");
        MtResult mtResult = MtCreatorManager.packMT(mt910Creator);
    }
    @Test
    public void test_910_2(){
        MT910Creator mt910Creator = new MT910Creator("910");
        mt910Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt910Creator.setSendBic("PSBCCNBJXXX");//发报行
        //13D
        mt910Creator.setDateTimeIndication("1401081515+1300");
        //20
        mt910Creator.setTransactionReferenceNumber("C11126A1378");
        //21
        mt910Creator.setRelatedReference("5482ABC");
        //25
        ActnoBicAdrTagXXX actnoBicAdrTag25X = new ActnoBicAdrTagXXX("25");
        actnoBicAdrTag25X.setAcctno("9-9876543");
        mt910Creator.setAccountIdentification(actnoBicAdrTag25X);
        //32A
        DcDateCurAmtTagXXX dateCurrencyAmount = new DcDateCurAmtTagXXX("32");
        dateCurrencyAmount.setDate("220602");
        dateCurrencyAmount.setCurrency("EUR");
        dateCurrencyAmount.setAmount(new BigDecimal("111.2"));
        mt910Creator.setDateCurrencyAmount(dateCurrencyAmount);
        //50 50F
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50","910");
        orderingCustomer.setPartyIdentifier("FINANZBANK AG");
        orderingCustomer.setAddress("1/SMITH JOHN"+ Constans.NEW_LINE+"2/299, PARK AVENUE"+Constans.NEW_LINE+"3/US/NEW YORK, NY 10017");
        mt910Creator.setOrderingCustomer(orderingCustomer);
        //52 52D
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setInfo("C");
        orderingInstitution.setPartyIdentifier("FINANZBANK AG");
        orderingInstitution.setAddress("HU BEI");
        mt910Creator.setOrderingInstitution(orderingInstitution);
        //56 56D
        ActnoBicAdrTagXXX intermediary = new ActnoBicAdrTagXXX("56");
        intermediary.setInfo("C");
        intermediary.setPartyIdentifier("FINANZBANK AG");
        intermediary.setAddress("HU BEI");
        mt910Creator.setIntermediary(intermediary);
        mt910Creator.setSenderToReceiverInformation("/COMM/USD15,");
        MtResult mtResult = MtCreatorManager.packMT(mt910Creator);
    }
    @Test
    public void test_910_3(){
        MT910Creator mt910Creator = new MT910Creator("910");
        mt910Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt910Creator.setSendBic("PSBCCNBJXXX");//发报行
        //13D
        mt910Creator.setDateTimeIndication("1401081515+1300");
        //20
        mt910Creator.setTransactionReferenceNumber("C11126A1378");
        //21
        mt910Creator.setRelatedReference("5482ABC");
        //25
        ActnoBicAdrTagXXX actnoBicAdrTag25X = new ActnoBicAdrTagXXX("25");
        actnoBicAdrTag25X.setAcctno("9-9876543");
        mt910Creator.setAccountIdentification(actnoBicAdrTag25X);
        //32A
        DcDateCurAmtTagXXX dateCurrencyAmount = new DcDateCurAmtTagXXX("32");
        dateCurrencyAmount.setDate("220602");
        dateCurrencyAmount.setCurrency("EUR");
        dateCurrencyAmount.setAmount(new BigDecimal("111.2"));
        mt910Creator.setDateCurrencyAmount(dateCurrencyAmount);
        //50 50K
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50","910");
        orderingCustomer.setAcctno("183793938223");
        orderingCustomer.setAddress("HU BEI");
        mt910Creator.setOrderingCustomer(orderingCustomer);
        //52 52D
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setInfo("C");
        orderingInstitution.setPartyIdentifier("FINANZBANK AG");
        orderingInstitution.setAddress("HU BEI");
        mt910Creator.setOrderingInstitution(orderingInstitution);
        //56 56D
        ActnoBicAdrTagXXX intermediary = new ActnoBicAdrTagXXX("56");
        intermediary.setInfo("C");
        intermediary.setPartyIdentifier("FINANZBANK AG");
        intermediary.setAddress("HU BEI");
        mt910Creator.setIntermediary(intermediary);
        mt910Creator.setSenderToReceiverInformation("/COMM/USD15,");
        MtResult mtResult = MtCreatorManager.packMT(mt910Creator);
    }
    @Test
    public void test_910_4(){
        MT910Creator mt910Creator = new MT910Creator("910");
        mt910Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt910Creator.setSendBic("PSBCCNBJXXX");//发报行
        //13D
        mt910Creator.setDateTimeIndication("1401081515+1300");
        //20
        mt910Creator.setTransactionReferenceNumber("C11126A1378AAAAAAAAAAAAAAA");
        //21
        mt910Creator.setRelatedReference("5482ABC");
        //25
        ActnoBicAdrTagXXX actnoBicAdrTag25X = new ActnoBicAdrTagXXX("25");
        actnoBicAdrTag25X.setAcctno("9-9876543ADSSSSSSSSSSSSSSSSSSSSSSSSSDDDDD");
        actnoBicAdrTag25X.setBic("PSBCCNBJ");
        mt910Creator.setAccountIdentification(actnoBicAdrTag25X);
        //32A
        DcDateCurAmtTagXXX dateCurrencyAmount = new DcDateCurAmtTagXXX("32");
        dateCurrencyAmount.setDate("220602");
        dateCurrencyAmount.setCurrency("EUR");
        dateCurrencyAmount.setAmount(new BigDecimal("111.2"));
        mt910Creator.setDateCurrencyAmount(dateCurrencyAmount);
        //50 50A
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50","910");
        orderingCustomer.setAcctno("183793938223");
        orderingCustomer.setBic("PSBCCNBJAAAAAAAAAAAA");
        mt910Creator.setOrderingCustomer(orderingCustomer);
        //52 52A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setInfo("C");
        orderingInstitution.setPartyIdentifier("FINANZBANK AG");
        orderingInstitution.setBic("ABOCCNBJ110");
        mt910Creator.setOrderingInstitution(orderingInstitution);
        //56 56A
        ActnoBicAdrTagXXX intermediary = new ActnoBicAdrTagXXX("56");
        intermediary.setInfo("C");
        intermediary.setPartyIdentifier("FINANZBANK AG");
        intermediary.setBic("ABOCCNBJ110");
        mt910Creator.setIntermediary(intermediary);
        mt910Creator.setSenderToReceiverInformation("/COMM/USD15,");
        MtResult mtResult = MtCreatorManager.packMT(mt910Creator);
    }
    @Test
    public void test_910_5(){
        MT910Creator mt910Creator = new MT910Creator("910");
        mt910Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt910Creator.setSendBic("PSBCCNBJXXX");//发报行
        //13D
        mt910Creator.setDateTimeIndication("1401081515+1300");
        //20
        mt910Creator.setTransactionReferenceNumber("C11126A1378");
        //21
        mt910Creator.setRelatedReference("5482ABC");
        //25
        ActnoBicAdrTagXXX actnoBicAdrTag25X = new ActnoBicAdrTagXXX("25");
        actnoBicAdrTag25X.setAcctno("9-9876543");
        actnoBicAdrTag25X.setBic("PSBCCNBJ");
        mt910Creator.setAccountIdentification(actnoBicAdrTag25X);
        //32A
        DcDateCurAmtTagXXX dateCurrencyAmount = new DcDateCurAmtTagXXX("32");
        dateCurrencyAmount.setDate("220602");
        dateCurrencyAmount.setCurrency("EUR");
        dateCurrencyAmount.setAmount(new BigDecimal("111.2"));
        mt910Creator.setDateCurrencyAmount(dateCurrencyAmount);
        //56 56A
        ActnoBicAdrTagXXX intermediary = new ActnoBicAdrTagXXX("56");
        intermediary.setInfo("C");
        intermediary.setPartyIdentifier("FINANZBANK AG");
        intermediary.setBic("PSBCCNBJ");
        mt910Creator.setIntermediary(intermediary);
        mt910Creator.setSenderToReceiverInformation("/COMM/USD15,");
        MtResult mtResult = MtCreatorManager.packMT(mt910Creator);
    }
}
