package com.lesingle.edu.common.enums;

import lombok.Getter;

/**
 * Lesson Status Enum
 */
@Getter
public enum LessonStatus {

    SCHEDULED("SCHEDULED", "Scheduled"),
    IN_PROGRESS("IN_PROGRESS", "In Progress"),
    COMPLETED("COMPLETED", "Completed"),
    CANCELLED("CANCELLED", "Cancelled");

    private final String code;
    private final String description;

    LessonStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static LessonStatus fromCode(String code) {
        for (LessonStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return SCHEDULED;
    }

}
