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.MT754Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import org.junit.Test;

import java.math.BigDecimal;

public class MT754Test {
    @Test
    public void mt754_Test(){
        DcDateCurAmtTagXXX principalAmountPaidAN = new DcDateCurAmtTagXXX("32");
        //dcdatecuramt32a.setDate("990516");
        principalAmountPaidAN.setAmount(new BigDecimal("1000.00"));
        principalAmountPaidAN.setCurrency("USD");

        DcDateCurAmtTagXXX totalAmountClaimed = new DcDateCurAmtTagXXX("34");
        //dcdatecuramt34a.setDate("990516");
        totalAmountClaimed.setAmount(new BigDecimal("1000.00"));
        totalAmountClaimed.setCurrency("USD");

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

        ActnoBicAdrTagXXX accountWithBank = new ActnoBicAdrTagXXX("57");
        accountWithBank.setBic("PSBCCNBJXXX");
        accountWithBank.setAddress("WHYHCNHBXXX");
        accountWithBank.setPartyIdentifier("1234-5678");


        ActnoBicAdrTagXXX beneficiaryBank = new ActnoBicAdrTagXXX("58");
        beneficiaryBank.setBic("PSBCCNBJXXX");
        beneficiaryBank.setAddress("WHYHCNHBXXX");
        beneficiaryBank.setPartyIdentifier("1234-5678");


        MT754Creator mt754Creator=new MT754Creator("754");
        //20
        mt754Creator.setSendersReference("CL934372");
        //21
        mt754Creator.setRelatedReference("IMP 693/70224");
        //32a
        mt754Creator.setPrincipalAmountPaidAN(principalAmountPaidAN);
        //33B
        DcDateCurAmtTagXXX additionalAmounts=new DcDateCurAmtTagXXX("33");
        additionalAmounts.setAmount(new BigDecimal("1000.00"));
        additionalAmounts.setCurrency("USD");
        mt754Creator.setAdditionalAmounts(additionalAmounts);
        //71D
        mt754Creator.setChargesDeducted("COMMISSION EUR200,");
        //73A
        mt754Creator.setChargesAdded("130817EUR95200,");
        //34a
        mt754Creator.setTotalAmountClaimed(totalAmountClaimed);
        //53a
       // mt754Creator.setReimbursingBank(reimbursingBank);
        //57a
        mt754Creator.setAccountWithBank(accountWithBank);
        //58a
        mt754Creator.setBeneficiaryBank(beneficiaryBank);
        //72Z
     //   mt754Creator.setSenderToReceiverInformation("zxc");
        //77
        mt754Creator.setNarrative("FOUR (3) COMMERCIAL INVOICES\n"+
                "INSTEAD OF FIVE (5) PRESENTED");

        MtCreatorManager.packMT(mt754Creator);
    }
}
