package ru.forbion.f7cloud.feature.calendar

import ru.forbion.f7cloud.core.network.CalendarAlarmData
import ru.forbion.f7cloud.core.network.CalendarAttendeeData

enum class CalendarViewMode(val label: String) {
    DAY("День"),
    WEEK("Неделя"),
    MONTH("Месяц"),
    YEAR("Год"),
    LIST("Список"),
}

enum class CalendarEditorMode {
    CREATE,
    EDIT,
}

enum class RecurrencePreset(val label: String, val rrule: String) {
    NONE("Не повторяется", ""),
    DAILY("Каждый день", "FREQ=DAILY"),
    WEEKLY("Каждую неделю", "FREQ=WEEKLY"),
    MONTHLY("Каждый месяц", "FREQ=MONTHLY"),
    YEARLY("Каждый год", "FREQ=YEARLY"),
}

enum class EventStatus(val label: String, val icsValue: String) {
    CONFIRMED("Подтверждено", "CONFIRMED"),
    TENTATIVE("Предварительно", "TENTATIVE"),
    CANCELLED("Отменено", "CANCELLED"),
}

enum class EventClassification(val label: String, val icsValue: String) {
    PUBLIC("Публичное", "PUBLIC"),
    PRIVATE("Приватное", "PRIVATE"),
    CONFIDENTIAL("Конфиденциальное", "CONFIDENTIAL"),
}

data class CalendarBookItem(
    val href: String,
    val displayName: String,
    val visible: Boolean,
    val isSubscription: Boolean = false,
    val color: String? = null,
)

data class CalendarAttendeeItem(
    val email: String,
    val displayName: String = "",
    val partStat: String = "NEEDS-ACTION",
)

data class CalendarTrashItem(
    val uid: String,
    val href: String,
    val etag: String,
    val summary: String,
    val deletedAt: String,
    val calendarUri: String,
)

data class CalendarTaskItem(
    val uid: String,
    val summary: String,
    val due: String,
    val calendarName: String,
)

data class CalendarEventDraft(
    val title: String = "",
    val date: java.time.LocalDate = java.time.LocalDate.now(),
    val startTime: String = "10:00",
    val endTime: String = "11:00",
    val allDay: Boolean = false,
    val description: String = "",
    val location: String = "",
    val calendarHref: String = "",
    val recurrence: RecurrencePreset = RecurrencePreset.NONE,
    val customRrule: String = "",
    val categories: String = "",
    val status: EventStatus = EventStatus.CONFIRMED,
    val classification: EventClassification = EventClassification.PUBLIC,
    val attendees: List<CalendarAttendeeItem> = emptyList(),
    val attendeeQuery: String = "",
    val reminderMinutes: Int = 15,
    val addTalkRoom: Boolean = false,
    val talkRoomUrl: String = "",
)

data class CalendarCreateBookDraft(
    val name: String = "",
    val withTasks: Boolean = false,
    val subscriptionUrl: String = "",
    val mode: CreateBookMode = CreateBookMode.NEW,
)

enum class CreateBookMode {
    NEW,
    WITH_TASKS,
    SUBSCRIBE,
}
