package com.czg.account.dto.points;

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

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

/**
 * 积分商品设置
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-02-25
 */
@Data
public class PointsGoodsSettingDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Null(message = "ID必须为空", groups = InsertGroup.class)
    @NotNull(message = "ID不能为空", groups = UpdateGroup.class)
    private Long id;
    /**
     * 店铺id
     */
    @NotNull(message = "店铺id不能为空", groups = DefaultGroup.class)
    private Long shopId;
    /**
     * 商品类型 physical-实物 coupon-优惠劵
     */
    @NotBlank(message = "商品类型不能为空", groups = DefaultGroup.class)
    private String goodsCategory;
    /**
     * 商品名称
     */
    @NotBlank(message = "商品名称不能为空", groups = DefaultGroup.class)
    private String goodsName;
    /**
     * 商品图片URL
     */
    private String goodsImageUrl;
    /**
     * 所需积分
     */
    @NotNull(message = "所需积分不能为空", groups = DefaultGroup.class)
    private Integer requiredPoints;
    /**
     * 额外价格
     */
    @NotNull(message = "额外价格不能为空", groups = DefaultGroup.class)
    private BigDecimal extraPrice;
    /**
     * 排序(权重)，数字越高，显示约靠前
     */
    @NotNull(message = "排序(权重)不能为空", groups = DefaultGroup.class)
    private Integer sort;
    /**
     * 数量
     */
    @NotNull(message = "数量不能为空", groups = DefaultGroup.class)
    private Integer quantity;
    /**
     * 商品详情
     */
    private String goodsDescription;
    /**
     * 累计兑换数量
     */
    private Integer totalExchangeCount;
    /**
     * 是否上架 1-是 0-否
     */
    @NotNull(message = "是否上架不能为空", groups = DefaultGroup.class)
    private Integer status;
    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    /**
     * 逻辑删除标志 1-是 0-否
     */
    private Integer delFlag;

}