// Copyright (c) 2025 Gleb Zaharov. License: GPLv3 (see LICENSE).

package ru.sweetbread.unn.api

import ru.sweetbread.unn.R
import splitties.resources.appStr
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.LocalTime

enum class Type(val s: String) {
    student(appStr(R.string.student)),
    group("group"),
    lecturer(appStr(R.string.lecturer)),
    auditorium("auditorium"),
    employee(appStr(R.string.employee))
}

enum class LecturerRank(val id: Int) {
    Assistant(R.string.assistant),
    Lecturer(R.string.lecturer),
    SLecturer(R.string.slecturer),
    AProfessor(R.string.aprofessor)
}

class ScheduleUnit(
    val oid: Int,
    val auditorium: Auditorium,
    val date: LocalDate,
    val discipline: Discipline,
    val kindOfWork: KindOfWork,
    val lecturers: ArrayList<Lecturer>,
    val stream: String,
    val begin: LocalTime,
    val end: LocalTime
)

class Auditorium(
    val name: String,
    val oid: Int,
    val floor: Int,
    val building: Building
)

class Building(
    val name: String,
    val gid: Int,
    val oid: Int
)

class Discipline(
    val name: String,
    val oid: Int,
    val type: Int
)

class KindOfWork(
    val name: String,
    val oid: Int,
    val uid: String,
    val complexity: Int
)

class Lecturer(
    val name: String,
    val rank: LecturerRank,
    val email: String,
    val unnId: Int,
    val uid: String
)

class User(
    val unnId: Int?,
    val userId: Int,
    val type: Type,
    val email: String,
    val nameRu: String,
    val nameEn: String,
    val isMale: Boolean,
    val birthday: LocalDate,
    val avatar: AvatarSet
)

class Post(
    val id: Int,
    val authorId: Int,
    val enableComments: Boolean,
    val numComments: Int,
    val date: LocalDateTime,
    val content: String
)

class AvatarSet(
    val original: String,
    val thumbnail: String,
    val small: String
)