package com.brilliance.isc.swift.objmtconvert.model.mt2xx.mt2XXAbsCreator;

import com.brilliance.isc.swift.objmtconvert.annotation.FieldDescription;
import com.brilliance.isc.swift.objmtconvert.annotation.Status;
import com.brilliance.isc.swift.objmtconvert.annotation.TagName;
import com.brilliance.isc.swift.objmtconvert.annotation.TagRegex;
import com.brilliance.isc.swift.objmtconvert.model.AbsMTCreator;
import com.brilliance.isc.swift.objmtconvert.model.AbsTagCreate;
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.mt2xx.tag.tag203.*;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;

import java.util.ArrayList;
import java.util.List;

/**
 * @author huangmengyuan
 * @create 2023/2/27
 */
public class MT203AbsCreator extends AbsMTCreator {
    @Status("M")
    @TagName("20")
    @FieldDescription("Transaction Reference Number")
    @TagRegex("16x")
    //20
    private String transactionReferenceNumber;
    @Status("M")
    @TagName("21")
    @FieldDescription("Related Reference")
    @TagRegex("16x")
    //21
    private String relatedReference;
    @Status("M")
    @TagName("32B")
    @FieldDescription("Currency Code, Amount")
    @TagRegex("3!a15d")
    //32B
    private DcDateCurAmtTagXXX dateCurAmt32B;
    @Status("O")
    @TagName({"56A","56D"})
    @FieldDescription("Intermediary")
    @TagRegex({"[/1!a][/34x]<crlf>4!a2!a2!c[3!c]","[/1!a][/34x]<crlf>4*35x"})
    //56a
    private ActnoBicAdrTagXXX actnoBicAdr56a;
    @Status("O")
    @TagName({"57A","57B","57D"})
    @FieldDescription("Account With Institution")
    @TagRegex({"[/1!a][/34x]<crlf>4!a2!a2!c[3!c]","[/1!a][/34x]<crlf>[35x]","[/1!a][/34x]<crlf>4*35x"})
    //57a
    private ActnoBicAdrTagXXX actnoBicAdr57a;
    @Status("M")
    @TagName({"58A","58D"})
    @FieldDescription("Beneficiary Institution")
    @TagRegex({"[/1!a][/34x]<crlf>4!a2!a2!c[3!c]","[/1!a][/34x]<crlf>4*35x"})
    //58a
    private ActnoBicAdrTagXXX actnoBicAdr58a;
    @Status("O")
    @TagName("72")
    @FieldDescription("Sender to Receiver Information")
    @TagRegex("6*35x")
    //72
    private String sendertoReceiverInformationB;

    public String getTransactionReferenceNumber() {
        return transactionReferenceNumber;
    }

    public void setTransactionReferenceNumber(String transactionReferenceNumber) {
        this.transactionReferenceNumber = transactionReferenceNumber;
    }

    public String getRelatedReference() {
        return relatedReference;
    }

    public void setRelatedReference(String relatedReference) {
        this.relatedReference = relatedReference;
    }

    public DcDateCurAmtTagXXX getDateCurAmt32B() {
        return dateCurAmt32B;
    }

    public void setDateCurAmt32B(DcDateCurAmtTagXXX dateCurAmt32B) {
        this.dateCurAmt32B = dateCurAmt32B;
    }

    public ActnoBicAdrTagXXX getActnoBicAdr56a() {
        return actnoBicAdr56a;
    }

    public void setActnoBicAdr56a(ActnoBicAdrTagXXX actnoBicAdr56a) {
        this.actnoBicAdr56a = actnoBicAdr56a;
    }

    public ActnoBicAdrTagXXX getActnoBicAdr57a() {
        return actnoBicAdr57a;
    }

    public void setActnoBicAdr57a(ActnoBicAdrTagXXX actnoBicAdr57a) {
        this.actnoBicAdr57a = actnoBicAdr57a;
    }

    public ActnoBicAdrTagXXX getActnoBicAdr58a() {
        return actnoBicAdr58a;
    }

    public void setActnoBicAdr58a(ActnoBicAdrTagXXX actnoBicAdr58a) {
        this.actnoBicAdr58a = actnoBicAdr58a;
    }

    public String getSendertoReceiverInformationB() {
        return sendertoReceiverInformationB;
    }

    public void setSendertoReceiverInformationB(String sendertoReceiverInformationB) {
        this.sendertoReceiverInformationB = sendertoReceiverInformationB;
    }

    public MT203AbsCreator() {
        super();
    }

//    public AbsMT203Creator(String jsonData) throws ClassNotFoundException {
//        super(jsonData);
//    }


    public MT203AbsCreator(String msgType) {
        super(msgType);
    }

//    @Override
//    public void pack() {
//        MtResult mtResult = new MtResult();
//        List<AbsTagCreate> tagCreateList=new ArrayList<>();
//        try{
//            tagCreateList.add(new Tag20Creator(this));
//            tagCreateList.add(new Tag21Creator(this));
//            tagCreateList.add(new Tag32BCreator(this));
//            tagCreateList.add(new Tag56aCreator(this));
//            tagCreateList.add(new Tag57aCreator(this));
//            tagCreateList.add(new Tag58aCreator(this));
//            tagCreateList.add(new TagB72Creator(this));
//            dealTags(tagCreateList);
//
//            mtResult.setMessage(abstractMT.message());
//        }catch (Exception e) {
//            e.printStackTrace();
//            mtResult.setSuccess(false);
//            mtResult.addDescription(e.getLocalizedMessage());
//        }
//
//        return mtResult;
//    }
}
