package com.hz.pm.api.todocenter.model.dto;

import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Maps;
import com.hz.pm.api.projectlib.model.dto.ProjectDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * @Classname DefaultDeclaredDTO
 * @Description
 * @Date 2023/2/14 17:16
 * @Author PoffyZhang
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdjustHandleDTO {

    @NotNull
    @ApiModelProperty("项目信息")
    private ProjectDTO projectInfo;

    @ApiModelProperty("表单信息 新增模块")
    private Map<String, Object> formData;

    public Map<String, Object> getFormData() {
        if (CollUtil.isEmpty(this.formData)) {
            this.formData = Maps.newHashMap();
            return this.formData;
        }
        return this.formData;
    }

    @ApiModelProperty("项目ID")
    @NotNull(message = "要处理的项目ID不能为空!")
    private Long projectId;

    @NotNull(message = "流程实例ID不能为空!")
    private String instanceId;

    @ApiModelProperty("任务ID")
    @NotNull(message = "任务ID不能为空!")
    private String taskId;
}
