package com.xunhong.erp.turbo.biz.infrastructure.entity;

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.xunhong.erp.turbo.api.biz.dto.enums.AuditStateEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.AuditSubjectTypeEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.AuditTypeEnum;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * @author shenyifei
 */
@Data
@TableName(value = "audit")
@EqualsAndHashCode(callSuper = true)
public class AuditDO extends BaseDO<AuditDO> {

	/**
	 * 审核Id
	 */
	@TableId(value = "audit_id", type = IdType.ASSIGN_ID)
	private Long auditId;

	/**
	 * 审核对象Id
	 */
	@TableField(value = "subject_id")
	private Long subjectId;

	/**
	 * 审核对象类型：1_采购单；
	 */
	@TableField(value = "subject_type")
	private AuditSubjectTypeEnum subjectType;

	/**
	 * 审核状态: 1_待审核；2_审核中；3_审核通过：4_审核驳回；5_审核取消；
	 */
	@TableField(value = "state")
	private AuditStateEnum state;

	/**
	 * 审核类型：1_报价审核员审核；2_老板审核
	 */
	@TableField(value = "type")
	private AuditTypeEnum type;

	/**
	 * 驳回原因
	 */
	@TableField(value = "audit_reason")
	private String auditReason;

	/**
	 * 审核时间
	 */
	@TableField(value = "audit_at")
	private LocalDateTime auditAt;

	/**
	 * 审核人ID
	 */
	@TableField(value = "audit_by")
	private Long auditBy;

	/**
	 * 审核人名称
	 */
	@TableField(value = "audit_by_name")
	private String auditByName;

	/**
	 * 创建人ID
	 */
	@TableField(value = "created_by")
	private Long createdBy;

	/**
	 * 创建人姓名
	 */
	@TableField(value = "created_by_name")
	private String createdByName;

	@TableField(exist = false)
	private OrderDO orderDO;

}

