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

import com.brilliance.isc.swift.objmtconvert.model.AbsMTValidator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.brilliance.isc.swift.objmtconvert.util.Constans;
import com.brilliance.isc.swift.objmtconvert.util.Language;
import com.prowidesoftware.swift.model.field.*;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt.mt2xx.MT202;
import org.apache.commons.lang3.StringUtils;


/**
 * @author huangmengyuan
 * @create 2023/3/3
 */
public class MT202Validator extends AbsMTValidator {
    public MT202Validator(String mtStr, MtResult mtResult) {
        super(mtStr, mtResult);
    }

    public MT202Validator() {
    }

    @Override
    public void bussinessValidator() {
        //MtResult mtResult = getMtResult();
        MT202 mt202 = (MT202) this.getAbstractMT();
        Field56A field56A = mt202.getField56A();
        Field56D field56D = mt202.getField56D();
        if ((field56A != null) || (field56D != null)) {
            if (mt202.getField57A() == null && mt202.getField57B() == null && mt202.getField57D() == null) {
//                mtResult.addDescription("【MT202】中如果56A或者56D存在,那么57A或者57B或者57D也必须存在,请赋值");
                mtResult.addDescription(Language.getLanguage("MT202_C1","【MT202】"));
            }
        }
      //  return mtResult;
    }


}
