wire types: use chrono DateTime<Utc> as the timestamp type throughout
This commit is contained in:
parent
1e205289c5
commit
2c5d9ed336
15 changed files with 108 additions and 190 deletions
|
|
@ -1,6 +1,6 @@
|
|||
//! Wire types shared between `hive-c0re` and the in-container harness.
|
||||
|
||||
use crate::wire_time::WireTime;
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub mod assets;
|
||||
|
|
@ -210,10 +210,10 @@ pub struct Approval {
|
|||
/// hive-c0re refreshes this + re-renders the card for re-review.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub fetched_sha: Option<String>,
|
||||
pub requested_at: WireTime,
|
||||
pub requested_at: DateTime<Utc>,
|
||||
pub status: ApprovalStatus,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub resolved_at: Option<WireTime>,
|
||||
pub resolved_at: Option<DateTime<Utc>>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub note: Option<String>,
|
||||
/// Free-text description the manager attached at submission time;
|
||||
|
|
@ -449,7 +449,7 @@ pub enum LooseEnd {
|
|||
id: i64,
|
||||
owner: String,
|
||||
message: String,
|
||||
due_at: WireTime,
|
||||
due_at: DateTime<Utc>,
|
||||
age_seconds: u64,
|
||||
},
|
||||
/// Undelivered inbox messages waiting to be `recv`'d by this agent.
|
||||
|
|
@ -1414,17 +1414,17 @@ pub struct WireSchedule {
|
|||
pub body: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub interval_seconds: Option<u64>,
|
||||
pub next_fire_at_unix: WireTime,
|
||||
pub created_at_unix: WireTime,
|
||||
pub next_fire_at_unix: DateTime<Utc>,
|
||||
pub created_at_unix: DateTime<Utc>,
|
||||
pub source: WireScheduleSource,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub cancelled_at_unix: Option<WireTime>,
|
||||
pub cancelled_at_unix: Option<DateTime<Utc>>,
|
||||
/// Set while the schedule is paused. Worker skips paused rows;
|
||||
/// they keep their `next_fire_at_unix` so resuming at any time
|
||||
/// fires at the next intended instant (no catch-up clamp needed
|
||||
/// — a paused schedule simply slips its next fire).
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub paused_at_unix: Option<WireTime>,
|
||||
pub paused_at_unix: Option<DateTime<Utc>>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
pub targets: Vec<WireScheduleTarget>,
|
||||
|
|
@ -1441,9 +1441,9 @@ pub enum WireScheduleSource {
|
|||
pub struct WireScheduleTarget {
|
||||
pub target: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub cancelled_at_unix: Option<WireTime>,
|
||||
pub cancelled_at_unix: Option<DateTime<Utc>>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub last_fired_at_unix: Option<WireTime>,
|
||||
pub last_fired_at_unix: Option<DateTime<Utc>>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub last_result: Option<String>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue