[habit][library] Habit: the local day with rollover, days read, the forgiving weekly streak, the reminder schedule, medals as a pure function of the log; sessions carry their UTC offset
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! Events: what a device did, with a hybrid logical clock. The order of events is total and the same everywhere.
|
||||
|
||||
use crate::library::{BookFile, BookInfo, Colour, Field, GoalKind, Mark, Outcome, Person};
|
||||
use crate::library::{BookFile, BookInfo, Colour, Field, GoalKind, HabitGoal, Mark, Outcome, Person};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
@@ -151,10 +151,21 @@ pub enum Op {
|
||||
active_ms: u64,
|
||||
pages: u32,
|
||||
date: String,
|
||||
/// The device's UTC offset at `start`, in minutes (Day 2); `None` for older sessions.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
offset_min: Option<i32>,
|
||||
},
|
||||
Goal {
|
||||
year: i32,
|
||||
kind: GoalKind,
|
||||
target: u32,
|
||||
},
|
||||
/// The daily habit (Day 2): what counts as a day read, and when a day rolls over. Follows the person.
|
||||
HabitGoal {
|
||||
goal: HabitGoal,
|
||||
},
|
||||
/// A medal was shown (Day 2). Medals themselves are computed from the log, never stored.
|
||||
MedalSeen {
|
||||
medal: String,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user