package com.brilliance.isc.convert.mt7xx;

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.mt7xx.MT750Creator;
import org.junit.Test;
import java.math.BigDecimal;


public class MT750Test {
    /**
     * @author wanggang
     * @date 2023/3/1
     */
    @Test
    public void mt750_Test() {

        //构造参数传入MT报文类型
        MT750Creator mt750Creator=new MT750Creator("750");
        mt750Creator.setRecvBic("ESSESESS");//收报行
        mt750Creator.setSendBic("GEBABEBB");//发报行
        //20 16x
        mt750Creator.setSendersReference("EXP98734");
        //21 16x
        mt750Creator.setRelatedReference("DC.IMP 3410/3444");
        //32B 3!a15d
        DcDateCurAmtTagXXX principalAmount = new DcDateCurAmtTagXXX("32");
        principalAmount.setCurrency("USD");//3!a
        principalAmount.setAmount(new BigDecimal("34750"));//15d
        mt750Creator.setPrincipalAmount(principalAmount);
        //33B 3!a15d
        DcDateCurAmtTagXXX additionalAmount = new DcDateCurAmtTagXXX("33");
        additionalAmount.setCurrency("EUR");//3!a
        additionalAmount.setAmount(new BigDecimal("498773"));//15d
        mt750Creator.setAdditionalAmount(additionalAmount);
        //71D 6*35z
        ActnoBicAdrTagXXX chargestobeDeducted = new ActnoBicAdrTagXXX("71");
        chargestobeDeducted.setNarrative("BTRBDV\r\n34856");//6*35z
        mt750Creator.setChargestobeDeducted(chargestobeDeducted);
        //73A 6*35z
        ActnoBicAdrTagXXX chargestobeAdded = new ActnoBicAdrTagXXX("73");
        chargestobeAdded.setNarrative("ERGHTE\r\n9020123100");//6*35z
        mt750Creator.setChargestobeAdded(chargestobeAdded);
        //34B 3!a15d
        DcDateCurAmtTagXXX totalAmounttobePaid = new DcDateCurAmtTagXXX("34");
        totalAmounttobePaid.setCurrency("USD");//3!a
        totalAmounttobePaid.setAmount(new BigDecimal("123.22"));//15d
        mt750Creator.setTotalAmounttobePaid(totalAmounttobePaid);
        //57a 57A
        ActnoBicAdrTagXXX accountWithBank = new ActnoBicAdrTagXXX("57");
        accountWithBank.setPartyIdentifier("A");//[/1!a][/34x]
        accountWithBank.setBic("FREGRGBJXXX");//57A 4!a2!a2!c[3!c]
        //accountWithBank.setLocation("JYRNTBF");//57B [35x]
        //accountWithBank.setAddress("DSVCDB\r\nMNDFVDR");//57D 4*35x
        mt750Creator.setAccountWithBank(accountWithBank);
        //72Z 6*35z
        ActnoBicAdrTagXXX sendertoReceiverInformation = new ActnoBicAdrTagXXX("72");
        sendertoReceiverInformation.setNarrative("EWVSV\r\n6876GGD");//6*35z
        mt750Creator.setSendertoReceiverInformation(sendertoReceiverInformation);
        //77J 70*50z
        ActnoBicAdrTagXXX discrepancies = new ActnoBicAdrTagXXX("77");
        discrepancies.setNarrative("COPY CONSULAR INVOICE NOT\r\nPRESENTED AND COPY LETTER FROM\r\nBENEFICIARY'S TO APPLICANT DOES NOT\r\nSHOW ORIGINAL CONSULAR INVOICE\r\nAIRMAILED TO APPLICANT");//70*50z
        mt750Creator.setDiscrepancies(discrepancies);

        MtCreatorManager.packMT(mt750Creator);
    }

    @Test
    public void mt750_Test2() {

        //构造参数传入MT报文类型
        MT750Creator mt750Creator=new MT750Creator("750");
        mt750Creator.setRecvBic("ESSESESS");//收报行
        mt750Creator.setSendBic("GEBABEBB");//发报行
        //20 16x
        mt750Creator.setSendersReference("EXP98734");
        //21 16x
        mt750Creator.setRelatedReference("DC.IMP 3410/3444");
        //32B 3!a15d
        DcDateCurAmtTagXXX principalAmount = new DcDateCurAmtTagXXX("32");
        principalAmount.setCurrency("USD");//3!a
        principalAmount.setAmount(new BigDecimal("34750"));//15d
        mt750Creator.setPrincipalAmount(principalAmount);
        //33B 3!a15d
        DcDateCurAmtTagXXX additionalAmount = new DcDateCurAmtTagXXX("33");
        additionalAmount.setCurrency("EUR");//3!a
        additionalAmount.setAmount(new BigDecimal("498773"));//15d
        mt750Creator.setAdditionalAmount(additionalAmount);
        //71D 6*35z
        ActnoBicAdrTagXXX chargestobeDeducted = new ActnoBicAdrTagXXX("71");
        chargestobeDeducted.setNarrative("BTRBDV\r\n34856");//6*35z
        mt750Creator.setChargestobeDeducted(chargestobeDeducted);
        //73A 6*35z
        ActnoBicAdrTagXXX chargestobeAdded = new ActnoBicAdrTagXXX("73");
        chargestobeAdded.setNarrative("ERGHTE\r\n9020123100");//6*35z
        mt750Creator.setChargestobeAdded(chargestobeAdded);
        //34B 3!a15d
        DcDateCurAmtTagXXX totalAmounttobePaid = new DcDateCurAmtTagXXX("34");
        totalAmounttobePaid.setCurrency("AOP");//3!a
        totalAmounttobePaid.setAmount(new BigDecimal("123.22"));//15d
        mt750Creator.setTotalAmounttobePaid(totalAmounttobePaid);
        //57a 57B
        ActnoBicAdrTagXXX accountWithBank = new ActnoBicAdrTagXXX("57");
        accountWithBank.setPartyIdentifier("B");//[/1!a][/34x]
        //accountWithBank.setBic("FREGRGBJXXX");//57A 4!a2!a2!c[3!c]
        accountWithBank.setLocation("JYRNTBF");//57B [35x]
        //accountWithBank.setAddress("DSVCDB\r\nMNDFVDR");//57D 4*35x
        mt750Creator.setAccountWithBank(accountWithBank);
        //72Z 6*35z
        ActnoBicAdrTagXXX sendertoReceiverInformation = new ActnoBicAdrTagXXX("72");
        sendertoReceiverInformation.setNarrative("EWVSV\r\n6876GGD");//6*35z
        mt750Creator.setSendertoReceiverInformation(sendertoReceiverInformation);
        //77J 70*50z
        ActnoBicAdrTagXXX discrepancies = new ActnoBicAdrTagXXX("77");
        discrepancies.setNarrative("COPY CONSULAR INVOICE NOT\r\nPRESENTED AND COPY LETTER FROM\r\nBENEFICIARY'S TO APPLICANT DOES NOT\r\nSHOW ORIGINAL CONSULAR INVOICE\r\nAIRMAILED TO APPLICANT");//70*50z
        mt750Creator.setDiscrepancies(discrepancies);

        MtCreatorManager.packMT(mt750Creator);
    }

    @Test
    public void mt750_Test3() {

        //构造参数传入MT报文类型
        MT750Creator mt750Creator=new MT750Creator("750");
        mt750Creator.setRecvBic("ESSESESS");//收报行
        mt750Creator.setSendBic("GEBABEBB");//发报行
        //20 16x
        mt750Creator.setSendersReference("EXP98734");
        //21 16x
        mt750Creator.setRelatedReference("DC.IMP 3410/3444");
        //32B 3!a15d
        DcDateCurAmtTagXXX principalAmount = new DcDateCurAmtTagXXX("32");
        principalAmount.setCurrency("USD");//3!a
        principalAmount.setAmount(new BigDecimal("34750"));//15d
        mt750Creator.setPrincipalAmount(principalAmount);
        //33B 3!a15d
        DcDateCurAmtTagXXX additionalAmount = new DcDateCurAmtTagXXX("33");
        additionalAmount.setCurrency("EUR");//3!a
        additionalAmount.setAmount(new BigDecimal("498773"));//15d
        mt750Creator.setAdditionalAmount(additionalAmount);
        //71D 6*35z
        ActnoBicAdrTagXXX chargestobeDeducted = new ActnoBicAdrTagXXX("71");
        chargestobeDeducted.setNarrative("BTRBDV\r\n34856");//6*35z
        mt750Creator.setChargestobeDeducted(chargestobeDeducted);
        //73A 6*35z
        ActnoBicAdrTagXXX chargestobeAdded = new ActnoBicAdrTagXXX("73");
        chargestobeAdded.setNarrative("ERGHTE\r\n9020123100");//6*35z
        mt750Creator.setChargestobeAdded(chargestobeAdded);
        //34B 3!a15d
        DcDateCurAmtTagXXX totalAmounttobePaid = new DcDateCurAmtTagXXX("34");
        totalAmounttobePaid.setCurrency("AOP");//3!a
        totalAmounttobePaid.setAmount(new BigDecimal("123.22"));//15d
        mt750Creator.setTotalAmounttobePaid(totalAmounttobePaid);
        //57a 57D
        ActnoBicAdrTagXXX accountWithBank = new ActnoBicAdrTagXXX("57");
        accountWithBank.setPartyIdentifier("D");//[/1!a][/34x]
        //accountWithBank.setBic("FREGRGBJXXX");//57A 4!a2!a2!c[3!c]
        //accountWithBank.setLocation("JYRNTBF");//57B [35x]
        accountWithBank.setAddress("DSVCDB\r\nMNDFVDR");//57D 4*35x
        mt750Creator.setAccountWithBank(accountWithBank);
        //72Z 6*35z
        ActnoBicAdrTagXXX sendertoReceiverInformation = new ActnoBicAdrTagXXX("72");
        sendertoReceiverInformation.setNarrative("EWVSV\r\n6876GGD");//6*35z
        mt750Creator.setSendertoReceiverInformation(sendertoReceiverInformation);
        //77J 70*50z
        ActnoBicAdrTagXXX discrepancies = new ActnoBicAdrTagXXX("77");
        discrepancies.setNarrative("COPY CONSULAR INVOICE NOT\r\nPRESENTED AND COPY LETTER FROM\r\nBENEFICIARY'S TO APPLICANT DOES NOT\r\nSHOW ORIGINAL CONSULAR INVOICE\r\nAIRMAILED TO APPLICANT");//70*50z
        mt750Creator.setDiscrepancies(discrepancies);

        MtCreatorManager.packMT(mt750Creator);
    }
}