package com.seer.teach.mall.enums;


import com.seer.teach.common.validation.ArrayValuable;
import lombok.Getter;

import java.util.Arrays;

@Getter
public enum GoodsStatusEnum  implements ArrayValuable<Integer> {

    /**
     * 待审核
     */
    PENDING_REVIEW(0, "待审核"),
    /**
     * 审核通过
     */
    APPROVED(1, "审核通过"),
    /**
     * 审核拒绝
     */
    REJECTED(2, "审核拒绝");

    private final Integer code;
    private final String description;

    public static final Integer[] ARRAYS = Arrays.stream(values()).map(GoodsStatusEnum::getCode).toArray(Integer[]::new);

    GoodsStatusEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public Integer[] array() {
        return ARRAYS;
    }
}