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 CartUpdateReq implements Serializable {

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

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