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

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hys.app.model.erp.dos.ProductDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * 产品新增/编辑DTO
 *
 * @author 张崧
 * 2023-11-30 16:06:44
 */
@Data
public class ProductDTO {

    @ApiModelProperty(hidden = true)
    @JsonIgnore
    private Long id;

    private Long goodsId;

    @ApiModelProperty(name = "snCode", value = "商品序列号")
    private String snCode;

    @ApiModelProperty(name = "barCode", value = "条码")
    private String barCode;

    @ApiModelProperty(name = "sku", value = "sku")
    private String sku;

    @ApiModelProperty(name = "price", value = "售价")
    @NotNull(message = "销售价格不能为空")
    @Min(value = 0, message = "销售价格不能小于0")
    private Double price;

    @ApiModelProperty(name = "weight", value = "重量")
    @NotNull(message = "重量不能为空")
    @Min(value = 0, message = "重量不能小于0")
    private Double weight;

    @ApiModelProperty(name = "unit", value = "单位")
    @NotBlank(message = "单位不能为空")
    private String unit;

    @ApiModelProperty(name = "spec_name", value = "规格名")
    private List<String> specName;

    @ApiModelProperty(name = "spec_value", value = "规格值")
    private String specValue;

    @ApiModelProperty(name = "day_price", value = "日租金")
    private BigDecimal dayPrice;

    @ApiModelProperty(name = "weight", value = "规格集合")
    private ProductDO.SpecList specList;

    @ApiModelProperty(name = "是否有序列号", value = "商品视频")
    private Boolean haveSn;

    @ApiModelProperty(name = "hireOrSail", value = "商品相册")
    private String hireOrSail;

}

