package com.lesingle.creation.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 评审状态枚举
 */
@Getter
@AllArgsConstructor
public enum ReviewStatusEnum {

    PENDING("pending", "待评审"),
    REVIEWING("reviewing", "评审中"),
    COMPLETED("completed", "已完成");

    private final String code;
    private final String desc;

    public static ReviewStatusEnum getByCode(String code) {
        if (code == null) {
            return PENDING;
        }
        for (ReviewStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return PENDING;
    }
}
