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

public class MT767Test {
    @Test
    public void MT767_Test() {
        MT767Creator mt767Creator = new MT767Creator("767");
        mt767Creator.setSendBic("NWBKGB2L");//发报行
        mt767Creator.setRecvBic("SBCOUS66");//收报行
        //15A Of A Empty field
        mt767Creator.setNewSequenceOfA("");
        //27 Of A 1!n/1!n
        mt767Creator.setSequenceOfTotalOfA("1/1");
        //21 Of A 16x
        mt767Creator.setRelatedReferenceOfA("NW612341234");
        //22A Of A 4!c
        mt767Creator.setPurposeOfMessageOfA("ISCA");
        //23S Of A 6!a
        mt767Creator.setCancellationRequestOfA("CANCEL");
        //72Z Of A 6*35z
        ActnoBicAdrTagXXX sendertoReceiverInformationOfA = new ActnoBicAdrTagXXX("72");
        sendertoReceiverInformationOfA.setNarrative("GRGTGR");
        mt767Creator.setSendertoReceiverInformationOfA(sendertoReceiverInformationOfA);
        //23X 4!c/65x
        mt767Creator.setFileIdentificationOfA("COUR/0987654321");
        //15B Of B Empty field
        mt767Creator.setNewSequenceOfB("");
        //20 Of B 16x
        mt767Creator.setUndertakingNumberOfB("PG8761234");
        //26E Of B 3n
        mt767Creator.setNumberOfAmendmentOfB("001");
        //30 Of B 6!n
        mt767Creator.setDateOfAmendmentOfB("140318");
        //52a 52A Of B
        ActnoBicAdrTagXXX issuerOfB = new ActnoBicAdrTagXXX("52");
        issuerOfB.setInfo("C");
        issuerOfB.setPartyIdentifier("ERG");//[/1!a][/34x]
        issuerOfB.setBic("NWBKGB2L");//52A 4!a2!a2!c[3!c]
        //issuerOfB.setAddress("EGR");//52D 4*35x
        mt767Creator.setIssuerOfB(issuerOfB);
        //32B Of B //3!a15d
        DcDateCurAmtTagXXX increaseofUndertakingAmountOfB = new DcDateCurAmtTagXXX("32");
        increaseofUndertakingAmountOfB.setCurrency("ASD");//3!a
        increaseofUndertakingAmountOfB.setAmount(new BigDecimal("12345"));//15d
        mt767Creator.setIncreaseofUndertakingAmountOfB(increaseofUndertakingAmountOfB);
        //33B Of B 3!a15d
        DcDateCurAmtTagXXX decreaseofUndertakingAmountOfB = new DcDateCurAmtTagXXX("33");
        decreaseofUndertakingAmountOfB.setCurrency("ASD");//3!a
        decreaseofUndertakingAmountOfB.setAmount(new BigDecimal("12345"));//15d
        //mt767Creator.setDecreaseofUndertakingAmountOfB(decreaseofUndertakingAmountOfB);
        //23B Of B 4!c
        mt767Creator.setExpiryTypeOfB("COND");
        //31E Of B 6!n
        mt767Creator.setDateOfExpiryOfB("140318");
        //35G Of B 12*65x
        mt767Creator.setExpiryConditionEventOfB("Condition1\r\nCondition2\r\nCondition3\r\nEvent1");
        //59a 59A Of B
        ActnoBicAdrTagXXX beneficiaryOfB = new ActnoBicAdrTagXXX("59");
        beneficiaryOfB.setInfo("A");
        beneficiaryOfB.setAcctno("59");//[/34x]
        beneficiaryOfB.setBic("IREOQWBJXXX");//59A 4!a2!a2!c[3!c]
        //beneficiaryOfB.setAddress("ERSD\r\nTRER");//59 4*35x
        mt767Creator.setBeneficiaryOfB(beneficiaryOfB);
        //77U Of B 150*65z
        mt767Creator.setOtherAmendmentsToUndertakingOfB("OtherAmendmentsToUndertaking");
        //24E Of B 4!c[/35x]
        mt767Creator.setDeliveryOfAmendmentToUndertakingOfB("COLL/Addon");
        //24G Of B 4!c<crlf>[6*35x]
        ActnoBicAdrTagXXX deliveryToCollectionByOfB = new ActnoBicAdrTagXXX("24");
        deliveryToCollectionByOfB.setCode("ICBC");//4!c
        deliveryToCollectionByOfB.setAddress("REFDS");//[6*35x]
        mt767Creator.setDeliveryToCollectionByOfB(deliveryToCollectionByOfB);
        //15C Of C Empty field
        mt767Creator.setNewSequenceOfC("");
        //32B Of C //3!a15d
        DcDateCurAmtTagXXX increaseofLocalUndertakingAmountOfC = new DcDateCurAmtTagXXX("32");
        increaseofLocalUndertakingAmountOfC.setCurrency("ASD");//3!a
        increaseofLocalUndertakingAmountOfC.setAmount(new BigDecimal("12345"));//15d
        //mt767Creator.setIncreaseofLocalUndertakingAmountOfC(increaseofLocalUndertakingAmountOfC);
        //33B Of C 3!a15d
        DcDateCurAmtTagXXX decreaseofLocalUndertakingAmountOfC = new DcDateCurAmtTagXXX("33");
        decreaseofLocalUndertakingAmountOfC.setCurrency("ASD");//3!a
        decreaseofLocalUndertakingAmountOfC.setAmount(new BigDecimal("12345"));//15d
        mt767Creator.setDecreaseofLocalUndertakingAmountOfC(decreaseofLocalUndertakingAmountOfC);
        //23B Of C 4!c
        mt767Creator.setExpiryTypeOfC("COND");
        //31E Of C 6!n
        mt767Creator.setDateOfExpiryOfC("160630");
        //35G Of C 12*65x
        mt767Creator.setExpiryConditionEventOfC("Event1\r\nEvent2\r\nEvent3\r\nCondition1");
        //59 Of C [/34x]<crlf>4*35x
        ActnoBicAdrTagXXX beneficiaryOfC = new ActnoBicAdrTagXXX("59");
        beneficiaryOfC.setAcctno("Account");//[/34x]
        beneficiaryOfC.setAddress("4Country\r\n3Province\r\n2City");//4*35x
        mt767Creator.setBeneficiaryOfC(beneficiaryOfC);
        //77L Of C 150*65z
        mt767Creator.setOtherAmendmentsToLocalUndertakingOfC("654327");
        //24E Of C 4!c[/35x]
        mt767Creator.setDeliveryOfAmendmentToLocalUndertakingOfC("COUR/ASDFGHJKL");
        //24G Of C 4!c<crlf>[6*35x]
        ActnoBicAdrTagXXX deliveryToCollectionByOfC = new ActnoBicAdrTagXXX("24");
        deliveryToCollectionByOfC.setCode("ICIC");//4!c
        deliveryToCollectionByOfC.setAddress("WRBRHRGGE");//[6*35x]
        mt767Creator.setDeliveryToCollectionByOfC(deliveryToCollectionByOfC);

        MtCreatorManager.packMT(mt767Creator);
    }

    @Test
    public void MT767_Test2() {
        MT767Creator mt767Creator = new MT767Creator("767");
        mt767Creator.setSendBic("NWBKGB2L");//发报行
        mt767Creator.setRecvBic("SBCOUS66");//收报行
        //15A Of A Empty field
        mt767Creator.setNewSequenceOfA("");
        //27 Of A 1!n/1!n
        mt767Creator.setSequenceOfTotalOfA("1/1");
        //21 Of A 16x
        mt767Creator.setRelatedReferenceOfA("NW612341234");
        //22A Of A 4!c
        mt767Creator.setPurposeOfMessageOfA("ISUA");
        //23S Of A 6!a
        mt767Creator.setCancellationRequestOfA("CANCEL");
        //72Z Of A 6*35z
        ActnoBicAdrTagXXX sendertoReceiverInformationOfA = new ActnoBicAdrTagXXX("72");
        sendertoReceiverInformationOfA.setNarrative("GRGTGR");
        mt767Creator.setSendertoReceiverInformationOfA(sendertoReceiverInformationOfA);
        //23X 4!c/65x
        mt767Creator.setFileIdentificationOfA("COUR/0987654321");
        //15B Of B Empty field
        mt767Creator.setNewSequenceOfB("");
        //20 Of B 16x
        mt767Creator.setUndertakingNumberOfB("PG8761234");
        //26E Of B 3n
        mt767Creator.setNumberOfAmendmentOfB("001");
        //30 Of B 6!n
        mt767Creator.setDateOfAmendmentOfB("140318");
        //52a 52D Of B
        ActnoBicAdrTagXXX issuerOfB = new ActnoBicAdrTagXXX("52");
        issuerOfB.setInfo("C");
        issuerOfB.setPartyIdentifier("ERG");//[/1!a][/34x]
        //issuerOfB.setBic("NWBKGB2L");//52A 4!a2!a2!c[3!c]
        issuerOfB.setAddress("EGR");//52D 4*35x
        mt767Creator.setIssuerOfB(issuerOfB);
        //32B Of B //3!a15d
        DcDateCurAmtTagXXX increaseofUndertakingAmountOfB = new DcDateCurAmtTagXXX("32");
        increaseofUndertakingAmountOfB.setCurrency("ASD");//3!a
        increaseofUndertakingAmountOfB.setAmount(new BigDecimal("12345"));//15d
        mt767Creator.setIncreaseofUndertakingAmountOfB(increaseofUndertakingAmountOfB);
        //33B Of B 3!a15d
        DcDateCurAmtTagXXX decreaseofUndertakingAmountOfB = new DcDateCurAmtTagXXX("33");
        decreaseofUndertakingAmountOfB.setCurrency("ASD");//3!a
        decreaseofUndertakingAmountOfB.setAmount(new BigDecimal("12345"));//15d
        mt767Creator.setDecreaseofUndertakingAmountOfB(decreaseofUndertakingAmountOfB);
        //23B Of B 4!c
        mt767Creator.setExpiryTypeOfB("COND");
        //31E Of B 6!n
        mt767Creator.setDateOfExpiryOfB("140318");
        //35G Of B 12*65x
        mt767Creator.setExpiryConditionEventOfB("Condition1\r\nCondition2\r\nCondition3\r\nEvent1");
        //59a 59 Of B
        ActnoBicAdrTagXXX beneficiaryOfB = new ActnoBicAdrTagXXX("59");
        beneficiaryOfB.setInfo("A");
        beneficiaryOfB.setAcctno("59");//[/34x]
        //beneficiaryOfB.setBic("IREOQWBJXXX");//59A 4!a2!a2!c[3!c]
        beneficiaryOfB.setAddress("ERSD\r\nTRER");//59 4*35x
        mt767Creator.setBeneficiaryOfB(beneficiaryOfB);
        //77U Of B 150*65z
        mt767Creator.setOtherAmendmentsToUndertakingOfB("OtherAmendmentsToUndertaking");
        //24E Of B 4!c[/35x]
        mt767Creator.setDeliveryOfAmendmentToUndertakingOfB("COLL/Addon");
        //24G Of B 4!c<crlf>[6*35x]
        ActnoBicAdrTagXXX deliveryToCollectionByOfB = new ActnoBicAdrTagXXX("24");
        deliveryToCollectionByOfB.setCode("ICBC");//4!c
        deliveryToCollectionByOfB.setAddress("REFDS");//[6*35x]
        mt767Creator.setDeliveryToCollectionByOfB(deliveryToCollectionByOfB);
        //15C Of C Empty field
        mt767Creator.setNewSequenceOfC("");
        //32B Of C //3!a15d
        DcDateCurAmtTagXXX increaseofLocalUndertakingAmountOfC = new DcDateCurAmtTagXXX("32");
        increaseofLocalUndertakingAmountOfC.setCurrency("ASD");//3!a
        increaseofLocalUndertakingAmountOfC.setAmount(new BigDecimal("12345"));//15d
        mt767Creator.setIncreaseofLocalUndertakingAmountOfC(increaseofLocalUndertakingAmountOfC);
        //33B Of C 3!a15d
        DcDateCurAmtTagXXX decreaseofLocalUndertakingAmountOfC = new DcDateCurAmtTagXXX("33");
        decreaseofLocalUndertakingAmountOfC.setCurrency("ASD");//3!a
        decreaseofLocalUndertakingAmountOfC.setAmount(new BigDecimal("12345"));//15d
        mt767Creator.setDecreaseofLocalUndertakingAmountOfC(decreaseofLocalUndertakingAmountOfC);
        //23B Of C 4!c
        mt767Creator.setExpiryTypeOfC("COND");
        //31E Of C 6!n
        mt767Creator.setDateOfExpiryOfC("160630");
        //35G Of C 12*65x
        mt767Creator.setExpiryConditionEventOfC("Event1\r\nEvent2\r\nEvent3\r\nCondition1");
        //59 Of C [/34x]<crlf>4*35x
        ActnoBicAdrTagXXX beneficiaryOfC = new ActnoBicAdrTagXXX("59");
        beneficiaryOfC.setAcctno("Account");//[/34x]
        beneficiaryOfC.setAddress("4Country\r\n3Province\r\n2City");//4*35x
        mt767Creator.setBeneficiaryOfC(beneficiaryOfC);
        //77L Of C 150*65z
        mt767Creator.setOtherAmendmentsToLocalUndertakingOfC("654327");
        //24E Of C 4!c[/35x]
        mt767Creator.setDeliveryOfAmendmentToLocalUndertakingOfC("COUR/ASDFGHJKL");
        //24G Of C 4!c<crlf>[6*35x]
        ActnoBicAdrTagXXX deliveryToCollectionByOfC = new ActnoBicAdrTagXXX("24");
        deliveryToCollectionByOfC.setCode("ICIC");//4!c
        deliveryToCollectionByOfC.setAddress("WRBRHRGGE");//[6*35x]
        mt767Creator.setDeliveryToCollectionByOfC(deliveryToCollectionByOfC);

        MtCreatorManager.packMT(mt767Creator);
    }
}
