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

import com.fasterxml.jackson.annotation.JsonFormat;
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.time.LocalDate;
import java.time.LocalDateTime;

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

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

    @Schema(description = "父id,为0时是批次，不为0时是工段", example = "1035")
    private Long parentId;

    @Schema(description = "物料大类id", example = "9381")
    @NotNull(groups = AddGroup.class, message = "物料大类 ID 不能为空")
    private Long productId;

//    @Schema(description = "批次编号")
//    private String batchNo;

    @Schema(description = "总数量")
    @NotNull(groups = AddGroup.class, message = "总数量不能为空")
    @Min(value = 0, message = "总数量不能小于0")
    private BigDecimal inboundQuantity;

    @Schema(description = "存放位置描述")
    private String location;

    @Schema(description = "供应商id", example = "3737")
    private Long supplierId;

    @Schema(description = "生产日期")
    @NotNull(groups = AddGroup.class, message = "生产日期不能为空")
    private LocalDateTime manufacturerDate;

    @Schema(description = "到期日期")
    private LocalDateTime dueDate;

    @Schema(description = "分配部门id")
    private Long assignDepartmentId;

    @Schema(description = "分配部门名称")
    private String assignDepartmentName;

//    @Schema(description = "验收状态", example = "1")
//    private String acceptanceStatus;

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

//    @Schema(description = "检化验状态,NOT_STARTED-未开始，IN_PROGRESS-进行中，PASSED-通过，NOT_PASSED-未通过", example = "IN_PROGRESS")
//    private String assayStatus;

//    @Schema(description = "检化验结果")
//    private String assayResult;

    @Schema(description = "所属部门")
    private String systemDepartmentCode;

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

}