package com.backendsys.entity.B2c;

import com.backendsys.entity.validator.RangeStringArray;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class B2cShoppingCartDTO {
    public static interface Detail{}
    public static interface Create{}
    public static interface Update{}
    public static interface Delete{}

    /**
     * b2c_goods
     */
    private Long id;
    private Long shopping_cart_id;

    @NotNull(message = "会员ID不能为空", groups = { B2cShoppingCartDTO.Detail.class, B2cShoppingCartDTO.Update.class })
    private Long member_id;
    @NotNull(message = "商品ID不能为空", groups = { B2cShoppingCartDTO.Detail.class, B2cShoppingCartDTO.Update.class })
    private Long good_id;
    @NotNull(message = "规格ID不能为空", groups = { B2cShoppingCartDTO.Detail.class, B2cShoppingCartDTO.Update.class })
    private Long sku_id;

    @NotNull(message = "购买数量不能为空", groups = { B2cShoppingCartDTO.Create.class, B2cShoppingCartDTO.Update.class })
    @Min(value = 0, message = "购买数量必须大于等于0", groups = { B2cShoppingCartDTO.Create.class, B2cShoppingCartDTO.Update.class })
    @Max(value = 999999999, message = "购买数量必须小于等于 {max} 字符", groups = { B2cShoppingCartDTO.Create.class, B2cShoppingCartDTO.Update.class })
    private Long quantity;

    @RangeStringArray(message="来源取值有误，范围应是(MiniProgram, H5, APP)", value = {"MiniProgram", "H5", "APP"}, groups = { B2cShoppingCartDTO.Create.class, B2cShoppingCartDTO.Update.class })
    private String source;

    private String create_time;
    private String update_time;
}
