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.MT732Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt7xx.MT734Creator;
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 Mt734Test {
    @Test
    public void mt734_Test(){
        //32A
        DcDateCurAmtTagXXX dateAndAmountOfUtilisation = new DcDateCurAmtTagXXX("32");
        dateAndAmountOfUtilisation.setDate("365892");
        dateAndAmountOfUtilisation.setCurrency("AOP");
        dateAndAmountOfUtilisation.setAmount(new BigDecimal("123.22"));
        //33a
        DcDateCurAmtTagXXX totalAmountClaimed = new DcDateCurAmtTagXXX("33");
        totalAmountClaimed.setCurrency("AOP");
        totalAmountClaimed.setAmount(new BigDecimal("123.22"));

        //57a
        ActnoBicAdrTagXXX accountWithBank = new ActnoBicAdrTagXXX("57");
        accountWithBank.setPartyIdentifier("CNBANKWHLOCAL");
        accountWithBank.setBic("TESTTEST");
        accountWithBank.setAddress("WHYHCNHBXXX");


        /********以上为json参数**************/
        MT734Creator mt734Creator = new MT734Creator("734");
        mt734Creator.setSendersTRN("DAE74568");//20
        mt734Creator.setPresentingBanksReference("IMP124678");//21
        mt734Creator.setChargesClaimed("YOUR CHARGES GBP 95,\n" +
                " CABLE GBP10,\n" +
                " INTEREST GBP18,");//73A
        mt734Creator.setSenderToReceiverInformation("wwwwwwwwww");//72Z
        mt734Creator.setAccountWithBank(accountWithBank);//57a
        mt734Creator.setTotalAmountClaimed(totalAmountClaimed);//33a
        mt734Creator.setDateAndAmountOfUtilisation(dateAndAmountOfUtilisation);//32a
        mt734Creator.setDisposalofDocuments("/HOLD/");//77B
        mt734Creator.setDiscrepancies("PARTSHIPMENT EFFECTED\n" +
                " DECLARATION THAT VESSEL IS RUNNING\n" +
                " IN REGULAR LINE SERVICE NOT PRESENTED");//77J
        //MtResult mtResult= MtCreatorManager.pack(mt734Creator);
        MtCreatorManager.packMT(mt734Creator);

    }

}
