package com.ruoyi.bst.hardwareVersion.domain;

import java.time.LocalDate;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import org.springframework.format.annotation.DateTimeFormat;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.interfaces.LogBizParam;
import com.ruoyi.common.core.validate.ValidGroup;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 硬件版本对象 bst_hardware_version
 *
 * @author ruoyi
 * @date 2025-04-07
 */
@Data
public class HardwareVersion extends BaseEntity implements LogBizParam
{
    private static final long serialVersionUID = 1L;

    private Long id;

    @Excel(name = "父版本id")
    @ApiModelProperty("父版本id")
    private Long parentId;

    @Excel(name = "祖级列表")
    @ApiModelProperty("祖级列表")
    private String ancestors;

    @Excel(name = "版本号")
    @ApiModelProperty("版本号")
    @NotBlank(message = "版本号不能为空", groups = {ValidGroup.Create.class})
    private String version;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生产时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("生产时间")
    private LocalDate productionTime;

    @Excel(name = "数量")
    @ApiModelProperty("数量")
    @Min(value = 0, message = "数量不能小于0")
    private Integer quantity;

    @Excel(name = "未录入数量")
    @ApiModelProperty("未录入数量")
    @Min(value = 0, message = "未录入数量不能小于0")
    private Integer notEnteredNum;

    @Excel(name = "版本说明")
    @ApiModelProperty("版本说明")
    @Size(max = 5000, message = "版本说明不能超过5000个字")
    private String instructions;

    @Override
    public Object logBizId() {
        return id;
    }
}
