package com.lesingle.creation.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 评审分配状态枚举
 */
@Getter
@AllArgsConstructor
public enum AssignmentStatusEnum {

    ASSIGNED("assigned", "已分配"),
    REVIEWING("reviewing", "评审中"),
    COMPLETED("completed", "已完成");

    private final String code;
    private final String desc;

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