use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::label::Label;
use crate::name::ResourceName;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "sqlx", derive(sqlx::FromRow))]
pub struct Object<L: Label> {
pub id: Uuid,
pub label: L,
pub name: ResourceName,
pub properties: Option<serde_json::Value>,
pub version: u64,
pub created_at: chrono::DateTime<chrono::Utc>,
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Association<L: Label> {
pub id: Uuid,
pub from_id: Uuid,
pub label: String,
pub to_id: Uuid,
pub to_label: L,
pub properties: Option<serde_json::Value>,
pub created_at: chrono::DateTime<chrono::Utc>,
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}