package com.seven.ikar.kotlin.core.push

enum class NotificationSoundOption {
    Default,
    Ringtone,
    Alarm,
    Silent
}

enum class NotificationRepeatIntervalOption(val minutes: Int) {
    Off(0),
    FifteenMinutes(15),
    ThirtyMinutes(30),
    OneHour(60),
    TwoHours(120)
}

data class NotificationSoundChoice(
    val value: NotificationSoundOption,
    val title: String
)

data class NotificationRepeatIntervalChoice(
    val value: NotificationRepeatIntervalOption,
    val title: String
)

data class NotificationSettingsSnapshot(
    val notificationsEnabled: Boolean,
    val messageSound: NotificationSoundOption,
    val privateChatsEnabled: Boolean,
    val groupsEnabled: Boolean,
    val channelsEnabled: Boolean,
    val storiesEnabled: Boolean,
    val reactionsEnabled: Boolean,
    val callVibrationEnabled: Boolean,
    val callRingtone: NotificationSoundOption,
    val showBadge: Boolean,
    val includeMutedChatsInBadge: Boolean,
    val countMessagesInBadge: Boolean,
    val inAppSoundEnabled: Boolean,
    val inAppVibrationEnabled: Boolean,
    val inAppShowTextEnabled: Boolean,
    val soundInActiveChatEnabled: Boolean,
    val popupWindowsEnabled: Boolean,
    val contactJoinedEnabled: Boolean,
    val pinnedMessagesEnabled: Boolean,
    val restartOnCloseEnabled: Boolean,
    val backgroundConnectionEnabled: Boolean,
    val repeatInterval: NotificationRepeatIntervalOption
)

data class ChatNotificationSettingsSnapshot(
    val notificationsEnabled: Boolean? = null,
    val messageSound: NotificationSoundOption? = null,
    val showMessagePreview: Boolean? = null,
    val popupWindowsEnabled: Boolean? = null,
    val soundInActiveChatEnabled: Boolean? = null
)

object NotificationPreferenceCatalog {
    val messageSoundChoices: List<NotificationSoundChoice> = listOf(
        NotificationSoundChoice(NotificationSoundOption.Default, "По умолчанию"),
        NotificationSoundChoice(NotificationSoundOption.Ringtone, "Рингтон"),
        NotificationSoundChoice(NotificationSoundOption.Alarm, "Сигнал"),
        NotificationSoundChoice(NotificationSoundOption.Silent, "Без звука")
    )

    val callRingtoneChoices: List<NotificationSoundChoice> = listOf(
        NotificationSoundChoice(NotificationSoundOption.Default, "По умолчанию"),
        NotificationSoundChoice(NotificationSoundOption.Ringtone, "Рингтон"),
        NotificationSoundChoice(NotificationSoundOption.Alarm, "Сигнал"),
        NotificationSoundChoice(NotificationSoundOption.Silent, "Без звука")
    )

    val repeatChoices: List<NotificationRepeatIntervalChoice> = listOf(
        NotificationRepeatIntervalChoice(NotificationRepeatIntervalOption.Off, "Выключен"),
        NotificationRepeatIntervalChoice(NotificationRepeatIntervalOption.FifteenMinutes, "15 минут"),
        NotificationRepeatIntervalChoice(NotificationRepeatIntervalOption.ThirtyMinutes, "30 минут"),
        NotificationRepeatIntervalChoice(NotificationRepeatIntervalOption.OneHour, "1 час"),
        NotificationRepeatIntervalChoice(NotificationRepeatIntervalOption.TwoHours, "2 часа")
    )
}
