package com.github.nullptroma.wallenc.domain.tasks

sealed class TaskProgressLabel {
    data object SyncNoGroups : TaskProgressLabel()
    data object SyncStarted : TaskProgressLabel()
    data object SyncCompleted : TaskProgressLabel()
    data class SyncPreparing(val groupCount: Int) : TaskProgressLabel()

    data class SyncGroupPreparing(val groupId: String) : TaskProgressLabel()
    data class SyncGroupNotFound(val groupId: String) : TaskProgressLabel()
    data class SyncGroupSkippedTooFewStorages(val groupId: String) : TaskProgressLabel()
    data class SyncGroupSkippedIncompatibleEncryption(val groupId: String, val count: Int) : TaskProgressLabel()
    data class SyncGroupAcquiringLocks(val groupId: String) : TaskProgressLabel()
    data class SyncGroupLockProgress(val groupId: String, val current: Int, val total: Int) : TaskProgressLabel()
    data class SyncGroupLockFailed(val groupId: String) : TaskProgressLabel()
    data class SyncGroupReadingJournals(val groupId: String) : TaskProgressLabel()
    data class SyncGroupCancelled(val groupId: String) : TaskProgressLabel()
    data class SyncGroupJournalProgress(val groupId: String, val current: Int, val total: Int) : TaskProgressLabel()
    data class SyncGroupNoJournalEntries(val groupId: String) : TaskProgressLabel()
    data class SyncGroupProcessingEntries(val groupId: String, val count: Int) : TaskProgressLabel()
    data class SyncGroupEntryProgress(val groupId: String, val current: Int, val total: Int) : TaskProgressLabel()
    data class SyncGroupCompleted(val groupId: String) : TaskProgressLabel()
    data class SyncGroupEntriesFailed(val groupId: String, val failedCount: Int) : TaskProgressLabel()
    data class SyncGroupRenewingLocks(val groupId: String) : TaskProgressLabel()
    data class SyncGroupLockRenewalFailed(val groupId: String) : TaskProgressLabel()

    data class ClearContentProgress(val done: Int, val total: Int) : TaskProgressLabel()

    data class VaultTask(val step: VaultTaskStep) : TaskProgressLabel()

    data class TestElapsed(val elapsedSec: Int, val totalSec: Int) : TaskProgressLabel()
}

enum class VaultTaskStep {
    DumpStorageLog,
    CreateStorage,
    EnableEncryption,
    DecryptRunning,
    CloseStorage,
    DisableEncryption,
    RenameStorage,
    RemoveStorage,
    ClearSyncLock,
    AddRemoteVault,
    RemoveRemoteVault,
    RetryRemoteVault,
    RescanVaultStorages,
    Save2FaToken,
    Delete2FaToken,
    SaveTextSecret,
    DeleteTextSecret,
}
