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

import com.brilliance.isc.swift.objmtconvert.model.AbsMTValidator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.brilliance.isc.swift.objmtconvert.util.Constans;
import com.brilliance.isc.swift.objmtconvert.util.Language;
import com.prowidesoftware.swift.model.field.Field;
import com.prowidesoftware.swift.model.mt.mt2xx.MT202COV;

/**
 * @author huangmengyuan
 * @create 2023/3/3
 */
public class MT202COVValidator extends AbsMTValidator {
    public MT202COVValidator(String mtStr, MtResult mtResult) {
        super(mtStr, mtResult);
    }

    public MT202COVValidator() {
    }

    @Override
    public void bussinessValidator() {
       // MtResult mtResult = getMtResult();
        MT202COV mt202COV = (MT202COV) this.getAbstractMT();
        if (mt202COV.getSequenceA().containsTag(56)){
            if (!mt202COV.getSequenceA().containsTag(57)){
//                mtResult.addDescription("【MT202COV】中如果A序列56A或者56D存在,那么A序列57A或者57B或者57D也必须存在,请赋值");
                mtResult.addDescription(Language.getLanguage("MT202COV_C1","【MT202COV】"));
            }
        }
        if (mt202COV.getSequenceB().containsTag(56)){
            if (!mt202COV.getSequenceB().containsTag(57)){
//                mtResult.addDescription("【MT202COV】中如果B序列56A或者56D存在,那么B序列57A或者57B或者57D也必须存在,请赋值");
                mtResult.addDescription(Language.getLanguage("MT202COV_C2","【MT202COV】"));
            }
        }

       // return mtResult;
    }
}
