package com.bonus.material.approval.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 审批实例实体
 * 
 * @author bonus
 * @date 2024-11-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("审批实例")
public class ApprovalInstance implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键ID")
    private Long id;

    @ApiModelProperty("实例编号")
    private String instanceCode;

    @ApiModelProperty("流程ID")
    private Long processId;

    @ApiModelProperty("业务类型")
    private String businessType;

    @ApiModelProperty("业务数据ID")
    private String businessId;

    @ApiModelProperty("业务数据快照（JSON）")
    private String businessData;

    @ApiModelProperty("当前节点ID")
    private Long currentNodeId;

    @ApiModelProperty("当前节点顺序")
    private Integer currentNodeOrder;

    @ApiModelProperty("状态（0待审批 1审批中 2已通过 3已驳回 4已撤销）")
    private String status;

    @ApiModelProperty("申请人ID")
    private Long applyUserId;

    @ApiModelProperty("申请人姓名")
    private String applyUserName;

    @ApiModelProperty("申请时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date applyTime;

    @ApiModelProperty("完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date finishTime;

    @ApiModelProperty("备注")
    private String remark;

    /**
     * 流程名称（非数据库字段）
     */
    @ApiModelProperty("流程名称")
    private String processName;

    /**
     * 当前节点名称（非数据库字段）
     */
    @ApiModelProperty("当前节点名称")
    private String currentNodeName;

    /**
     * 审批记录列表（非数据库字段）
     */
    @ApiModelProperty("审批记录列表")
    private List<ApprovalRecord> recordList;

    private String name;
}

