package com.durian.tssparty.domain.model

/**
 * Application ready state
 */
enum class AppReadyState {
    INITIALIZING,
    READY,
    ERROR
}

/**
 * Service check status
 */
data class ServiceStatus(
    val isOnline: Boolean = false,
    val message: String = "",
    val latency: Long? = null
)

/**
 * Environment state - tracks all service statuses
 */
data class EnvironmentState(
    val database: ServiceStatus = ServiceStatus(),
    val messageRouter: ServiceStatus = ServiceStatus(),
    val kavaApi: ServiceStatus = ServiceStatus()
)

/**
 * Operation progress for keygen/sign
 */
data class OperationProgress(
    val isActive: Boolean = false,
    val type: OperationType = OperationType.NONE,
    val sessionId: String? = null,
    val currentRound: Int = 0,
    val totalRounds: Int = 0,
    val status: String = ""
)

enum class OperationType {
    NONE,
    KEYGEN,
    SIGN
}

/**
 * Global app state (similar to Zustand store in Electron version)
 */
data class AppState(
    val appReady: AppReadyState = AppReadyState.INITIALIZING,
    val appError: String? = null,
    val environment: EnvironmentState = EnvironmentState(),
    val operation: OperationProgress = OperationProgress(),
    val partyId: String? = null,
    val walletCount: Int = 0
)
