package cn.newfeifan.mall.module.trade.controller.app.cart.vo;

import cn.newfeifan.mall.module.trade.controller.app.base.sku.AppProductSkuBaseRespVO;
import cn.newfeifan.mall.module.trade.controller.app.base.spu.AppProductSpuBaseRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;
import java.util.Map;

@Schema(description = "用户 App - 用户的购物列表 Response VO")
@Data
public class AppCartListRespVO {

    /**
     * add by Ben
     */
    @Schema(description = "key为店铺ID,value为店铺名", requiredMode = Schema.RequiredMode.REQUIRED, example = "{1:'中星旗舰店',3:'五行茶官方店'}")
    private Map<Long,String> shopNameMap;

    /**
     * add by Ben
     * key为店铺ID,value为店铺下的商品skuId集合
     */
    @Schema(description = "key为店铺ID,value为店铺下的商品skuId集合", requiredMode = Schema.RequiredMode.REQUIRED, example = "{1:[12,46],3:[3,578]}}")
    private Map<Long,List<Long>> shopSkuMap;

    /**
     * 有效的购物项数组
     */
    private List<Cart> validList;

    /**
     * 无效的购物项数组，指已经下架的购物车商品
     */
    private List<Cart> invalidList;

    @Schema(description = "购物项")
    @Data
    public static class Cart {

        @Schema(description = "购物项的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
        private Long id;

        @Schema(description = "商品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
        private Integer count;

        @Schema(description = "是否选中", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
        private Boolean selected;

        /**
         * 商品 SPU
         */
        private AppProductSpuBaseRespVO spu;
        /**
         * 商品 SKU
         */
        private AppProductSkuBaseRespVO sku;

    }

}
