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.mt7xx.MT785Creator;
import org.junit.Test;

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

    @Test
    public void mt785_Test(){

        MT785Creator mt785Creator=new MT785Creator("785");
        mt785Creator.setSendBic("PSBCCNBJXXX");//发报行
        mt785Creator.setRecvBic("CIPSCNSHXXX");//收报行
        //20 16x
        mt785Creator.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
        mt785Creator.setIssuer(issuer);
        //59a 59A
        ActnoBicAdrTagXXX beneficiary = new ActnoBicAdrTagXXX("59");
        beneficiary.setAcctno("ARNSGBF");//Account [/34x]
        //beneficiary.setAddress("MJNGHT");//No letter option Address 4*35x
        beneficiary.setBic("ROYCCATEXXX");//59A BIC 4!a2!a2!c[3!c]
        mt785Creator.setBeneficiary(beneficiary);
        //31C 6!n
        mt785Creator.setDateofIssue("230327");
        
        //非必选项
        //21 16x
        mt785Creator.setRelatedReference("TERSEACSDVF");
        //56a 56A
        ActnoBicAdrTagXXX advisingBank = new ActnoBicAdrTagXXX("56");
        advisingBank.setPartyIdentifier("D");//Party Identifier [/1!a][/34x]
        advisingBank.setBic("EWRWTE12");//56A BIC 4!a2!a2!c[3!c]
        //advisingBank.setAddress("ETYRGBF\r\nTNBDFB");//56D Address 4*35x
        mt785Creator.setAdvisingBank(advisingBank);
        //57a 57A
        ActnoBicAdrTagXXX adviseThroughBank = new ActnoBicAdrTagXXX("57");
        adviseThroughBank.setPartyIdentifier("D");//Party Identifier [/1!a][/34x]
        adviseThroughBank.setBic("IDSVDFBJXXX");//57A BIC 4!a2!a2!c[3!c]
        //adviseThroughBank.setAddress("TRBFD\r\nBGFDS");//57D Address 4*35x
        mt785Creator.setAdviseThroughBank(adviseThroughBank);
        //31E 6!n
        mt785Creator.setFinalDateofExpiry("230327");
        //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.");
        mt785Creator.setSendertoReceiverInformation(sendertoReceiverInformation);
        //23X 4!c/65x
        mt785Creator.setFileIdentification("ICOC/FERT");
        
        MtCreatorManager.packMT(mt785Creator);
    }

    @Test
    public void mt785_Test1(){

        MT785Creator mt785Creator=new MT785Creator("785");
        mt785Creator.setSendBic("PSBCCNBJXXX");//发报行
        mt785Creator.setRecvBic("CIPSCNSHXXX");//收报行
        //20 16x
        mt785Creator.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
        mt785Creator.setIssuer(issuer);
        //59a 59
        ActnoBicAdrTagXXX beneficiary = new ActnoBicAdrTagXXX("59");
        beneficiary.setAcctno("ARNSGBF");//Account [/34x]
        beneficiary.setAddress("MJNGHT");//No letter option Address 4*35x
//        beneficiary.setBic("ROYCCATEXXX");//59A BIC 4!a2!a2!c[3!c]
        mt785Creator.setBeneficiary(beneficiary);
        //31C 6!n
        mt785Creator.setDateofIssue("230327");

        //非必选项
        //21 16x
        mt785Creator.setRelatedReference("TERSEACSDVF");
        //56a 56D
        ActnoBicAdrTagXXX advisingBank = new ActnoBicAdrTagXXX("56");
        advisingBank.setPartyIdentifier("A");//Party Identifier [/1!a][/34x]
//        advisingBank.setBic("EWRWTE12");//56A BIC 4!a2!a2!c[3!c]
        advisingBank.setAddress("ETYRGBF\r\nTNBDFB");//56D Address 4*35x
        mt785Creator.setAdvisingBank(advisingBank);
        //57a 57D
        ActnoBicAdrTagXXX adviseThroughBank = new ActnoBicAdrTagXXX("57");
        adviseThroughBank.setPartyIdentifier("A");//Party Identifier [/1!a][/34x]
//        adviseThroughBank.setBic("IDSVDFBJXXX");//57A BIC 4!a2!a2!c[3!c]
        adviseThroughBank.setAddress("TRBFD\r\nBGFDS");//57D Address 4*35x
        mt785Creator.setAdviseThroughBank(adviseThroughBank);
        //31E 6!n
        mt785Creator.setFinalDateofExpiry("230327");
        //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.");
        mt785Creator.setSendertoReceiverInformation(sendertoReceiverInformation);
        //23X 4!c/65x
        mt785Creator.setFileIdentification("ICOC/FERT");

        MtCreatorManager.packMT(mt785Creator);
    }
}

