import Foundation

public enum DevicePlatform: String, Codable, Sendable, CaseIterable {
    case macos = "MACOS"
    case iphone = "IPHONE"
}

public struct LibraryTrack: Identifiable, Codable, Hashable, Sendable {
    public let id: UUID
    public var title: String
    public var artist: String
    public var album: String?

    public init(
        id: UUID = UUID(),
        title: String,
        artist: String,
        album: String? = nil
    ) {
        self.id = id
        self.title = title
        self.artist = artist
        self.album = album
    }
}

public struct DeviceRegistrationPayload: Codable, Hashable, Sendable {
    public var platform: DevicePlatform
    public var deviceName: String
    public var appVersion: String

    public init(
        platform: DevicePlatform,
        deviceName: String,
        appVersion: String
    ) {
        self.platform = platform
        self.deviceName = deviceName
        self.appVersion = appVersion
    }
}

public struct SyncCursor: Codable, Hashable, Sendable {
    public var value: String

    public init(value: String = "0") {
        self.value = value
    }
}

public struct ServerEnvironment: Codable, Hashable, Sendable {
    public var baseURL: URL
    public var appVersion: String

    public init(
        baseURL: URL,
        appVersion: String
    ) {
        self.baseURL = baseURL
        self.appVersion = appVersion
    }
}
