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.MT705Creator;
import org.junit.Test;

import java.math.BigDecimal;


public class MT705Test {
    /**
     * @author wanggang
     * @date 2023/3/1
     */
    @Test
    public void mt705_Test() throws ClassNotFoundException {

        //构造参数传入MT报文类型
        MT705Creator mt705Creator=new MT705Creator("705");

        //40A
        mt705Creator.setFormofDocumentaryCredit("fsdfs");//24x
        //20
        mt705Creator.setDocumentaryCreditNumber("sdf");//16x
        //31D
        mt705Creator.setDateandPlaceofExpiry("97557713DUSR4b");//6!n29x
        //50
        mt705Creator.setApplicant("sdfffe");//4*35x
        //59
        mt705Creator.setBeneficiary("/sdfs\ndsfs");//[/34x]<crlf>4*35x
        //32B
        DcDateCurAmtTagXXX currencyCodeAmount=new DcDateCurAmtTagXXX("32");
        currencyCodeAmount.setAmount(new BigDecimal("1000.00"));
        currencyCodeAmount.setCurrency("USD");
        mt705Creator.setCurrencyCodeAmount(currencyCodeAmount);//3!a15d
        //39A
        mt705Creator.setPercentageCreditAmountTolerance("26/79");//2n/2n
        //39C
        mt705Creator.setAdditionalAmountsCovered("dsfefe");//4*35x
        //41a
        ActnoBicAdrTagXXX availableWithBy = new ActnoBicAdrTagXXX("41");
       // availableWithBy.setPartyIdentifier("ppo888p");
        availableWithBy.setCode("ST");
        availableWithBy.setBic("ABNANL2A");
        mt705Creator.setAvailableWithBy(availableWithBy);//A or D
        //44A
        mt705Creator.setPlaceofTakinginChargeDispatchfromPlaceofReceipt("sdfse");//65x
        //44E
        mt705Creator.setPortofLoadingAirportofDeparture("dsfsf");//65x
        //44F
        mt705Creator.setPortofDischargeAirportofDestination("sdfvds");//65x
        //44B
        mt705Creator.setPlaceofFinalDestinationForTransportationtoPlaceofDelivery("sfefe");//65x
        //44C
       // mt705Creator.setLatestDateofShipment("369854");//6!n
        //44D
        mt705Creator.setShipmentPeriod("sdfefes");//6*65x
        //45A
        mt705Creator.setDescriptionofGoodsandorServices("sfesff");//100*65z
        //57a
        ActnoBicAdrTagXXX adviseThroughBank = new ActnoBicAdrTagXXX("57");
        adviseThroughBank.setPartyIdentifier("9020123100");
        adviseThroughBank.setCode("ST");
        adviseThroughBank.setBic("ABNANL2A");
        mt705Creator.setAdviseThroughBank(adviseThroughBank);//A, B, or D
        //79Z
        mt705Creator.setNarrative("dsfefe");//35*50z
        //72Z
        mt705Creator.setSendertoReceiverInformation("sdfefefe");//6*35z


        MtCreatorManager.packMT(mt705Creator);
    }

}