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

import com.yc.ship.framework.common.core.ArrayValuable;
import lombok.Getter;

import java.util.Arrays;


@Getter
public enum InsuranceStatusEnum implements ArrayValuable<Integer> {

    NOT_INSURE(0, "未投保"),
    INSURE(1, "投保中"),
    SUCCESS(2, "成功"),
    FAIL(3, "失败"),
    CANCELLED(4, "已退保");

    private final String name;
    private final Integer value;
    public static final Integer[] ARRAYS = Arrays.stream(values()).map(InsuranceStatusEnum::getValue).toArray(Integer[]::new);

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

    InsuranceStatusEnum(Integer status, String name) {
        this.value = status;
        this.name = name;
    }
}