photon_backend/models/topic.rs
1//! Topic metadata model (for persistence).
2
3use chrono::{DateTime, Utc};
4use serde::{Deserialize, Serialize};
5
6/// Topic metadata stored in the registry.
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct TopicMetadata {
9 /// Unique topic ID (UUID).
10 pub topic_id: String,
11 /// Stable topic name (e.g., "user.notifications").
12 pub topic_name: String,
13 /// Optional key field name for keyed topics.
14 pub keyed_by: Option<String>,
15 /// JSON schema for payload.
16 pub schema_json: serde_json::Value,
17 /// When the topic was registered.
18 pub created_at: DateTime<Utc>,
19}