import Foundation

/**
 * Session information for analytics tracking
 *
 * Provides current session state including identifiers and tracking counts.
 * This data is used for analytics and can be exposed to React Native.
 */
public struct SessionInfo {
    /// Unique identifier for the current session (changes each app launch)
    public let sessionId: String

    /// Persistent user identifier (stable across app launches)
    public let userId: String

    /// ISO 8601 timestamp when the session started
    public let startTime: String

    /// True if this is the user's first session
    public let isNewUser: Bool

    /// Number of page views in current session (same as screenViewCount)
    public let sessionDepth: Int

    /// Number of screen views in this session
    public let screenViewCount: Int

    /// Number of ad requests made in this session
    public let adRequestCount: Int

    /// Number of ad impressions recorded in this session
    public let adImpressionCount: Int

    /// Total revenue in micros (1/1,000,000 of currency unit) for this session
    public let totalRevenueMicros: Int64

    public init(
        sessionId: String,
        userId: String,
        startTime: String,
        isNewUser: Bool = false,
        sessionDepth: Int,
        screenViewCount: Int,
        adRequestCount: Int,
        adImpressionCount: Int,
        totalRevenueMicros: Int64
    ) {
        self.sessionId = sessionId
        self.userId = userId
        self.startTime = startTime
        self.isNewUser = isNewUser
        self.sessionDepth = sessionDepth
        self.screenViewCount = screenViewCount
        self.adRequestCount = adRequestCount
        self.adImpressionCount = adImpressionCount
        self.totalRevenueMicros = totalRevenueMicros
    }
}
