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

public class MT759Test {
    /**
     * @author wuzhe
     * @date 2023/3/2
     */
    @Test
    public void mt759_Test() {
        //构造参数传入MT报文类型
        MT759Creator mt759Creator=new MT759Creator("759");//报文类型
        mt759Creator.setRecvBic("MIDLGB22");//收报行
        mt759Creator.setSendBic("FUJIJPJS");//发报行
        //27 1!n/1!n
        mt759Creator.setSequenceofTotal("1/1");
        //20 16x
        mt759Creator.setTransactionReferenceNumber("PT93118428");
        //22D 4!c
        mt759Creator.setFormofUndertaking("DOCR");
        //23H 8!c
        mt759Creator.setFunctionofMessage("REQFINAN");
        //45D 150*65z
        mt759Creator.setNarrative("BILL AMOUNT: USD27,000.00\r\nWE WOULD LIKE TO REQUEST FOR AN EARLY PAYMENT.\r\nKINDLY CREDIT THE NET AMOUNT TO OUR ACCOUNT WITH CHEMICAL BANK,\r\nNEW YORK (SWIFT: CHEMUS33), A/C NO. 012-31507,\r\nUNDER YOUR ADVICE TO US.");

        //非必选项
        //21 16x
        mt759Creator.setRelatedReferenceNumber("OINSEBNTRO");
        //23 16x
        mt759Creator.setUndertakingNumber("PG8761234");
        //52a 52A
        ActnoBicAdrTagXXX issuer = new ActnoBicAdrTagXXX("52");
        issuer.setPartyIdentifier("A");//[/1!a][/34x]
        issuer.setBic("EFERGTBJXXX");//52A 4!a2!a2!c[3!c]
        //issuer.setAddress("MT760\r\n52D");//52D 4*35x
        mt759Creator.setIssuer(issuer);//52a
        //23X 4!c/65x
        mt759Creator.setFileIdentification("RT43/RGTYTR");

        MtResult mtResult = MtCreatorManager.packMT(mt759Creator);

    }

    @Test
    public void mt759_Test2() {
        //构造参数传入MT报文类型
        MT759Creator mt759Creator=new MT759Creator("759");//报文类型
        mt759Creator.setRecvBic("CIPSCNSHXXX");//收报行
        mt759Creator.setSendBic("PSBCCNBJXXX");//发报行
        //27 1!n/1!n
        mt759Creator.setSequenceofTotal("1/1");
        //20 16x
        mt759Creator.setTransactionReferenceNumber("PT93118428");
        //22D 4!c
        mt759Creator.setFormofUndertaking("DOCR");
        //23H 8!c
        mt759Creator.setFunctionofMessage("ISSUANCE");
        //45D 150*65z
        mt759Creator.setNarrative("BILL AMOUNT: USD27,000.00\r\nWE WOULD LIKE TO REQUEST FOR AN EARLY PAYMENT.\r\nKINDLY CREDIT THE NET AMOUNT TO OUR ACCOUNT WITH CHEMICAL BANK,\r\nNEW YORK (SWIFT: CHEMUS33), A/C NO. 012-31507,\r\nUNDER YOUR ADVICE TO US.");

        //非必选项
        //21 16x
        mt759Creator.setRelatedReferenceNumber("OINSEBNTRO");
        //23 16x
        mt759Creator.setUndertakingNumber("PG8761234");
        //52a 52D
        ActnoBicAdrTagXXX issuer = new ActnoBicAdrTagXXX("52");
        issuer.setPartyIdentifier("D");//[/1!a][/34x]
        //issuer.setBic("EFERGTBJXXX");//52A 4!a2!a2!c[3!c]
        issuer.setAddress("MT760\r\n52D");//52D 4*35x
        mt759Creator.setIssuer(issuer);//52a
        //23X 4!c/65x
        mt759Creator.setFileIdentification("RT43/RGTYTR");

        MtResult mtResult = MtCreatorManager.packMT(mt759Creator);

    }
}