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

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hys.app.model.goods.dos.GoodsGalleryDO;
import com.hys.app.model.goods.dos.GoodsParamsDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 商品新增/编辑DTO
 *
 * @author 张崧
 * 2023-12-26 15:56:58
 */
@Data
@Getter
@Setter
public class GoodsDTO {

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

    @ApiModelProperty(name = "imageList", value = "商品相册")
    @NotBlank(message = "出租商品  售卖商品")
    private String hireOrSail;

    @ApiModelProperty(name = "name", value = "商品名称")
    @NotBlank(message = "商品名称不能为空")
    private String name;

    @ApiModelProperty(name = "enName", value = "商品英文名称")
    private String enName;

    @ApiModelProperty(name = "sn", value = "商品编号")
    @NotBlank(message = "商品编号不能为空")
    private String sn;

    @ApiModelProperty(name = "categoryId", value = "商品分类id")
    @NotNull(message = "商品分类id不能为空")
    private Long categoryId;

    @ApiModelProperty(name = "brandId", value = "品牌id")
    private Long brandId;

    @ApiModelProperty(name = "marketEnable", value = "是否上架 true上架")
    @NotNull(message = "状态不能为空")
    private Boolean marketEnable;

    @ApiModelProperty(name = "allowSn", value = "是否启用序列号1是2否")
    @NotNull(message = "是否启用序列号1是2否")
    private Integer allowSn;

    @ApiModelProperty(name = "video", value = "商品视频")
    private String video;

    @ApiModelProperty(name = "haveSpec", value = "是否有规格")
    @NotNull(message = "是否有规格不能为空 1有规格  0无规格")
    private Boolean spec;

    @ApiModelProperty(name = "description", value = "商品详情")
    private String description;

    @ApiModelProperty(name = "freightTemplate_id", value = "运费模板id（0代表包邮）")
    @NotNull(message = "运费模板id不能为空")
    private Long freightTemplateId;

    @ApiModelProperty(name = "product_list", value = "产品列表")
    @NotEmpty(message = "产品列表不能为空")
    @Valid
    private List<ProductDTO> productList;

    @ApiModelProperty(name = "imageList", value = "商品相册")
    @NotEmpty(message = "商品相册不能为空")
    private List<GoodsGalleryDO> imageList;

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

