/**
 * BladeX Commercial License Agreement
 * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
 * <p>
 * Use of this software is governed by the Commercial License Agreement
 * obtained after purchasing a license from BladeX.
 * <p>
 * 1. This software is for development use only under a valid license
 * from BladeX.
 * <p>
 * 2. Redistribution of this software's source code to any third party
 * without a commercial license is strictly prohibited.
 * <p>
 * 3. Licensees may copyright their own code but cannot use segments
 * from this software for such purposes. Copyright of this software
 * remains with BladeX.
 * <p>
 * Using this software signifies agreement to this License, and the software
 * must not be used for illegal purposes.
 * <p>
 * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
 * not liable for any claims arising from secondary or illegal development.
 * <p>
 * Author: Chill Zhuang (bladejava@qq.com)
 */
package org.springblade.modules.flowable.processForm.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 流程定义模板，flowable流程定义根据该模板动态部署一个流程定义。 实体类
 *
 * @author lzp
 * @since 2024-08-02
 */
@Data
@TableName("crm_process_def")
@Schema(description = "ProcessDef对象")
public class ProcessDefEntity implements Serializable {



	@Schema(
		description = "主键id"
	)
	@TableId(
		value = "id",
		type = IdType.ASSIGN_UUID
	)
	private String id;

	/**
	 * 流程名称
	 */
	@Schema(description = "流程名称",requiredMode = Schema.RequiredMode.REQUIRED)
	@NotEmpty(message = "流程名称不能为空")
	private String name;
	/**
	 * 表单id
	 */
	@Schema(description = "表单id",requiredMode = Schema.RequiredMode.REQUIRED)
	@NotEmpty(message = "流程表单id不能为空")
	private String formId;
	/**
	 * 流程描述
	 */
	@Schema(description = "流程描述",requiredMode = Schema.RequiredMode.REQUIRED)
	@NotEmpty(message = "流程描述不能为空")
	private String description;
	/**
	 * 创建人
	 */
	@Schema(description = "创建人")
	private String createBy;
	/**
	 * 每个流程都有一个唯一key标识，可以写死。
	 */
	@Schema(description = "每个流程都有一个唯一key标识，可以写死。")
	private String keyValue;

	@TableLogic
	@Schema(
		description = "是否已删除 0：启动，1：禁用 2 删除"
	)
	private Integer isDeleted;

	@DateTimeFormat(
		pattern = "yyyy-MM-dd HH:mm:ss"
	)
	@JsonFormat(
		pattern = "yyyy-MM-dd HH:mm:ss"
	)
	@Schema(
		description = "创建时间"
	)
	private Date createTime;

	private String createName;

}
