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.tag210.*;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;

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

/**
 * @author huangmengyuan
 * @create 2023/2/28
 */
public class MT210AbsCreator extends AbsMTCreator {
    @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 currencyCodeAmount;
    @Status("O")
    @TagName({"50","50C","50F"})
    @FieldDescription("Ordering Customer")
    @TagRegex({"4*35x","4!a2!a2!c[3!c]","35x<crlf>4*(1!n/33x)"})
    //50a
    private ActnoBicAdrTagXXX orderingCustomer;
    @Status("O")
    @TagName({"52A","52D"})
    @FieldDescription("Ordering Institution")
    @TagRegex({"[/1!a][/34x]<crlf>4!a2!a2!c[3!c]","[/1!a][/34x]<crlf>4*35x"})
    //52a
    private ActnoBicAdrTagXXX orderingInstitution;
    @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 intermediary;

    public String getRelatedReference() {
        return relatedReference;
    }

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

    public DcDateCurAmtTagXXX getCurrencyCodeAmount() {
        return currencyCodeAmount;
    }

    public void setCurrencyCodeAmount(DcDateCurAmtTagXXX currencyCodeAmount) {
        this.currencyCodeAmount = currencyCodeAmount;
    }

    public ActnoBicAdrTagXXX getOrderingCustomer() {
        return orderingCustomer;
    }

    public void setOrderingCustomer(ActnoBicAdrTagXXX orderingCustomer) {
        this.orderingCustomer = orderingCustomer;
    }

    public ActnoBicAdrTagXXX getOrderingInstitution() {
        return orderingInstitution;
    }

    public void setOrderingInstitution(ActnoBicAdrTagXXX orderingInstitution) {
        this.orderingInstitution = orderingInstitution;
    }

    public ActnoBicAdrTagXXX getIntermediary() {
        return intermediary;
    }

    public void setIntermediary(ActnoBicAdrTagXXX intermediary) {
        this.intermediary = intermediary;
    }

    public MT210AbsCreator() {
        super();
    }

//    public AbsMT210Creator(String jsonData) throws Exception {
//        super(jsonData);
//    }


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

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