use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use sqlx::FromRow;
use uuid::Uuid;

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, FromRow)]
pub struct RoomMessageModel {
    pub id: Uuid,
    pub room: Uuid,
    pub seq: i64,
    pub thread: Option<Uuid>,
    pub parent: Option<Uuid>,
    pub author: Uuid,
    pub content: String,
    pub content_type: String,
    pub pinned: bool,
    pub system_type: Option<String>,
    #[serde(default)]
    pub metadata: Value,
    pub edited_at: Option<DateTime<Utc>>,
    pub created_at: DateTime<Utc>,
    pub updated_at: DateTime<Utc>,
    pub deleted_at: Option<DateTime<Utc>>,
}
