package com.reading.platform.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;
    }

}
