package com.cool.store.request.order;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

@Data
public class PCStoreOrderOptionQuantityUpdateRequest {

    @ApiModelProperty(value = "订单ID", required = true)
    @NotNull(message = "订单ID不能为空")
    private Long orderId;

    @ApiModelProperty(value = "配置项列表", required = true)
    @Valid
    @NotNull(message = "配置项列表不能为空")
    private List<SelectedOption> selectedOptions;

    @Data
    public static class SelectedOption {
        @ApiModelProperty(value = "配置项ID", required = true)
        @NotNull(message = "配置项ID不能为空")
        private Long optionId;

        @ApiModelProperty(value = "数量", required = true)
        @NotNull(message = "数量不能为空")
        private BigDecimal quantity;
    }
}
