package com.cool.store.vo.shop;

import com.cool.store.enums.point.ShopStageEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangchenbiao
 * @FileName: ShopStageEnumVO
 * @Description:
 * @date 2024-04-11 11:13
 */
@Data
public class ShopStageVO {

    @ApiModelProperty("大阶段")
    private Integer shopStage;

    @ApiModelProperty("阶段名称")
    private String shopStageName;

    @ApiModelProperty("子阶段")
    private List<ShopSubStageVO> shopSubStageList;

    public ShopStageVO(Integer shopStage, String shopStageName, List<ShopSubStageVO> shopSubStageList) {
        this.shopStage = shopStage;
        this.shopStageName = shopStageName;
        this.shopSubStageList = shopSubStageList;
    }

    public static List<ShopStageVO> getShopStageList() {
        List<ShopStageVO> shopStageList = new ArrayList<>();
        for (ShopStageEnum shopStageEnum : ShopStageEnum.values()) {
            List<ShopSubStageVO> shopSubStageList = new ArrayList<>();
            List<ShopSubStageEnum> shopSubStageEnumList = ShopSubStageEnum.getShopStageEnum(shopStageEnum.getShopStage());
            for (ShopSubStageEnum shopSubStageEnum : shopSubStageEnumList) {
                List<ShopSubStageStatusVO> subStageStatusList = new ArrayList<>();
                List<ShopSubStageStatusEnum> shopSubStageStatusEnum = ShopSubStageStatusEnum.getShopSubStageStatusEnum(shopSubStageEnum);
                for (ShopSubStageStatusEnum subStageStatusEnum : shopSubStageStatusEnum) {
                    subStageStatusList.add(new ShopSubStageStatusVO(subStageStatusEnum.getShopSubStageStatus(), subStageStatusEnum.getShopSubStageStatusName()));
                }
                shopSubStageList.add(new ShopSubStageVO(shopSubStageEnum.getShopSubStage(), shopSubStageEnum.getShopSubStageName(), subStageStatusList));
            }
            shopStageList.add(new ShopStageVO(shopStageEnum.getShopStage(), shopStageEnum.getStageName(), shopSubStageList));
        }
        return shopStageList;
    }

}
