package com.czg.product.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import com.czg.validator.group.DefaultGroup;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品SKU
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-02-16
 */
@Data
public class ProdSkuDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private Long id;
    /**
     * 店铺id
     */
    private Long shopId;
    /**
     * 条形码
     */
    private String barCode;
    /**
     * 商品Id
     */
    private Long productId;
    /**
     * 原价
     */
    @NotNull(message = "原价不能为空", groups = DefaultGroup.class)
    private BigDecimal originPrice;
    /**
     * 成本价
     */
    @NotNull(message = "成本价不能为空", groups = DefaultGroup.class)
    private BigDecimal costPrice;
    /**
     * 会员价
     */
    @NotNull(message = "会员价不能为空", groups = DefaultGroup.class)
    private BigDecimal memberPrice;
    /**
     * 售价
     */
    @NotNull(message = "售价不能为空", groups = DefaultGroup.class)
    private BigDecimal salePrice;
    /**
     * 起售数量
     */
    @NotNull(message = "起售数量不能为空", groups = DefaultGroup.class)
    private Integer suitNum;
    /**
     * 规格详情
     */
    private String specInfo;
    /**
     * sku图片
     */
    private String coverImg;
    /**
     * 重量
     */
    private BigDecimal weight;
    /**
     * 销量
     */
    private BigDecimal realSalesNumber;
    /**
     * 是否售罄
     */
    private Integer isPauseSale;
    /**
     * 是否上架
     */
    private Integer isGrounding;
    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    /**
     * 逻辑删除字段 0否 1 删除
     */
    private Integer isDel;
    /**
     * sku名称
     */
    private String name;
    /**
     * 是否上架别名
     */
    private Integer isSale;
    /**
     * 是否售罄别名
     */
    private Integer isSoldStock;
    /**
     * 售价别名
     */
    private BigDecimal lowPrice;


    public String getName() {
        return specInfo;
    }

    public Integer getIsSale() {
        return isGrounding;
    }

    public Integer getIsSoldStock() {
        return isPauseSale;
    }

    public BigDecimal getLowPrice() {
        return salePrice;
    }
}