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

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

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

    @Override
    public void bussinessValidator() {
      //  MtResult mtResult=getMtResult();
        MT192 mt192= (MT192) this.getAbstractMT();
        //C1:字段79或至少原始邮件的必填字段的副本，或两者都必须存在(错误代码:C25)。
             Field79 field79 =mt192.getField79();
             if(field79==null|| StringUtils.isEmpty(field79.getValue())){
                 mtResult.addDescription(Language.getLanguage("MTn92_C1","【MT192】"));
             }

       // return  mtResult;
    }
}
