package com.gree.mall.manager.enums.workorder;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.google.common.collect.Lists;
import com.gree.mall.manager.enums.base.BaseEnum;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum AppraiseStatusEnum implements BaseEnum {

    A("A","满意"),
    B("B","一般"),
    C("C","不满意"),
    N("N","未评价"),
    O("O","其他"),
    T("T","剔除");

    @JsonValue
    @EnumValue
    private final String key;
    private final String remark;


    /**
     * 好评
     * @return
     */
    public static List<String> good() {
        return Collections.singletonList(A.getKey());
    }

    /**
     * 差评
     * @return
     */
    public static List<String> bad() {
        return Lists.newArrayList(B, C)
                .stream()
                .map(BaseEnum::getKey)
                .collect(Collectors.toList());
    }

    /**
     * 用户评价
     * @return
     */
    public static List<String> client() {
        return Lists.newArrayList(A, B, C)
                .stream()
                .map(BaseEnum::getKey)
                .collect(Collectors.toList());
    }
}
