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.MT711Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt7xx.MT734Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt7xx.MT740Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import org.junit.Test;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * @author gaosheng
 * @date 2023/3/1
 */
public class Mt740Test {
    @Test
    public void mt740_Test(){
        ActnoBicAdrTagXXX negotiatingBank = new ActnoBicAdrTagXXX("58");
        negotiatingBank.setPartyIdentifier("ppo888p");
        negotiatingBank.setCode("QQQQ");
        negotiatingBank.setBic("TESTTE23");
        //59
        ActnoBicAdrTagXXX beneficiary = new ActnoBicAdrTagXXX("59");
        beneficiary.setAddress("frrfg");

        //41a
        ActnoBicAdrTagXXX availableWithBy = new ActnoBicAdrTagXXX("41");
        //availableWithBy.setPartyIdentifier("ppo888p");
        availableWithBy.setCode("QQQQ");
        availableWithBy.setBic("TESTTE23");

        //42a
        ActnoBicAdrTagXXX drawee = new ActnoBicAdrTagXXX("42");
        drawee.setPartyIdentifier("ppo888p");
        drawee.setCode("QQQQ");
        drawee.setBic("TESTTE23");

        MT740Creator mt740Creator = new MT740Creator("740");
        mt740Creator.setMsgType("740");
        mt740Creator.setDocumentaryCreditNumber("DC.IMP 3410/3444");
        mt740Creator.setAccountIdentification("YRI LATEST VERSION");
        mt740Creator.setApplicableRules("URR LATEST VERSION");
        mt740Creator.setDateAndPlaceOfExpiry("963258AA");
        //32B
        DcDateCurAmtTagXXX creditAmount=new DcDateCurAmtTagXXX("32");
        creditAmount.setAmount(new BigDecimal("1000.00"));
        creditAmount.setCurrency("USD");
        mt740Creator.setCreditAmount(creditAmount);

        mt740Creator.setPercentageCreditAmountTolerance("23/63");
        mt740Creator.setAdditionalAmountsCovered("ssddff");
        mt740Creator.setSenderToReceiverInformation("RESTRICTED TO CLAIMING BANK'S \n" +
                " ACCEPTANCE COMMISSION");
        mt740Creator.setDraftsAt("ssddff");
     //   mt740Creator.setMixedPaymentDetails("ssddff");
     //   mt740Creator.setNegotiationDPD("ssddff");
        mt740Creator.setReimbursingBanksCharges("CLM");
        mt740Creator.setOtherCharges("ssddff");
        mt740Creator.setNegotiatingBank(negotiatingBank);
       // mt740Creator.setBeneficiary(beneficiary);
        mt740Creator.setAvailableWithBy(availableWithBy);
        mt740Creator.setDrawee(drawee);
        MtResult mtResult= MtCreatorManager.packMT(mt740Creator);

    }

}
