add 'entry' key to tasks when created

This commit is contained in:
Dustin J. Mitchell
2022-01-06 02:18:32 +00:00
parent d6efad06ee
commit 9824ac1fd3
3 changed files with 15 additions and 1 deletions

View File

@@ -108,6 +108,7 @@ impl Replica {
let mut task = Task::new(uuid, taskmap).into_mut(self);
task.set_description(description)?;
task.set_status(status)?;
task.set_entry(Utc::now())?;
Ok(task.into_immut())
}
@@ -228,7 +229,7 @@ mod tests {
..
} = op
{
if property == "modified" {
if property == "modified" || property == "entry" {
if value.is_some() {
value = Some("just-now".into());
}
@@ -277,6 +278,13 @@ mod tests {
value: Some("pending".into()),
timestamp: now,
},
ReplicaOp::Update {
uuid: t.get_uuid(),
property: "entry".into(),
old_value: None,
value: Some("just-now".into()),
timestamp: now,
},
ReplicaOp::Update {
uuid: t.get_uuid(),
property: "modified".into(),