package com.zt.plat.module.qms.resource.material.controller.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.zt.plat.module.qms.resource.material.valid.AddGroup;
import com.zt.plat.module.qms.resource.material.valid.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Schema(description = "管理后台 - 物料大类新增/修改 Request VO")
@Data
public class MaterialProductSaveReqVO {

    @NotNull(groups = {UpdateGroup.class}, message = "更新操作 ID 不能为空")
    @Null(groups = {AddGroup.class}, message = "新增操作 ID 必须为空")
    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "23369")
    private Long id;

    @Schema(description = "父id", example = "7533")
    private Long parentId = 0L;

    @Schema(description = "编码,原始数据编码")
    private String code;

    @Schema(description = "名称", example = "ZT")
    private String name;

    @Schema(description = "其他配置")
    private String customConfig;

    @Schema(description = "自定义表单（预留的扩展字段）")
    private String customForm;

    @Schema(description = "扩展数据（预留的扩展字段）")
    private String customData;

    @Schema(description = "标签（预留的扩展字段）")
    private String tag;

    @Schema(description = "标签模板")
    private String labelTemplateKey;

    @Schema(description = "型号")
    private String modelNo;

    @Schema(description = "规格")
    private String specification;

    @Schema(description = "技术参数")
    private String parameter;

    @Schema(description = "额定容量")
    private BigDecimal standardCapacity;

    @Schema(description = "制造商")
    private String manufacturer;

    @Schema(description = "单位")
    private String unit;

    @Schema(description = "关联的样品大类")
    private String sampleIds;

    @Schema(description = "允许按量领取,1-领用时输入量，按量领取；0-领用时不能输入量，整个领走")
    private Integer enablePartial;

    @Schema(description = "保质期（天）")
    @Min(value = 0, message = "保质期不能小于0")
    private Integer due;

    @Schema(description = "开封后保质期是否变化,1-是，0-否")
    private Integer openDueFlag;

    @Schema(description = "开封后保质期（天）")
    @Min(value = 0, message = "保质期不能小于0")
    private Integer openDueAfter;

    @Schema(description = "是否危险品,1-是，0-否")
    private Integer hazardous;

    @Schema(description = "是否标准溶液,1-是，0-否")
    private Integer standardSolutionFlag;

    @Schema(description = "是否标准物质,1-是，0-否")
    private Integer standardMaterialFlag;

    @Schema(description = "复标周期,单位：天。小于等于0-不复标")
    @Min(value = 0, message = "复标周期不能小于0")
    private Integer reviewDue;

    @Schema(description = "排序号")
    private Integer sortNo;

    @Schema(description = "禁用标识")
    private Integer cancelFlag;

    @Schema(description = "是否检化验,1-是，0-否")
    private Integer assayFlag;

    @Schema(description = "是否进行库存预警,1-是，0-否")
    private Integer inventoryAlarmFlag;

    @Schema(description = "库存预警区间,json格式配置")
    private String inventoryAlarmRange;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "删除的文件id")
    private List<Long> deleteFileIdList;

}