summaryrefslogtreecommitdiff
path: root/makima/src/db/models.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/db/models.rs')
-rw-r--r--makima/src/db/models.rs43
1 files changed, 43 insertions, 0 deletions
diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs
index 45b0e53..135ae75 100644
--- a/makima/src/db/models.rs
+++ b/makima/src/db/models.rs
@@ -18,6 +18,40 @@ pub struct TranscriptEntry {
pub is_final: bool,
}
+/// Chart type for visualization elements
+#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
+#[serde(rename_all = "lowercase")]
+pub enum ChartType {
+ Line,
+ Bar,
+ Pie,
+ Area,
+}
+
+/// Body element types for structured file content
+#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
+#[serde(tag = "type", rename_all = "camelCase")]
+pub enum BodyElement {
+ /// Heading element (h1-h6)
+ Heading { level: u8, text: String },
+ /// Paragraph text
+ Paragraph { text: String },
+ /// Chart visualization
+ Chart {
+ #[serde(rename = "chartType")]
+ chart_type: ChartType,
+ title: Option<String>,
+ data: serde_json::Value,
+ config: Option<serde_json::Value>,
+ },
+ /// Image element (deferred for MVP)
+ Image {
+ src: String,
+ alt: Option<String>,
+ caption: Option<String>,
+ },
+}
+
/// File record from the database.
#[derive(Debug, Clone, FromRow, Serialize, ToSchema)]
#[serde(rename_all = "camelCase")]
@@ -29,6 +63,11 @@ pub struct File {
#[sqlx(json)]
pub transcript: Vec<TranscriptEntry>,
pub location: Option<String>,
+ /// AI-generated summary of the transcript
+ pub summary: Option<String>,
+ /// Structured body content (headings, paragraphs, charts)
+ #[sqlx(json)]
+ pub body: Vec<BodyElement>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}
@@ -57,6 +96,10 @@ pub struct UpdateFileRequest {
pub description: Option<String>,
/// New transcript (optional)
pub transcript: Option<Vec<TranscriptEntry>>,
+ /// AI-generated summary (optional)
+ pub summary: Option<String>,
+ /// Structured body content (optional)
+ pub body: Option<Vec<BodyElement>>,
}
/// Response for file list endpoint.