package cn.fateverse.workflow.entity;

import cn.fateverse.common.core.annotaion.AutoTime;
import cn.fateverse.common.core.annotaion.AutoUser;
import cn.fateverse.common.core.annotaion.EnableAutoField;
import cn.fateverse.common.core.entity.BaseEntity;
import cn.fateverse.common.core.enums.AutoUserEnum;
import cn.fateverse.common.core.enums.MethodEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 用户业务层面的流程实例
 *
 * @author Clay
 * @date 2023-03-22
 */
@Data
@Builder
@EnableAutoField
@AllArgsConstructor
@NoArgsConstructor
public class UserInstance extends BaseEntity {
    //实例id
    private String instanceId;
    //用户id
    @AutoUser(value = AutoUserEnum.USER_ID, method = MethodEnum.INSERT)
    private String userId;
    //流程实例id
    private String processInstanceId;
    //部署流程名称
    private String deploymentName;
    //状态
    private String state;
    //发起人
    @AutoUser(value = AutoUserEnum.NICK_NAME, method = MethodEnum.INSERT)
    private String initiator;
    //提交时间
    @AutoTime(method = MethodEnum.INSERT)
    private Date submitTime;
    //完成时间
    private Date finishTime;
}
