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.MT700Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt7xx.MT701Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.google.gson.Gson;
import com.prowidesoftware.swift.model.mt.mt7xx.MT767;
import org.junit.Test;

import java.math.BigDecimal;


public class MT700Test {
    /**
     * @author wanggang
     * @date 2023/3/3
     */
    @Test
    public void mt700_Test(){

       MT700Creator mt700Creator = new MT700Creator("700");

       mt700Creator.setSequenceofTotal("1/1");
       mt700Creator.setFormofDocumentaryCredit("IRREVOCABLE");
       mt700Creator.setDocumentaryCreditNumber("123456");
       mt700Creator.setDateOfIssue("150202");
       mt700Creator.setApplicableRules("UCP LATEST VERSION");
       mt700Creator.setDateAndPlaceOfExpiry("150430AMSTERDAM");
       mt700Creator.setApplicant("ABC COMPANY\n" +
               " KAERNTNERSTRASSE 3\n" +
               " AT/VIENNA");
       //51a
        ActnoBicAdrTagXXX applicantBank = new ActnoBicAdrTagXXX("51");
        applicantBank.setPartyIdentifier("ppo888p");
        applicantBank.setCode("aaaa");
        applicantBank.setBic("TESTTE23");
        mt700Creator.setApplicantBank(applicantBank);//A or D

        //32B
        DcDateCurAmtTagXXX currencyCodeAmount = new DcDateCurAmtTagXXX("32");
        currencyCodeAmount.setAmount(new BigDecimal("1000.00"));
        currencyCodeAmount.setCurrency("USD");
        mt700Creator.setCurrencyCodeAmount(currencyCodeAmount);
        //59
        ActnoBicAdrTagXXX beneficiary = new ActnoBicAdrTagXXX("59");
        beneficiary.setAddress("frrfg");
        mt700Creator.setBeneficiary(beneficiary);


        mt700Creator.setPcentgeCrdtAmntTolrance("32/59");
        mt700Creator.setAdditionalAmountsCovered("kjhhkj");
        //41a
        ActnoBicAdrTagXXX availableWithBy = new ActnoBicAdrTagXXX("41");
        availableWithBy.setCode("code123");
        availableWithBy.setBic("PSBCCNBJ");
        mt700Creator.setAvailableWithBy(availableWithBy);
       //42a
        ActnoBicAdrTagXXX drawee=new ActnoBicAdrTagXXX("42");
       // actnoBicAdrTag41a.setCode("code123");
        drawee.setPartyIdentifier("ppo888p");
        drawee.setCode("aaaa");
        drawee.setBic("PSBCCNBJ");
        mt700Creator.setDrawee(drawee);

        //58a
        ActnoBicAdrTagXXX requestedConfirmationParty = new ActnoBicAdrTagXXX("58");
        requestedConfirmationParty.setPartyIdentifier("ppo888p");
        requestedConfirmationParty.setCode("aaaa");
        requestedConfirmationParty.setBic("TESTTE23");
        mt700Creator.setRequestedConfirmationParty(requestedConfirmationParty);//A or D

        //53a
        ActnoBicAdrTagXXX reimbursingBank = new ActnoBicAdrTagXXX("53");
        reimbursingBank.setPartyIdentifier("ppo888p");
        reimbursingBank.setCode("aaaa");
        reimbursingBank.setBic("TESTTE23");
        mt700Creator.setReimbursingBank(reimbursingBank);//A or D

        //57a
        ActnoBicAdrTagXXX adviseThroughBank = new ActnoBicAdrTagXXX("57");
        adviseThroughBank.setPartyIdentifier("ppo888p");
        adviseThroughBank.setCode("aaaa");
        adviseThroughBank.setBic("TESTTE23");
        mt700Creator.setAdviseThroughBank(adviseThroughBank);//A or D

        //72Z
        ActnoBicAdrTagXXX senderToReceiverInformation = new ActnoBicAdrTagXXX("72");
        senderToReceiverInformation.setNarrative("TESTTE23");
        mt700Creator.setSenderToReceiverInformation(senderToReceiverInformation);

       mt700Creator.setConfirmationInstructions("confirmation");
       mt700Creator.setDraftsAt("yyuij");
      // mt700Creator.setMixedPaymentDetails("dffff");
       mt700Creator.setNegtionDfredPaymentDetail("yioo");
       mt700Creator.setPartialShipments("NOT ALLOWED");
      // mt700Creator.setTranshipment("ALLOWED");
       mt700Creator.setPlaceOfTakInChargTranDeli("YIENNA");
       mt700Creator.setPortOfLoading("AMSTERDAM");
       mt700Creator.setPortOfDischarge("VIENNA");
       mt700Creator.setPlaceOfFinalDestination("UIENNA");
     //mt700Creator.setLatestDateOfShipment("369852");
       mt700Creator.setDescOfGoodsAndServ("+400,000 BOTTLES OF BEER\n" +
               " PACKED 12 TO AN EXPORT CARTON\n" +
               " +FCA AMSTERDAM");
       mt700Creator.setShipmentPeriod("mnbv");
       mt700Creator.setDocumentsRequired("+SIGNED COMMERCIAL INVOICE IN DUPLICATE\n" +
               " +PACKINGL LIST IN DUPLICATE\n" +
               " +FORWARDING AGENT'S CERTIFICATE OF RECEIPT\n" +
               " SHOWING GOODS ADDRESSED TO APPLICANT");
       mt700Creator.setAdditionalConditions("lllll");
       mt700Creator.setSpecPaymentCondForBenefi("MIENNA");
       mt700Creator.setSpecPaymCndiForRecvBank("kIENNA");
       mt700Creator.setCharges("ALL BANKING CHARGES OUTSIDE ISSUING\n" +
               "  BANK ARE FOR THE BENEFICIARY");
       mt700Creator.setPeriodForPresentaInDays("6/FORWARDING AGENT'S CERT OF RECEIPT");
       mt700Creator.setConfirmationInstructions("CONFIRM");
       mt700Creator.setInstrToThePayAccNegBank("EIENNA");
       mt700Creator.setReferencetoPreAdvice("QIENNA");



        MtResult mtResult = MtCreatorManager.packMT(mt700Creator);

    }

}