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

use crate::event::{RoomInfo, UserInfo};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageReadService {
    pub room: RoomInfo,
    pub message_id: Uuid,
    pub message_seq: i64,
    pub reader: UserInfo,
    pub read_at: DateTime<Utc>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageReadBatchService {
    pub room: RoomInfo,
    pub message_ids: Vec<Uuid>,
    pub last_seq: i64,
    pub reader: UserInfo,
    pub read_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageReadersService {
    pub message_id: Uuid,
    pub readers: Vec<MessageReaderEntry>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageReaderEntry {
    pub user: UserInfo,
    pub read_at: DateTime<Utc>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageMarkReadClient {
    pub room: Uuid,
    pub message_ids: Vec<Uuid>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageGetReadersClient {
    pub message_id: Uuid,
}
