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.Field79;
import com.prowidesoftware.swift.model.mt.mt2xx.MT292;
import org.apache.commons.lang3.StringUtils;


public class MT292Validator extends AbsMTValidator {
    public MT292Validator(String mtStr, MtResult mtResult) {
        super(mtStr,mtResult);
    }
    @Override
    public void bussinessValidator() {
        //   MtResult mtResult=getMtResult();
        MT292 mt292= (MT292) this.getAbstractMT();

        //C1:字段79或至少原始邮件的必填字段的副本，或两者都必须存在

        if(mt292.getField79()==null|| StringUtils.isEmpty(mt292.getField79().getValue())){
//            mtResult.addDescription("Field79不能为空,请检查");
            mtResult.addDescription(Language.getLanguage("MTn92_C1","【MT292】"));
        }

        //   return  mtResult;
    }
}
