package com.hys.app.model.erp.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hys.app.model.erp.enums.DamageinventoryEnum;
import com.hys.app.model.erp.enums.StockDamageReportTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 库存报损单实体DTO
 *
 * @author dmy
 * 2023-12-05
 */
@Data
public class StockDamageReportDTO implements Serializable {

    private static final long serialVersionUID = -2146175467517339422L;




    @ApiModelProperty(name = "report_time", value = "报损时间", required = true)
    @NotNull(message = "报损时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date reportTime;


    @ApiModelProperty(name = "damage_type_value", value = "报损类型")
    private StockDamageReportTypeEnum damageTypeValue;

    @ApiModelProperty(name = "creator_id", value = "制单人ID")
    private Long creatorId;


    /**
     * 仓库ID
     */
    @ApiModelProperty(name = "warehouse_id", value = "仓库ID", required = true)
    @NotNull(message = "仓库ID不能为空")
    private Long warehouseId;

    /**
     * 报损说明
     */
    @ApiModelProperty(name = "report_desc", value = "报损说明", required = true)
    @NotEmpty(message = "调整说明不能为空")
    private String reportDesc;
    /**
     * 库存报损单产品集合
     */
    @ApiModelProperty(name = "product_list", value = "库存报损单产品集合", required = true)
    @NotNull(message = "库存报损单产品不能为空")
    @Valid
    private List<StockDamageReportProductDTO> productList;

    @ApiModelProperty(name = "status", value = "状态")
    private DamageinventoryEnum status;

    /**
     * 通知用户的Id
     */
    private Long  noticeUserId;

    /**
     * 是否通知
     */
    private Boolean  hasNotice;
}
