package com.tt.honeyDue.widget import kotlinx.serialization.Serializable /** * DTO persisted to the widget DataStore as JSON, mirroring iOS * `WidgetDataManager.swift`'s on-disk task representation. * * iOS field map (for reference — keep in sync): * - id Int (task id) * - title String * - priority Int (priority id) * - dueDate String? ISO-8601 ("yyyy-MM-dd" or full datetime) * - isOverdue Bool * - daysUntilDue Int * - residenceId Int * - residenceName String * - categoryIcon String SF-symbol-style identifier * - completed Bool * * Kotlin uses [Long] for ids to accommodate any server-side auto-increment range. */ @Serializable data class WidgetTaskDto( val id: Long, val title: String, val priority: Long, val dueDate: String?, val isOverdue: Boolean, val daysUntilDue: Int, val residenceId: Long, val residenceName: String, val categoryIcon: String, val completed: Boolean ) /** * Lightweight residence identifier persisted to the widget DataStore. * * Written by the main app whenever [com.tt.honeyDue.data.DataManager.myResidences] * updates so the widget configuration activity can offer the current * residence list (gitea#6 — per-residence widget selection). Mirrors * iOS' `WidgetDataManager.WidgetResidence` shape. */ @Serializable data class WidgetResidenceDto( val id: Long, val name: String ) /** * Summary metrics computed from the cached task list. * * Windows match iOS `calculateMetrics` semantics: * - overdueCount tasks with isOverdue == true * - dueWithin7 tasks with 0 <= daysUntilDue <= 7 * - dueWithin8To30 tasks with 8 <= daysUntilDue <= 30 */ data class WidgetStats( val overdueCount: Int, val dueWithin7: Int, val dueWithin8To30: Int )