package com.yeejoin.amos.boot.module.jg.api.dto;

import com.alibaba.fastjson.JSONObject;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;


public class RequestChangeData extends JSONObject {

    /**
     * 批量编辑时表格key-公共使用
     */
    public static final String multiDataKey = "tableData";

    /**
     * 删除的数据表格key-管道使用
     */
    public static final String deletedDataKey = "deleteData";

    /**
     * 变更说明
     */
    public static final String changeReasonKey = "changeReason";

    /**
     * 变更说明附件
     */
    public static final String changeReasonAttachmentKey = "changeAttachment";

    public void validated() {
        if (!this.containsKey(changeReasonKey) || !this.containsKey(changeReasonAttachmentKey)) {
            throw new BadRequest("变更说明和变更说明附件不能为空！");
        }
    }

}