|
|
@@ -25,6 +25,39 @@ type CelestiaSession struct {
|
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updatedAt"`
|
|
|
}
|
|
|
|
|
|
+// SessionSyncIndexItem is the lightweight first phase of synchronization.
|
|
|
+// Events and asset descriptors are intentionally omitted; clients fetch the
|
|
|
+// full session only when UpdatedAt or Revision differs from local state.
|
|
|
+type SessionSyncIndexItem struct {
|
|
|
+ ID string `json:"id"`
|
|
|
+ ClientID *string `json:"clientId,omitempty"`
|
|
|
+ Title string `json:"title"`
|
|
|
+ StartTime time.Time `json:"startTime"`
|
|
|
+ EndTime *time.Time `json:"endTime,omitempty"`
|
|
|
+ DurationMs int64 `json:"durationMs"`
|
|
|
+ PhotoCount int `json:"photoCount"`
|
|
|
+ NoteCount int `json:"noteCount"`
|
|
|
+ Revision int64 `json:"revision"`
|
|
|
+ DeletedAt *time.Time `json:"deletedAt,omitempty"`
|
|
|
+ UpdatedAt time.Time `json:"updatedAt"`
|
|
|
+}
|
|
|
+
|
|
|
+func (session CelestiaSession) SyncIndexItem() SessionSyncIndexItem {
|
|
|
+ return SessionSyncIndexItem{
|
|
|
+ ID: session.ID,
|
|
|
+ ClientID: session.ClientID,
|
|
|
+ Title: session.Title,
|
|
|
+ StartTime: session.StartTime,
|
|
|
+ EndTime: session.EndTime,
|
|
|
+ DurationMs: session.DurationMs,
|
|
|
+ PhotoCount: session.PhotoCount,
|
|
|
+ NoteCount: session.NoteCount,
|
|
|
+ Revision: session.Revision,
|
|
|
+ DeletedAt: session.DeletedAt,
|
|
|
+ UpdatedAt: session.UpdatedAt,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// TimelineEvent represents an event (NOTE, PHOTO, MARKER, VOICE) within a session
|
|
|
type TimelineEvent struct {
|
|
|
ID string `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"`
|