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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hys.app.model.erp.dos.AreaStock;
import com.hys.app.model.erp.dos.ProductDO;
import com.hys.app.model.erp.vo.GoodsVO;
import com.hys.app.model.erp.vo.ProductVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 订单明细 新增|编辑 请求参数
 *
 * @author 张崧
 * 2024-01-24 16:39:38
 */
@Data
@ApiModel(value = "订单明细 新增|编辑 请求参数")
public class OrderItemDTO {
    private Long id;

    @ApiModelProperty(name = "product_id", value = "skuid")
    @NotNull(message = "skuid不能为空")
    private Long productId;

    @ApiModelProperty(name = "goods_id", value = "goodsid不能为空")
    @NotNull(message = "goodsid不能为空")
    private Long goodsId;

    @ApiModelProperty(name = "num", value = "数量")
    @NotNull(message = "数量不能为空")
    @Min(value = 1, message = "数量必须大于0")
    private Integer num;

    private GoodsVO goodsVO;

    private ProductVO productVO;

    @ApiModelProperty(name = "usable_stock", value = "可用库存")
    private Integer usableStock;

    @ApiModelProperty(name = "warehouse_id", value = "可用库存")
    @NotNull(message = "仓库id不能为空")
    private Long warehouseId;

    @ApiModelProperty(name = "product_stock_id", value = "商品库存id")
    private Long productStockId;

    @ApiModelProperty(name = "end_time", value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    private Integer returnNum;

    private Integer dayNum;

    List<AreaStock> areaStockList;

}

