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.MT786Creator;
import org.junit.Test;
import java.math.BigDecimal;

/**
 * @author wuzhe
 * @date 2023/02/27
 */
public class MT786Test {

    @Test
    public void mt786_Test(){

        MT786Creator mt786Creator=new MT786Creator("786");
        mt786Creator.setSendBic("PSBCCNBJXXX");//发报行
        mt786Creator.setRecvBic("CIPSCNSHXXX");//收报行
        //20 16x
        mt786Creator.setUndertakingNumber("OVFMEEDFGBD");
        //52a 52A
        ActnoBicAdrTagXXX issuer = new ActnoBicAdrTagXXX("52");
        issuer.setPartyIdentifier("CNBANKWHLOCAL");//Party Identifier [/1!a][/34x]
        issuer.setBic("NWBKGB2L");//52A BIC 4!a2!a2!c[3!c]
        //issuer.setAddress("EBAF\r\nBGDFS");//52D Address 4*35x
        mt786Creator.setIssuer(issuer);
        //30 6!n
        mt786Creator.setDemandSubmissionDate("230327");
        //32B 3!a15d
        DcDateCurAmtTagXXX demandAmount = new DcDateCurAmtTagXXX("32");
        demandAmount.setCurrency("EUR");//3!a
        demandAmount.setAmount(new BigDecimal("1830000"));//15d
        mt786Creator.setDemandAmount(demandAmount);
        //77J 70*50z
        ActnoBicAdrTagXXX reasonforRefusal = new ActnoBicAdrTagXXX("72");
        reasonforRefusal.setNarrative("Please advise us execution\r\nand provide us with a copy\r\nof your guarantee for our files.");
        mt786Creator.setReasonforRefusal(reasonforRefusal);

        //非必选项
        //21 16x
        mt786Creator.setBeneficiaryReferenceNumber("TERSEACSDVF");
        //77B 3*35x
        mt786Creator.setDisposalofDocuments("NERSEFASFDVS\r\nNGDRGSFEA");
        //72Z 6*35z
        ActnoBicAdrTagXXX sendertoReceiverInformation = new ActnoBicAdrTagXXX("72");
        sendertoReceiverInformation.setNarrative("Please advise us execution\r\nand provide us with a copy\r\nof your guarantee for our files.");
        mt786Creator.setSendertoReceiverInformation(sendertoReceiverInformation);
        //23X 4!c/65x
        mt786Creator.setFileIdentification("ICOC/FERT");
        
        MtCreatorManager.packMT(mt786Creator);
    }

    @Test
    public void mt786_Test1(){

        MT786Creator mt786Creator=new MT786Creator("786");
        mt786Creator.setSendBic("PSBCCNBJXXX");//发报行
        mt786Creator.setRecvBic("CIPSCNSHXXX");//收报行
        //20 16x
        mt786Creator.setUndertakingNumber("OVFMEEDFGBD");
        //52a 52D
        ActnoBicAdrTagXXX issuer = new ActnoBicAdrTagXXX("52");
        issuer.setPartyIdentifier("CNBANKWHLOCAL");//Party Identifier [/1!a][/34x]
        //issuer.setBic("NWBKGB2L");//52A BIC 4!a2!a2!c[3!c]
        issuer.setAddress("EBAF\r\nBGDFS");//52D Address 4*35x
        mt786Creator.setIssuer(issuer);
        //30 6!n
        mt786Creator.setDemandSubmissionDate("230327");
        //32B 3!a15d
        DcDateCurAmtTagXXX demandAmount = new DcDateCurAmtTagXXX("32");
        demandAmount.setCurrency("EUR");//3!a
        demandAmount.setAmount(new BigDecimal("1830000"));//15d
        mt786Creator.setDemandAmount(demandAmount);
        //77J 70*50z
        ActnoBicAdrTagXXX reasonforRefusal = new ActnoBicAdrTagXXX("72");
        reasonforRefusal.setNarrative("Please advise us execution\r\nand provide us with a copy\r\nof your guarantee for our files.");
        mt786Creator.setReasonforRefusal(reasonforRefusal);

        //非必选项
        //21 16x
        mt786Creator.setBeneficiaryReferenceNumber("TERSEACSDVF");
        //77B 3*35x
        mt786Creator.setDisposalofDocuments("NERSEFASFDVS\r\nNGDRGSFEA");
        //72Z 6*35z
        ActnoBicAdrTagXXX sendertoReceiverInformation = new ActnoBicAdrTagXXX("72");
        sendertoReceiverInformation.setNarrative("Please advise us execution\r\nand provide us with a copy\r\nof your guarantee for our files.");
        mt786Creator.setSendertoReceiverInformation(sendertoReceiverInformation);
        //23X 4!c/65x
        mt786Creator.setFileIdentification("ICOC/FERT");

        MtCreatorManager.packMT(mt786Creator);
    }
}

