wire types: use chrono DateTime<Utc> as the timestamp type throughout

This commit is contained in:
damocles 2026-07-03 20:54:33 +02:00 committed by mara
commit 2c5d9ed336
15 changed files with 108 additions and 190 deletions

View file

@ -231,9 +231,9 @@ impl Approvals {
agent: row.agent,
kind: kind_from_str(&row.kind)?,
commit_ref: row.commit_ref,
requested_at: hive_sh4re::wire_time::WireTime(row.requested_at),
requested_at: hive_sh4re::wire_time::from_secs(row.requested_at),
status: ApprovalStatus::Approved,
resolved_at: Some(hive_sh4re::wire_time::WireTime(resolved_at)),
resolved_at: Some(hive_sh4re::wire_time::from_secs(resolved_at)),
note: None,
fetched_sha: row.fetched_sha,
description: row.description,
@ -294,9 +294,9 @@ impl Approvals {
agent: row.agent,
kind: kind_from_str(&row.kind)?,
commit_ref: row.commit_ref,
requested_at: hive_sh4re::wire_time::WireTime(row.requested_at),
requested_at: hive_sh4re::wire_time::from_secs(row.requested_at),
status: ApprovalStatus::Cancelled,
resolved_at: Some(hive_sh4re::wire_time::WireTime(resolved_at)),
resolved_at: Some(hive_sh4re::wire_time::from_secs(resolved_at)),
note: Some(note),
fetched_sha: row.fetched_sha,
description: row.description,
@ -404,11 +404,11 @@ fn row_to_approval(row: &rusqlite::Row<'_>) -> rusqlite::Result<Approval> {
agent: row.get(1)?,
kind,
commit_ref: row.get(3)?,
requested_at: hive_sh4re::wire_time::WireTime(row.get(4)?),
requested_at: hive_sh4re::wire_time::from_secs(row.get(4)?),
status,
resolved_at: row
.get::<_, Option<i64>>(6)?
.map(hive_sh4re::wire_time::WireTime),
.map(hive_sh4re::wire_time::from_secs),
note: row.get(7)?,
fetched_sha: row.get(8)?,
description: row.get(9)?,