package yem.wm.ct.opplugin.op;

import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;
import kd.sdk.plugin.Plugin;
import yem.wm.ct.opplugin.validator.ContractTermsSubmitValidator;

import java.util.List;

/**
 * 合同条款库(提交校验)
 * @author zhangh
 *
 */
public class ContractTermsSubmitOp extends AbstractOperationServicePlugIn implements Plugin {
    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e) {
        List<String> fieldKeys = e.getFieldKeys();
        fieldKeys.add("yem_clausecontentchina");
        fieldKeys.add("yem_clausecontentenglish");
        fieldKeys.add("yem_foreigntrade");
    }

    @Override
    public void onAddValidators(AddValidatorsEventArgs e) {
        e.addValidator(new ContractTermsSubmitValidator());
    }
}