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

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 java.util.List;

/**
 * @author zh
 * @create 2023-03-03-10:27
 */
public class MT910Validator extends AbsMTValidator {

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

    @Override
    public void bussinessValidator() {
        //   MtResult mtResult=getMtResult();
        boolean flag = false;
        List<Tag> tags = this.getAbstractMT().getSwiftMessage().getBlock4().getTags();
        for (Tag tag : tags) {
            if(tag.getName().contains("50")){
                flag = true;
            }
            if(tag.getName().contains("52")){
                flag = true;
            }
        }
        if(!flag){
            mtResult.addDescription(Language.getLanguage("MT910_C1","【MT910】"));
        }
        //    return mtResult;
    }
}
