//
//  Enum.swift
//  MyTatvaCare
//
//  Created by Nirav Ramani on 01/06/25.
//

import Foundation
/// Represents the various CGM connection states or errors
enum CGMConnectionStatus: String {
    /// CGM & Bluetooth are connected (isBoundAndConnect)
    case connected = "CONNECTED"

    /// CGM is disconnected (isDisConnect)
    case disconnected = "DISCONNECTED"

    /// Moisture detected – corresponds to `ErrorCode.ERROR_FLOODING_WATER`
    case moistureDetect = "MOISTURE_DETECT"

    /// Weak signal – possible causes: `ERROR_CURRENT_SMALL`, `ERROR_NOISE`, `ERROR_SENSITIVITY_ATTENUATION`
    case weakSignal = "WEAK_SIGNAL"

    /// Sensor expired – also managed from backend when `countdownDays`, `countdownMin`, and `countdownHours` become 0
    case expired = "EXIPRED" // Note: Typo preserved from original string; use with caution or normalize

    /// Transmitter disconnected due to out-of-range issue (isBoundButDisConnect) – see Figma page 8
    case transmitterDisconnect = "TRANSMITTER_DISCONNECT"

    /// Bluetooth is turned off
    case bluetoothOff = "BLUETOOTH_OFF"

    /// Transmitter disconnected and unbound (isUnBind) – see Figma page 12
    case transmitterDisconnectBox = "TRANSMITTER_DISCONNECT_BOX"

    /// Common fallback error when no specific error code is matched
    case errorCommon = "ERROR_COMMON"
}
