package com.red.circle.other.domain.redpacket;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 房间红包状态
 */
@Getter
@AllArgsConstructor
public enum RoomRedPacketStatus {

    /**
     * 进行中
     */
    ACTIVE(1, "Active"),

    /**
     * 已抢完
     */
    FINISHED(2, "Finished"),

    /**
     * 已过期
     */
    EXPIRED(3, "Expired");

    private final Integer code;
    private final String desc;

    public static RoomRedPacketStatus of(Integer code) {
        for (RoomRedPacketStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
