package com.yc.ship.module.trade.enums.invoice;

import com.yc.ship.framework.common.core.IntArrayValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
 * 开票状态
 *
 * @author le'yang
 */
@RequiredArgsConstructor
@Getter
public enum InvoiceStatusEnum implements IntArrayValuable {


    NOT_INVOICED(0, "未开票"),
    INVOICE_SUCCESS(1, "开票成功"),
    INVOICE_FAILED(2, "开票失败"),
    OFFLINE_INVOICED(3, "线下已开票"),
    INVOICE_INVOIING(4, "开票中"),

    INVOICE_RED_INVOIING(5, "冲红中"),
    INVOICE_RED_SUCCESS(6, "冲红成功"),
    INVOICE_RED_FAILED(7, "冲红失败");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(InvoiceStatusEnum::getValue).toArray();

    /**
     * 状态值
     */
    private final Integer value;
    /**
     * 状态名
     */
    private final String name;

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

}
