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

import com.brilliance.isc.swift.objmtconvert.model.AbsMTValidator;
import com.brilliance.isc.swift.objmtconvert.model.busvalidator.ValidatorMethod;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.prowidesoftware.swift.model.Tag;
import com.prowidesoftware.swift.model.field.Field32A;
import com.prowidesoftware.swift.model.field.Field32B;
import com.prowidesoftware.swift.model.field.Field32K;
import com.prowidesoftware.swift.model.mt.mt4xx.MT420;

import java.util.List;

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

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

    @Override
    public void bussinessValidator() {
        //MtResult mtResult=getMtResult();
        List<Tag> tags = this.getAbstractMT().getSwiftMessage().getBlock4().getTags();
        String msgType = "MT420";
        mtResult = ValidatorMethod.mt4xxField202132(tags,mtResult,msgType);
        MT420 mt420 = (MT420) this.getAbstractMT();
        List<Field32A> listField32A = mt420.getField32A();
        List<Field32B> listField32B = mt420.getField32B();
        List<Field32K> listField32K = mt420.getField32K();
        mtResult = ValidatorMethod.mt4xxField32(listField32A, listField32B, listField32K, mtResult,msgType);
        //   return mtResult;
    }
}
