import Foundation

/**
 * Device information for analytics and ad targeting
 *
 * Contains device hardware and software information used for analytics
 * and can be exposed to React Native.
 */
public struct DeviceData {
    /// Persistent device identifier (same as userId from SessionManager)
    public let deviceId: String

    /// Device model identifier (e.g., "iPhone14,2")
    public let deviceModel: String

    /// Operating system version (e.g., "17.0")
    public let osVersion: String

    /// App version string (e.g., "1.2.3")
    public let appVersion: String

    /// Screen width in points
    public let screenWidth: Int

    /// Screen height in points
    public let screenHeight: Int

    /// User's language code (e.g., "en")
    public let language: String

    /// User's country code (e.g., "US")
    public let country: String

    /// Whether the device is a tablet
    public let isTablet: Bool

    /// Mobile carrier name (if available)
    public let carrier: String?

    /// Network connection type (e.g., "wifi", "cellular")
    public let networkType: String?

    public init(
        deviceId: String,
        deviceModel: String,
        osVersion: String,
        appVersion: String,
        screenWidth: Int,
        screenHeight: Int,
        language: String,
        country: String,
        isTablet: Bool,
        carrier: String? = nil,
        networkType: String? = nil
    ) {
        self.deviceId = deviceId
        self.deviceModel = deviceModel
        self.osVersion = osVersion
        self.appVersion = appVersion
        self.screenWidth = screenWidth
        self.screenHeight = screenHeight
        self.language = language
        self.country = country
        self.isTablet = isTablet
        self.carrier = carrier
        self.networkType = networkType
    }
}
