package com.cool.store.request.store;

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

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

/**
 * 店型配置选项保存请求
 */
@Data
@ApiModel(description = "店型配置选项保存请求")
public class StoreTypeOptionSaveRequest {

    @ApiModelProperty(value = "店型ID", required = true, example = "1")
    @NotNull(message = "店型ID不能为空")
    private Long storeTypeId;

    @ApiModelProperty("店型可选项配置列表")
    private List<StoreTypeOptionItemRequest> options;

    @Data
    @ApiModel(description = "店型选项项配置")
    public static class StoreTypeOptionItemRequest {
        @ApiModelProperty(value = "配置选项ID", required = true, example = "1001")
        @NotNull(message = "选项ID不能为空")
        private Long optionId;

        @ApiModelProperty(value = "配置类型编码", example = "DECOR")
        private String categoryCode;

        @ApiModelProperty(value = "配置项编码", example = "DOOR")
        private String itemCode;

        @ApiModelProperty(value = "是否默认选中：0-否 1-是", example = "1")
        private Integer isDefault;

        @ApiModelProperty(value = "默认数量", example = "1.20")
        private BigDecimal defaultQuantity;

        @ApiModelProperty(value = "是否允许编辑数量：0-否 1-是", example = "1")
        private Integer allowQuantityEdit;

        @ApiModelProperty(value = "排序号", example = "10")
        private Integer sortOrder;

        @ApiModelProperty("店型内-配置项单价")
        private BigDecimal optionPrice;

        @ApiModelProperty("顶部预览图")
        private String topPreviewImage;
    }
}