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.MT740;
import java.util.Objects;

/**
 * MT750
 * @author wanggang
 * @Date 2023-3-3
 */
public class MT740Validator extends AbsMTValidator {

    public MT740Validator(String mtStr, MtResult mtResult)
    {
        super(mtStr,mtResult);
    }

    @Override
    public void bussinessValidator() {
        //  MtResult mtResult = getMtResult();
        MT740 mt740 = (MT740)this.getAbstractMT();
        if (!(!Objects.isNull(mt740.getField42C()) && (!Objects.isNull(mt740.getField42A()) || !Objects.isNull(mt740.getField42D())))){
            mtResult.addDescription(Language.getLanguage("MT740_C1","【MT740】"));
        }if (!Objects.isNull(mt740.getField59()) && (!Objects.isNull(mt740.getField58A()) || !Objects.isNull(mt740.getField58D()))){
            mtResult.addDescription(Language.getLanguage("MT740_C3","【MT740】"));
        }
        if (!Objects.isNull(mt740.getField42A()) || !Objects.isNull(mt740.getField42C()) ||
             !Objects.isNull(mt740.getField42D()) || !Objects.isNull(mt740.getField42P())){
               if (!Objects.isNull(mt740.getField42M())){
                   mtResult.addDescription(Language.getLanguage("MT740_C2","【MT740】"));
               }
        }
        if (!Objects.isNull(mt740.getField42A()) || !Objects.isNull(mt740.getField42C()) ||
                !Objects.isNull(mt740.getField42D()) || !Objects.isNull(mt740.getField42M())){
            if (!Objects.isNull(mt740.getField42P())){
                mtResult.addDescription(Language.getLanguage("MT740_C2","【MT740】"));
            }
        }
        //return  mtResult;
    }

}
