package com.erp.tenant.entity.stock;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.erp.tenant.entity.common.BaseEntity;

import java.time.LocalDateTime;

/**
 * 库存预警实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("stock_alerts")
public class StockAlert extends BaseEntity {

    // ==================== 预警级别 ====================
    public static final String LEVEL_WARNING = "warning";
    public static final String LEVEL_CRITICAL = "critical";

    // ==================== 主键 ====================
    @TableId(type = IdType.AUTO)
    private Long id;

    // ==================== 预警信息 ====================
    @TableField("sku_code")
    private String skuCode;

    @TableField("sku_name")
    private String skuName;

    @TableField("warehouse_id")
    private Long warehouseId;

    @TableField("warehouse_name")
    private String warehouseName;

    /** 预警级别 */
    private String level;

    /** 预警类型 */
    @TableField("alert_type")
    private String alertType;

    /** 当前可用库存 */
    @TableField("available_quantity")
    private Integer availableQuantity;

    /** 预警阈值 */
    @TableField("warning_threshold")
    private Integer warningThreshold;

    /** 缺口数量 */
    @TableField("shortage_count")
    private Integer shortageCount;

    /** 是否已处理 */
    @TableField("is_resolved")
    private Boolean isResolved;

    /** 处理时间 */
    @TableField("resolved_at")
    private LocalDateTime resolvedAt;

    /** 处理备注 */
    @TableField("resolve_remark")
    private String resolveRemark;
}
