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


import com.brilliance.isc.swift.objmtconvert.model.AbsMTValidator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.brilliance.isc.swift.objmtconvert.util.Language;
import com.prowidesoftware.swift.model.mt.mt7xx.MT730;


public class MT730Validator extends AbsMTValidator {
    public MT730Validator(String mtStr, MtResult mtResult) {
        super(mtStr, mtResult);
    }

    @Override
    public void bussinessValidator() {
        //  MtResult mtResult = getMtResult();
        MT730 mt730 = (MT730) this.getAbstractMT();

        //C1 Either field 25 or 57a, but not both, may be present (Error code(s): C77).
            //字段25不能与字段57a(57A/57D)同时存在,请检查!（错误代码：C77）。
        if (mt730.getField25() != null) {
            if (mt730.getField57A()!=null || mt730.getField57D()!=null){
                mtResult.addDescription(Language.getLanguage("MT730_C1","[MT730]："));
            }
        }
        //C2 If field 32D is present, field 57a must not be present (Error code(s): C78).
            //字段32D存在，字段57a(57A/52D)必须不存在,请检查!（错误代码：C78）。
        if (mt730.getField32D()!=null) {
            if (mt730.getField57A()!= null || mt730.getField57D()!= null) {
                mtResult.addDescription(Language.getLanguage("MT730_C2","[MT730]："));
            }
        }
        // return mtResult;
    }
}