package com.snack.server.module.cart.dto.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;

/**
 * 加入购物车请求
 */
@Data
@Schema(description = "加入购物车请求")
public class CartAddReq implements Serializable {

    @NotNull(message = "商品 ID 不能为空")
    @Schema(description = "商品 SPU ID")
    private Long productId;

    @NotNull(message = "SKU ID 不能为空")
    @Schema(description = "商品 SKU ID")
    private Long skuId;

    @NotNull(message = "数量不能为空")
    @Min(value = 1, message = "数量至少为 1")
    @Schema(description = "数量", example = "1")
    private Integer quantity = 1;
}
