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

import java.math.BigDecimal;



/**
 * @author gaosheng
 * @date 2023/2/28
 */

public class Mt710Test {
    @Test
    public void mt710_Test(){

        MT710Creator mt710Creator = new MT710Creator("710");

        //27
        mt710Creator.setSequenceofTotal("1/1");//1!n/1!n
        //40B
        mt710Creator.setFormofDocumentaryCredit("IRREVOCABLE\n" +
                " ADDING OUR CONFIRMATION");//24x<crlf>24x
        //20
        mt710Creator.setSendersReference("606487");//16x
        //21
        mt710Creator.setDocumentaryCreditNumber("123456");//16x
        //23
        mt710Creator.setReferencetoPreAdvice("PREADV/130510");//16x
        //31C
        mt710Creator.setDateofIssue("150202");//6!n
        //40E
        mt710Creator.setApplicableRules("UCP LATEST VERSION");//30x[/35x]
        //31D
        mt710Creator.setDateandPlaceofExpiry("150430AMSTERDAM");//6!n29x
        //52a
        ActnoBicAdrTagXXX issuingBank = new ActnoBicAdrTagXXX("52");
        issuingBank.setPartyIdentifier("OELBATWW");
        issuingBank.setCode("ST");
        issuingBank.setBic("ABNANL2A");
        mt710Creator.setIssuingBank(issuingBank);//A or D
        //50B/*mt710Creator.setNonBankIssuer("ABC COMPANY\n" +
        //                " KAERNTNERSTRASSE 3\n" +
        //                " AT/VIENNA");//4*35x*/

        //51a
        ActnoBicAdrTagXXX applicantBank = new ActnoBicAdrTagXXX("51");
        applicantBank.setPartyIdentifier("RD4pfSpNM");
        applicantBank.setCode("ST");
        applicantBank.setBic("ABNANL2A");
        mt710Creator.setApplicantBank(applicantBank);//A or D
        //50
        mt710Creator.setApplicant("45rwr");//4*35x
        //59
        ActnoBicAdrTagXXX beneficiary = new ActnoBicAdrTagXXX("59");
        beneficiary.setAddress("AMDAM COMPANY\n" +
                " PO BOX 123\n" +
                " NL/AMSTERDAM");
        mt710Creator.setBeneficiary(beneficiary);//[/34x]<crlf>4*35x
        //32B
        DcDateCurAmtTagXXX currencyCodeAmount=new DcDateCurAmtTagXXX("32");
        currencyCodeAmount.setAmount(new BigDecimal("1000.00"));
        currencyCodeAmount.setCurrency("USD");
        mt710Creator.setCurrencyCodeAmount(currencyCodeAmount);;//3!a15d
        //39A
        mt710Creator.setPercentageCreditAmountTolerance("55/46");//2n/2n
        //39C
        mt710Creator.setAdditionalAmountsCovered("f3fvxa");//4*35x
        //41a
        ActnoBicAdrTagXXX availableWithBy = new ActnoBicAdrTagXXX("41");
       // availableWithBy.setPartyIdentifier("RD4pfSpNM");
        availableWithBy.setCode("ST");
        availableWithBy.setBic("ABNANL2A");
        mt710Creator.setAvailableWithBy(availableWithBy);//A or D
        //42C
        mt710Creator.setDraftsat("dsfff");//3*35x
        //42a
        ActnoBicAdrTagXXX drawee = new ActnoBicAdrTagXXX("42");
        drawee.setPartyIdentifier("RD4pfSpNM");
        drawee.setCode("ST");
        drawee.setBic("ABNANL2A");
        mt710Creator.setDrawee(drawee);//A or D
        //42M
      //  mt710Creator.setMixedPaymentDetails("sdfvc");//4*35x
        //42P
      //  mt710Creator.setNegotiationDeferredPaymentDetails("dsffe");//4*35x
        //43P
        mt710Creator.setPartialShipments("NOT ALLOWED");//11x
        //43T
        mt710Creator.setTranshipment("ALLOWED");//11x
        //44A
        mt710Creator.setPlaceofTakinginChargeDispatchfromPlaceofReceipt("vdsccvx");//65x
        //44E
        mt710Creator.setPortofLoadingAirportofDeparture("AMSTERDAM");//65x
        //44F
        mt710Creator.setPortofDischargeAirportofDestination("VIENNA");//65x
        //44B
        mt710Creator.setPlaceofFinalDestinationForTransportationtoPlaceofDelivery("sfesf");//65x
        //44C
        //mt710Creator.setLatestDateofShipment("150415");//6!n
        //44D
        mt710Creator.setShipmentPeriod("dsfsefew");//6*65x
        //45A
        mt710Creator.setDescriptionofGoodsandorServices("400,000 BOTTLES OF BEER\n" +
                " PACKED 12 TO AN EXPORT CARTON\n" +
                " FCA AMSTERDAM");//100*65z
        //46A
        mt710Creator.setDocumentsRequired("SIGNED COMMERCIAL INVOICE IN DUPLICATE\n" +
                " PACKINGL LIST IN DUPLICATE\n" +
                " FORWARDING AGENTS CERTIFICATE OF RECEIPT\n" +
                "SHOWING GOODS ADDRESSED TO THE APPLICANT");//100*65z
        //47A
        mt710Creator.setAdditionalConditions("fewfef");//100*65z
        //49G
        mt710Creator.setSpecialPaymentConditionsforBeneficiary("wefe");//100*65z
        //49H
        mt710Creator.setSpecialPaymentConditionsforBankOnly("sfseefe");//100*65z
        //71D
        mt710Creator.setCharges("ALL BANKING CHARGES OUTSIDE ISSUING\n" +
                "  BANK ARE FOR THE BENEFICIARY");//6*35z
        //48
        mt710Creator.setPeriodforPresentationinDays("6/FORWARDING AGENT'S CERT OF RECEIPT");//3n[/35x]
        //49
        mt710Creator.setConfirmationInstructions("CONFIRM");//7!x
        //58a
        ActnoBicAdrTagXXX requestedConfirmationParty = new ActnoBicAdrTagXXX("58");
        requestedConfirmationParty.setPartyIdentifier("RD4pfSpNM");
        requestedConfirmationParty.setCode("ST");
        requestedConfirmationParty.setBic("ABNANL2A");
        mt710Creator.setRequestedConfirmationParty(requestedConfirmationParty);//A or D
        //53a
        ActnoBicAdrTagXXX reimbursingBank = new ActnoBicAdrTagXXX("53");
        reimbursingBank.setPartyIdentifier("RD4pfSpNM");
        reimbursingBank.setCode("ST");
        reimbursingBank.setBic("ABNANL2A");
        mt710Creator.setReimbursingBank(reimbursingBank);//A or D
        //78
        mt710Creator.setInstructionstothePayingAcceptingNegotiatingBank("dsfsf");//12*65x
        //57a
        ActnoBicAdrTagXXX adviseThroughBank = new ActnoBicAdrTagXXX("57");
        adviseThroughBank.setPartyIdentifier("RD4pfSpNM");
        adviseThroughBank.setCode("ST");
        adviseThroughBank.setBic("ABNANL2A");
        mt710Creator.setAdviseThroughBank(adviseThroughBank);//A, B, or D
        //72Z
        mt710Creator.setSendertoReceiverInformation("sdfsefe");//6*35z

        MtCreatorManager.packMT(mt710Creator);

    }

}

