package com.xinelu.manage.dto.goodsInfo;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import com.xinelu.manage.domain.goodsAttributeDetails.GoodsAttributeDetails;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author ljh
 * @version 1.0
 * Create by 2022/10/21 9:19
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class GoodsAttributeDTO extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -188353299573627882L;
    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    @Excel(name = "商品id")
    private Long goodsId;

    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    @Excel(name = "商品id")
    private Long id;

    /**
     * 商品属性名称
     */
    @ApiModelProperty(value = "商品属性名称")
    @Excel(name = "商品属性名称")
    @NotBlank(message = "商品属性名称不能为空", groups = {Insert.class, Update.class})
    @Length(max = 50, message = "商品属性名称不能超过50位", groups = {Insert.class, Update.class})
    private String attributeName;

    /**
     * 商品属性编码
     */
    @ApiModelProperty(value = "商品属性编码")
    @Excel(name = "商品属性编码")
    private String attributeCode;

    /**
     * 商品属性概述
     */
    @ApiModelProperty(value = "商品属性概述")
    @Excel(name = "商品属性概述")
    private String attributeRemark;

    /**
     * 显示顺序
     */
    @ApiModelProperty(value = "显示顺序")
    @Excel(name = "显示顺序")
    @NotNull(message = "商品属性顺序不能为空！", groups = {Insert.class, Update.class})
    private Integer attributeDetailsSort;

    /**
     * 显示顺序
     */
    @ApiModelProperty(value = "显示顺序")
    @Excel(name = "显示顺序")
    private Integer sort;

    /**
     * 批量新增商品属性明细
     */
    @Valid
    private List<GoodsAttributeDetails> goodAttributeDetailsLists;

    /**
     * 主键id
     */
    private Long goodAttributeDetailsId;

    /**
     * 主键id
     */
    private Long attributeDetailsId;

    /**
     * 商品属性id
     */
    private Long goodsAttributeId;

    /**
     * 商品属性明细名称
     */
    private String attributeDetailsName;

    /**
     * 库存数量
     */
    @NotNull(message = "库存数量不能为空", groups = {Insert.class, Update.class})
    private Integer goodsStock;

    /**
     * 商品单价，保留到小数点后两位
     */
    @NotNull(message = "商品单价不能为空", groups = {Insert.class, Update.class})
    private BigDecimal goodsPrice;

    /**
     * 商品属性图片地址
     */
    @NotBlank(message = "商品属性图片地址不能为空", groups = {Insert.class, Update.class})
    private String attributePitureUrl;

    /**
     * 商品图片地址
     */
    private String goodsPictureUrl;

    /**
     * 商品概述
     */
    private String goodsRemark;

    /**
     * 积分兑换标识，0：否，1：是
     */
    private Integer integralExchangeFlag;

    /**
     * 积分兑换门槛值
     */
    private Integer integralExchangeSill;

    /**
     * 积分兑换商品数量
     */
    private Integer integralExchangeCount;
}
