use serde::{Deserialize, Serialize};
use uuid::Uuid;
use chrono::{DateTime, Utc};

/// Streaming request
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StreamingRequest {
    pub track_id: Uuid,
    pub user_id: Uuid,
    pub quality: StreamingQuality,
    pub start_position: Option<u32>,
    pub token: String,
    pub expires_at: DateTime<Utc>,
}

/// Streaming quality
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum StreamingQuality {
    Low,    // 128kbps
    Medium, // 256kbps
    High,   // 320kbps
    Lossless, // FLAC
}

/// Streaming response
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StreamingResponse {
    pub stream_url: String,
    pub expires_at: DateTime<Utc>,
    pub quality: StreamingQuality,
    pub bitrate: u32,
    pub sample_rate: u32,
    pub duration: u32,
}

/// Audio chunk information
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AudioChunk {
    pub track_id: Uuid,
    pub chunk_index: u32,
    pub data: Vec<u8>,
    pub duration: u32,
    pub is_last: bool,
}
