package ru.fincode.tsudesk.feature.schedule.domain.model

import ru.fincode.tsudesk.feature.schedule.data.remote.ScheduleApiContract.Query.LessonType.VALUE_DEFAULT
import ru.fincode.tsudesk.feature.schedule.data.remote.ScheduleApiContract.Query.LessonType.VALUE_LAB
import ru.fincode.tsudesk.feature.schedule.data.remote.ScheduleApiContract.Query.LessonType.VALUE_LECTURE
import ru.fincode.tsudesk.feature.schedule.data.remote.ScheduleApiContract.Query.LessonType.VALUE_PRACTICE

data class LessonEntity(
    val date: String,        // "12.01.2026"
    val time: String,        // "11:00 - 13:55"
    val name: String,     // discipline
    val typeName: String,    // "Лекции", "Лабораторные занятия" и т.д.
    val room: String,
    val teacher: String,
    val groupIds: List<String>,
    val type: LessonType
)

enum class LessonType {
    DEFAULT,
    LECTURE,
    LAB,
    PRACTICE;

    companion object {
        fun fromApi(value: String?): LessonType =
            when (value?.lowercase()) {
                VALUE_LECTURE -> LECTURE
                VALUE_LAB -> LAB
                VALUE_PRACTICE -> PRACTICE
                VALUE_DEFAULT -> DEFAULT
                else -> DEFAULT
            }
    }
}