/// One run of a routine. Sent whether the chain held or broke — a broken /// chain is logged as partial, never silently dropped. class RoutineLogRequest { String routineId; String startedAt; /// Foreground seconds only. Backgrounding pauses the run. int elapsedSeconds; int completedSteps; int totalSteps; /// Step index the chain broke at; -1 when it held. int breakIndex; int backgroundedCount; int skippedCount; RoutineLogRequest({ this.routineId = "", this.startedAt = "", this.elapsedSeconds = 0, this.completedSteps = 0, this.totalSteps = 0, this.breakIndex = -1, this.backgroundedCount = 0, this.skippedCount = 0, }); Map toJson() { final Map data = {}; data['routineId'] = routineId; data['startedAt'] = startedAt; data['elapsedSeconds'] = elapsedSeconds; data['completedSteps'] = completedSteps; data['totalSteps'] = totalSteps; data['breakIndex'] = breakIndex; data['backgroundedCount'] = backgroundedCount; data['skippedCount'] = skippedCount; return data; } }