feat: meeting data migration and backup

This commit is contained in:
Owen Gretzinger
2025-07-11 14:44:45 -04:00
parent 3a183cb5e8
commit 858f934fb0
3 changed files with 102 additions and 6 deletions
+10 -1
View File
@@ -69,21 +69,30 @@ struct Meeting: Codable, Identifiable, Hashable {
var transcriptChunks: [TranscriptChunk]
var userNotes: String
var generatedNotes: String
// MARK: - Data versioning
/// Version of this Meeting record on disk. Useful for migration.
var dataVersion: Int
/// Current app data version. Increment whenever you make a breaking change to `Meeting` that requires migration.
static let currentDataVersion = 1
init(id: UUID = UUID(),
date: Date = Date(),
title: String = "",
transcriptChunks: [TranscriptChunk] = [],
userNotes: String = "",
generatedNotes: String = "") {
generatedNotes: String = "",
dataVersion: Int = Meeting.currentDataVersion) {
self.id = id
self.date = date
self.title = title
self.transcriptChunks = transcriptChunks
self.userNotes = userNotes
self.generatedNotes = generatedNotes
self.dataVersion = dataVersion
}
// `Codable` conformance now uses the compiler-synthesised implementation.
// Computed property for backward compatibility with existing code
var transcript: String {
return transcriptChunks