package com.yc.ship.module.marketing.enums.coupon;

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

import java.util.Arrays;

@RequiredArgsConstructor
@Getter
public enum CouponCodeUseStateEnum implements IntArrayValuable {
    UNUSED(0, "未使用"),
    USED(1, "已使用"),
    EXPIRED(2, "已过期"),
    ;

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

    private final int type;
    private final String name;

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