package com.ningdatech.pmapi.projectdeclared.entity.dto;

import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Maps;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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

/**
 * @Classname DeclaredProjectDto
 * @Description 申报项目
 * @Date 2023/2/1 14:52
 * @Author PoffyZhang
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PreDeclaredProjectDto implements Serializable {

    @NotNull
    private Long projectId;

    private Map<String,Object> formData;

    @NotNull
    private ProcessInstanceUserDto user;

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