package com.brilliance.isc.convert.mt4xx;

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.mt4xx.MT400Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import org.junit.Test;
import java.math.BigDecimal;

/**
 * @author gechengyang
 * @date 2023/2/27
 */
public class MT400Test {

    @Test
    public void test_400(){
        MT400Creator mt400Creator = new MT400Creator("400");
        mt400Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt400Creator.setSendBic("PSBCCNBJXXX");//发报行
        //20
        mt400Creator.setSendingBankTRN("COL456");
        //21
        mt400Creator.setRelatedReference("REM432");
        //32 32K
        DcDateCurAmtTagXXX amountCollected = new DcDateCurAmtTagXXX("32");
        amountCollected.setDayMonth("D");
        amountCollected.setNumberOfDaysMonths("000");
        amountCollected.setCode("ST");
        amountCollected.setCurrency("EUR");
        amountCollected.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setAmountCollected(amountCollected);
        //33  33A
        DcDateCurAmtTagXXX dcDateCurAmt33A = new DcDateCurAmtTagXXX("33");
        dcDateCurAmt33A.setDate("220807");
        dcDateCurAmt33A.setCurrency("EUR");
        dcDateCurAmt33A.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setProceedsRemitted(dcDateCurAmt33A);
        //52 52A
        ActnoBicAdrTagXXX orderingBank=new ActnoBicAdrTagXXX("52");
        orderingBank.setInfo("D");
        orderingBank.setPartyIdentifier("1234-5678");
        orderingBank.setBic("WHYHCNHBXXX");
        mt400Creator.setOrderingBank(orderingBank);
        //53 53A
        ActnoBicAdrTagXXX senderCorrespondent=new ActnoBicAdrTagXXX("53");
        senderCorrespondent.setInfo("D");
        senderCorrespondent.setPartyIdentifier("1234-5678");
        senderCorrespondent.setBic("WHYHCNHBXXX");
        mt400Creator.setSenderCorrespondent(senderCorrespondent);
        //54
        ActnoBicAdrTagXXX receiverCorrespondent=new ActnoBicAdrTagXXX("54");
        receiverCorrespondent.setInfo("D");
        receiverCorrespondent.setPartyIdentifier("1234-5678");
        receiverCorrespondent.setBic("WHYHCNHBXXX");
        mt400Creator.setReceiverCorrespondent(receiverCorrespondent);
        //57 57A
        ActnoBicAdrTagXXX accountWithBank=new ActnoBicAdrTagXXX("57");
        accountWithBank.setInfo("D");
        accountWithBank.setPartyIdentifier("1234-5678");
        accountWithBank.setBic("WHYHCNHBXXX");
        mt400Creator.setAccountWithBank(accountWithBank);
        //58 58A
        ActnoBicAdrTagXXX beneficiaryBank=new ActnoBicAdrTagXXX("58");
        beneficiaryBank.setInfo("D");
        beneficiaryBank.setPartyIdentifier("DASDSAD");
        beneficiaryBank.setBic("WHYHCNHBXXX");
        mt400Creator.setBeneficiaryBank(beneficiaryBank);
        //71B
        mt400Creator.setDetailsOfCharges("/COMM/USD15,");
        //72
        mt400Creator.setSenderToReceiverInformation("/HOLDING/");
        //73
        mt400Creator.setDetailsOfAmountsAdded("GOODS WAREHOUSED AND INSURED");
        MtResult mtResult= MtCreatorManager.packMT(mt400Creator);
    }
    @Test
    public void test_400_2(){
        MT400Creator mt400Creator = new MT400Creator("400");
        mt400Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt400Creator.setSendBic("PSBCCNBJXXX");//发报行
        //20
        mt400Creator.setSendingBankTRN("COL456");
        //21
        mt400Creator.setRelatedReference("REM432");
        //32 32A
        DcDateCurAmtTagXXX amountCollected = new DcDateCurAmtTagXXX("32");
        amountCollected.setDate("220608");
        amountCollected.setCurrency("EUR");
        amountCollected.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setAmountCollected(amountCollected);
        //33  33A
        DcDateCurAmtTagXXX dcDateCurAmt33A = new DcDateCurAmtTagXXX("33");
        dcDateCurAmt33A.setDate("220807");
        dcDateCurAmt33A.setCurrency("EUR");
        dcDateCurAmt33A.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setProceedsRemitted(dcDateCurAmt33A);
        //52 52D
        ActnoBicAdrTagXXX orderingBank=new ActnoBicAdrTagXXX("52");
        orderingBank.setInfo("D");
        orderingBank.setPartyIdentifier("1234-5678");
        orderingBank.setAddress("HUBEI WUHAN");
        mt400Creator.setOrderingBank(orderingBank);
        //53 53B
        ActnoBicAdrTagXXX senderCorrespondent=new ActnoBicAdrTagXXX("53");
        senderCorrespondent.setInfo("D");
        senderCorrespondent.setPartyIdentifier("FINANZBANK AG");
        senderCorrespondent.setLocation("JIANG SU");
        mt400Creator.setSenderCorrespondent(senderCorrespondent);
        //54 54B
        ActnoBicAdrTagXXX receiverCorrespondent=new ActnoBicAdrTagXXX("54");
        receiverCorrespondent.setInfo("D");
        receiverCorrespondent.setPartyIdentifier("FINANZBANK AG");
        receiverCorrespondent.setLocation("JIANG SU");
        mt400Creator.setReceiverCorrespondent(receiverCorrespondent);
        //57 57D
        ActnoBicAdrTagXXX accountWithBank=new ActnoBicAdrTagXXX("57");
        accountWithBank.setInfo("D");
        accountWithBank.setPartyIdentifier("FINANZBANK AG");
        accountWithBank.setAddress("HUBEI WUHAN");
        mt400Creator.setAccountWithBank(accountWithBank);
        //58 58B
        ActnoBicAdrTagXXX beneficiaryBank=new ActnoBicAdrTagXXX("58");
        beneficiaryBank.setInfo("D");
        beneficiaryBank.setPartyIdentifier("FINANZBANK AG");
        beneficiaryBank.setLocation("JIANG SU");
        mt400Creator.setBeneficiaryBank(beneficiaryBank);
        //71B
        mt400Creator.setDetailsOfCharges("/COMM/USD15,");
        //72
        mt400Creator.setSenderToReceiverInformation("/HOLDING/");
        //73
        mt400Creator.setDetailsOfAmountsAdded("GOODS WAREHOUSED AND INSURED");
        MtResult mtResult= MtCreatorManager.packMT(mt400Creator);
    }
    @Test
    public void test_400_3(){
        MT400Creator mt400Creator = new MT400Creator("400");
        mt400Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt400Creator.setSendBic("PSBCCNBJXXX");//发报行
        //20
        mt400Creator.setSendingBankTRN("COL456");
        //21
        mt400Creator.setRelatedReference("REM432");
        //32 32B
        DcDateCurAmtTagXXX amountCollected = new DcDateCurAmtTagXXX("32");
        amountCollected.setCurrency("EUR");
        amountCollected.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setAmountCollected(amountCollected);
        //33  33A
        DcDateCurAmtTagXXX dcDateCurAmt33A = new DcDateCurAmtTagXXX("33");
        dcDateCurAmt33A.setDate("220807");
        dcDateCurAmt33A.setCurrency("EUR");
        dcDateCurAmt33A.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setProceedsRemitted(dcDateCurAmt33A);
        //52 52D
        ActnoBicAdrTagXXX orderingBank=new ActnoBicAdrTagXXX("52");
        orderingBank.setInfo("D");
        orderingBank.setPartyIdentifier("FINANZBANK AG");
        orderingBank.setAddress("HUBEI WUHAN");
        mt400Creator.setOrderingBank(orderingBank);
        //53 53D
        ActnoBicAdrTagXXX senderCorrespondent=new ActnoBicAdrTagXXX("53");
        senderCorrespondent.setInfo("D");
        senderCorrespondent.setPartyIdentifier("1234-5678");
        senderCorrespondent.setAddress("HUBEI WUHAN");
        mt400Creator.setSenderCorrespondent(senderCorrespondent);
        //54 54D
        ActnoBicAdrTagXXX receiverCorrespondent=new ActnoBicAdrTagXXX("54");
        receiverCorrespondent.setInfo("D");
        receiverCorrespondent.setPartyIdentifier("FINANZBANK AG");
        receiverCorrespondent.setAddress("HUBEI WUHAN");
        mt400Creator.setReceiverCorrespondent(receiverCorrespondent);
        //57 57D
        ActnoBicAdrTagXXX accountWithBank=new ActnoBicAdrTagXXX("57");
        accountWithBank.setInfo("D");
        accountWithBank.setPartyIdentifier("FINANZBANK AG");
        accountWithBank.setAddress("HUBEI WUHAN");
        mt400Creator.setAccountWithBank(accountWithBank);
        //58 58B
        ActnoBicAdrTagXXX beneficiaryBank=new ActnoBicAdrTagXXX("58");
        beneficiaryBank.setInfo("D");
        beneficiaryBank.setPartyIdentifier("FINANZBANK AG");
        beneficiaryBank.setAddress("HUBEI WUHAN");
        mt400Creator.setBeneficiaryBank(beneficiaryBank);
        //71B
        mt400Creator.setDetailsOfCharges("/COMM/USD15,");
        //72
        mt400Creator.setSenderToReceiverInformation("/HOLDING/");
        //73
        mt400Creator.setDetailsOfAmountsAdded("GOODS WAREHOUSED AND INSURED");
        MtResult mtResult= MtCreatorManager.packMT(mt400Creator);
    }
    @Test
    public void test_400_4(){
        MT400Creator mt400Creator = new MT400Creator("400");
        mt400Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt400Creator.setSendBic("PSBCCNBJXXX");//发报行
        //20
        mt400Creator.setSendingBankTRN("COL456AAAAAAAAAAAAAA");
        //21
        mt400Creator.setRelatedReference("REM432AAAAAAAAAA");
        //32 32B
        DcDateCurAmtTagXXX amountCollected = new DcDateCurAmtTagXXX("32");
        amountCollected.setCurrency("EURAAAA");
        amountCollected.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setAmountCollected(amountCollected);
        //33  33A
        DcDateCurAmtTagXXX dcDateCurAmt33A = new DcDateCurAmtTagXXX("33");
        dcDateCurAmt33A.setDate("22080721");
        dcDateCurAmt33A.setCurrency("EURAA");
        dcDateCurAmt33A.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setProceedsRemitted(dcDateCurAmt33A);
        //52 52D
        ActnoBicAdrTagXXX orderingBank=new ActnoBicAdrTagXXX("52");
        orderingBank.setInfo("DAAA");
        orderingBank.setPartyIdentifier("FINANZBANK AG");
        orderingBank.setAddress("HUBEI WUHAN");
        mt400Creator.setOrderingBank(orderingBank);
        //53 53D
        ActnoBicAdrTagXXX senderCorrespondent=new ActnoBicAdrTagXXX("53");
        senderCorrespondent.setInfo("D");
        senderCorrespondent.setPartyIdentifier("1234-5678");
        senderCorrespondent.setAddress("HUBEI WUHAN");
        mt400Creator.setSenderCorrespondent(senderCorrespondent);
        //54 54D
        ActnoBicAdrTagXXX receiverCorrespondent=new ActnoBicAdrTagXXX("54");
        receiverCorrespondent.setInfo("D");
        receiverCorrespondent.setPartyIdentifier("FINANZBANK AG");
        receiverCorrespondent.setAddress("HUBEI WUHAN");
        mt400Creator.setReceiverCorrespondent(receiverCorrespondent);
        //57 57D
        ActnoBicAdrTagXXX accountWithBank=new ActnoBicAdrTagXXX("57");
        accountWithBank.setInfo("DAAA");
        accountWithBank.setPartyIdentifier("FINANZBANK AG");
        accountWithBank.setAddress("HUBEI WUHAN");
        mt400Creator.setAccountWithBank(accountWithBank);
        //58 58B
        ActnoBicAdrTagXXX beneficiaryBank=new ActnoBicAdrTagXXX("58");
        beneficiaryBank.setInfo("DAAAAA");
        beneficiaryBank.setPartyIdentifier("FINANZBANK AG");
        beneficiaryBank.setAddress("HUBEI WUHAN");
        mt400Creator.setBeneficiaryBank(beneficiaryBank);
        //71B
        mt400Creator.setDetailsOfCharges("/COMM/USD15,");
        //72
        mt400Creator.setSenderToReceiverInformation("/HOLDING/");
        //73
        mt400Creator.setDetailsOfAmountsAdded("GOODS WAREHOUSED AND INSURED");
        MtResult mtResult= MtCreatorManager.packMT(mt400Creator);
    }
    @Test
    public void test_400_5(){
        MT400Creator mt400Creator = new MT400Creator("400");
        mt400Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt400Creator.setSendBic("PSBCCNBJXXX");//发报行
        //20
        mt400Creator.setSendingBankTRN("COL456");
        //21
        mt400Creator.setRelatedReference("REM432");
        //32 32B
        DcDateCurAmtTagXXX amountCollected = new DcDateCurAmtTagXXX("32");
        amountCollected.setCurrency("EUR");
        amountCollected.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setAmountCollected(amountCollected);
        //33  33A
        DcDateCurAmtTagXXX dcDateCurAmt33A = new DcDateCurAmtTagXXX("33");
        dcDateCurAmt33A.setDate("220807");
        dcDateCurAmt33A.setCurrency("USD");
        dcDateCurAmt33A.setAmount(new BigDecimal("1111111111.00"));
        mt400Creator.setProceedsRemitted(dcDateCurAmt33A);
        //52 52D
        ActnoBicAdrTagXXX orderingBank=new ActnoBicAdrTagXXX("52");
        orderingBank.setInfo("D");
        orderingBank.setPartyIdentifier("FINANZBANK AG");
        orderingBank.setAddress("HUBEI WUHAN");
        mt400Creator.setOrderingBank(orderingBank);
        //57 57D
        ActnoBicAdrTagXXX accountWithBank=new ActnoBicAdrTagXXX("57");
        accountWithBank.setInfo("D");
        accountWithBank.setPartyIdentifier("1234-5678");
        accountWithBank.setAddress("HUBEI WUHAN");
        mt400Creator.setAccountWithBank(accountWithBank);
        //58 58B
        ActnoBicAdrTagXXX beneficiaryBank=new ActnoBicAdrTagXXX("58");
        beneficiaryBank.setInfo("D");
        beneficiaryBank.setPartyIdentifier("FINANZBANK AG");
        beneficiaryBank.setAddress("HUBEI WUHAN");
        mt400Creator.setBeneficiaryBank(beneficiaryBank);
        //71B
        mt400Creator.setDetailsOfCharges("/COMM/USD15,");
        //72
        mt400Creator.setSenderToReceiverInformation("/HOLDING/");
        //73
        mt400Creator.setDetailsOfAmountsAdded("GOODS WAREHOUSED AND INSURED");
        MtResult mtResult= MtCreatorManager.packMT(mt400Creator);
    }

}
