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

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

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

    @Override
    public void bussinessValidator() {
        //MtResult mtResult = getMtResult();
        MT700 mt700 = (MT700) this.getAbstractMT();
        if (!(!Objects.isNull(mt700.getField42C()) && (!Objects.isNull(mt700.getField42A()) || !Objects.isNull(mt700.getField42D())))){
            mtResult.addDescription(Language.getLanguage("MT700_C1","【MT701】"));
        }if (!Objects.isNull(mt700.getField44C()) && !Objects.isNull(mt700.getField44D())){
            mtResult.addDescription(Language.getLanguage("MT700_C2","【MT701】"));
        }if (!Objects.isNull(mt700.getField42A()) || !Objects.isNull(mt700.getField42C()) ||
                !Objects.isNull(mt700.getField42D()) || !Objects.isNull(mt700.getField42P())){
            if (!Objects.isNull(mt700.getField42M())){
                mtResult.addDescription(Language.getLanguage("MT700_C3","【MT701】"));
            }
        }
        if (!Objects.isNull(mt700.getField42A()) || !Objects.isNull(mt700.getField42C()) ||
                !Objects.isNull(mt700.getField42D()) || !Objects.isNull(mt700.getField42M())){
            if (!Objects.isNull(mt700.getField42P())){
                mtResult.addDescription(Language.getLanguage("MT700_C3","【MT701】"));
            }
        }
        //  return  mtResult;
    }

}
