package com.czg.product.dto;

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.time.LocalDateTime;

/**
* 店铺商品分类
*
* @author Tankaikai tankaikai@aliyun.com
* @since 1.0 2025-02-10
*/
@Data
public class ShopProdCategoryDTO 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;
    /**
     * 分类名称
     */
    @NotBlank(message = "分类名称不能为空", groups = DefaultGroup.class)
    private String name;
    /**
     * 简称
     */
    private String shortName;
    /**
     * 上级分类id-为0则表示是顶级
     */
    private Long pid;
    /**
     * 图标
     */
    private String pic;
    /**
     * 店铺Id
     */
    private Long shopId;
    /**
     * 分类描述
     */
    private String detail;
    /**
     * 排序
     */
    @NotNull(message = "排序值不能为空", groups = DefaultGroup.class)
    private Integer sort;
    /**
     * 关键词
     */
    private String keyWord;
    /**
     * 状态 0-禁用 1-启用
     */
    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退菜退库存 2仅退菜不退库存 3每次询问-退菜后弹窗提示
     */
    private Integer refundMode;
}