package com.yhy.module.core.dal.dataobject.workbench;

import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yhy.module.core.dal.typehandler.PostgreSQLJsonbTypeHandler;
import java.time.LocalDateTime;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 审核模式 DO
 *
 * @author yhy
 */
@TableName(value = "yhy_wb_audit_mode", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AuditModeDO extends BaseDO {

    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 租户ID
     */
    private Long tenantId;

    /**
     * 关联项目节点ID（yhy_wb_project_tree.id）
     */
    private Long projectId;

    /**
     * 审核模式名称
     */
    private String name;

    /**
     * 状态：draft/submitted/approved
     */
    private String status;

    /**
     * 送审时间
     */
    private LocalDateTime submitTime;

    /**
     * 审定时间
     */
    private LocalDateTime approveTime;

    /**
     * 扩展属性（JSONB）
     */
    @TableField(typeHandler = PostgreSQLJsonbTypeHandler.class)
    private Map<String, Object> attributes;

    // 状态常量
    public static final String STATUS_DRAFT = "draft";
    public static final String STATUS_SUBMITTED = "submitted";
    public static final String STATUS_APPROVED = "approved";
}
