Repository navigation
Data Model
haakooto edited this page Oct 24, 2026
·
5 revisions
Part of the Relay design spec. See the contents.
Persistence
- id: UUID
- label: String, unique
- durationExpr: String
- sound: SoundSpec
- headerId, sortOrder: library
- warnSeconds, warnTone: 0 = none (v7)
- id: UUID
- label: String, unique
- script: String
- stepOverrides: Map<stepKey, StepOverride>
- defaultSound: SoundSpec
- transitionMode: SEAMLESS / INTERACTION
- transitionTone: enum
- headerId, sortOrder: library
- id: UUID
- sourceDefId?: null = anonymous
- label?: String
- plan: List<Step> snapshot
- stepIndex, phase: Int, enum
- stepEndsAt / remaining: Instant / Duration
- startedBy: user / scheduleId / external
- id, label?, enabled
- time, date?: LocalTime, LocalDate
- repeatDays: Set<DayOfWeek>
- endRule: never / date / count
- afterFire: DELETE / DISABLE
- target: sealed, below
target = Ring(sound, ramp, snooze, maxSnoozes) | Notify | Timer(defId or inline expr, label?) | Relay(defId or inline script, label?) | Stopwatch(name?, t₀). Every row also stores createdBy (user / external app).
Calendar reminders (§10b, DB v8) add: eventId? (the item it reminds of), startEpochDay? (repeat begins), repeatMonthDay? / repeatMonth? (monthly / yearly), leadMinutes (fires this long before each occurrence).
- id, kind: EVENT / REMINDER, title, note
- startEpochDay, startMinute? (null = all day), endEpochDay?, endMinute?
- repeatKind: NONE / WEEKLY / MONTHLY / YEARLY, repeatDays (weekly mask), untilEpochDay?
- Its reminder is a Schedule with
eventId= this id
- scheduleId: FK
- startDay, endDay: LocalDate
- kind: SKIP / RETIME(time)
- id, name?
- t0, accumulated: Duration
- startedAt?: Instant
- laps: List<Lap(at, note?)>
- sortOrder: Long
- kind: DIGITAL / ANALOGUE
- digital fields: font, format, seconds, date
- analogue fields: hands, ticks, face, secondHand
- colors: per element
Embedded (JSON) in the main-clock setting and in each WidgetInstance.
- Location: zoneId, city, sortOrder
- Widget: appWidgetId, style, zoneId?, city?
- widget background, shape, border
- LibraryHeader: title, sortOrder
- SoundSpec: ringtoneUri, vibration: embedded
v0.5's SoundProfile table stored vibration and volume that nothing ever read. It's now an embedded value, with every field used.
Relay · spec v1.0 · clean-restart baseline, update as screens get built