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

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

    @Test
    public void mt761_Test(){

        MT761Creator mt761Creator=new MT761Creator("761");
        mt761Creator.setSendBic("PSBCCNBJXXX");//发报行
        mt761Creator.setRecvBic("CIPSCNSHXXX");//收报行
        //27 1!n/1!n
        mt761Creator.setSequenceofTotal("1/1");
        //20 16x
        mt761Creator.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
        mt761Creator.setIssuer(issuer);

        //非必选项
        //77U 150*65z
        mt761Creator.setUndertakingTermsandConditions("DBNHYTGFDSBF");
        //77L 150*65z
        mt761Creator.setRequestedLocalUndertakingTermsandConditions("761");

        MtCreatorManager.packMT(mt761Creator);
    }

    @Test
    public void mt761_Test1(){

        MT761Creator mt761Creator=new MT761Creator("761");
        mt761Creator.setSendBic("PSBCCNBJXXX");//发报行
        mt761Creator.setRecvBic("CIPSCNSHXXX");//收报行
        //27 1!n/1!n
        mt761Creator.setSequenceofTotal("1/1");
        //20 16x
        mt761Creator.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
        mt761Creator.setIssuer(issuer);

        //非必选项
        //77U
        mt761Creator.setUndertakingTermsandConditions("DBNHYTGFDSBF");
        //77L
        mt761Creator.setRequestedLocalUndertakingTermsandConditions("761");

        MtCreatorManager.packMT(mt761Creator);
    }
}

