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.Tag;
import com.prowidesoftware.swift.model.mt.mt7xx.MT785;
import java.util.List;


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

    @Override
    public void bussinessValidator() {
        //  MtResult mtResult=getMtResult();
        MT785 mt785 = (MT785) this.getAbstractMT();
        List<Tag> tags = this.getAbstractMT().getSwiftMessage().getBlock4().getTags();

        //C1 If field 57a is present, then field 56a must be present (Error code(s): C81).
            //如果字段57a(57A/57D)存在，则字段56a(56A/56D)必须存在（错误代码：C81）。
        if ((mt785.getField57A() != null || mt785.getField57D() != null)){
            if (mt785.getField56A() == null && mt785.getField56D() == null) {
                mtResult.addDescription(Language.getLanguage("MT785_C1", "[MT785]："));
            }
        }
    }
}