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.MT756Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt7xx.MT759Creator;
import org.junit.Test;

import java.math.BigDecimal;

public class MT756Test {

    @Test
    public void mt756_Test() {


        ActnoBicAdrTagXXX sendersCorrespondent = new ActnoBicAdrTagXXX("53");
        sendersCorrespondent.setBic("TESTTEST");
        sendersCorrespondent.setAddress("WHYHCNHBXXX");
        sendersCorrespondent.setPartyIdentifier("1234-5678");


        ActnoBicAdrTagXXX receiversCorrespondent = new ActnoBicAdrTagXXX("54");
        receiversCorrespondent.setBic("TESTTEST");
        receiversCorrespondent.setAddress("WHYHCNHBXXX");
        receiversCorrespondent.setPartyIdentifier("1234-5678");

        //32B
        DcDateCurAmtTagXXX totalAmountClaimed = new DcDateCurAmtTagXXX("32");
        totalAmountClaimed.setAmount(new BigDecimal("1000.00"));
        totalAmountClaimed.setCurrency("USD");
        //33A
        DcDateCurAmtTagXXX amountReimbursedOrPaid = new DcDateCurAmtTagXXX("33");
        amountReimbursedOrPaid.setDate("990516");
        amountReimbursedOrPaid.setAmount(new BigDecimal("1000.00"));
        amountReimbursedOrPaid.setCurrency("USD");


        MT756Creator mt756Creator = new MT756Creator("756");//报文类型
        mt756Creator.setSendersReference("DC86411891");
        mt756Creator.setPresentingBanksReference("PT93118428");
        mt756Creator.setTotalAmountClaimed(totalAmountClaimed);
        mt756Creator.setAmountReimbursedOrPaid(amountReimbursedOrPaid);
        mt756Creator.setSendersCorrespondent(sendersCorrespondent);
        mt756Creator.setReceiversCorrespondent(receiversCorrespondent);
        mt756Creator.setSendertoReceiverInformation("+250 HAND PAINTED BAMBOO SCREENS\n" +
                "  +100 3H NO 6481\n" +
                " +150 SINGLE NO 2219");
        mt756Creator.setNarrative("+SIGNED COMMERCIAL INVOICE IN QUADRUPLICATE\n" +
                " +FORWARDING AGENT'S CERTIFICATE OF RECEIPT\n" +
                " SHOWING GOODS ADDRESSED TO HARROD'S");

        MtCreatorManager.packMT(mt756Creator);
    }
}
