package com.yuchen.saas.payment.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Author: caiwq
 * @Date: 2023/11/6 15:18
 * @Description: 开票范围枚举类型
 */
@Getter
@AllArgsConstructor
public enum InvoiceScopeEnum {

    /**
     * 全部管理区
     */
    ALL(1, "全部管理区"),
    /**
     * 全部园区
     */
    ALL_PARK(2, "全部园区"),
    /**
     * 全部停车场
     */
    ALL_PARKING(3, "全部停车场"),
    /**
     * 全部充电站
     */
    ALL_STATION(4, "全部充电站");

    private final int value;
    private final String desc;

    public static String getDescByCode(Integer value) {
        if (Objects.isNull(value)) {
            return "";
        }
        SaasInvoiceStatusEnum[] enumArray = SaasInvoiceStatusEnum.values();
        for (SaasInvoiceStatusEnum e : enumArray) {
            if (e.getValue() == value) {
                return e.getDesc();
            }
        }
        return "";
    }

}
