diff --git a/src/db.rs b/src/db.rs index d963b70..e0da8d9 100644 --- a/src/db.rs +++ b/src/db.rs @@ -67,6 +67,10 @@ impl Project { client_id: Set(self.client_id.map(|id| id as i32)), workspace_id: Set(self.workspace_id as i64), raw_json: Set(serde_json::to_value(self).unwrap()), + color: Set(self.color.clone()), + server_created_at: Set(chrono::DateTime::parse_from_rfc3339(&self.created_at).unwrap()), + server_updated_at: Set(chrono::DateTime::parse_from_rfc3339(&self.at).unwrap()), + server_deleted_at: Set(self.server_deleted_at.map(|dt| chrono::DateTime::parse_from_rfc3339(&dt).unwrap())), } } diff --git a/src/toggl_api/types.rs b/src/toggl_api/types.rs index 4cf412d..9558e4a 100644 --- a/src/toggl_api/types.rs +++ b/src/toggl_api/types.rs @@ -61,9 +61,30 @@ pub struct Project { pub client_id: Option, pub name: String, pub active: bool, + pub color: String, + pub at: String, + pub server_deleted_at: Option, + pub created_at: String, - #[serde(flatten)] - pub rest: HashMap, + // cid: Option, + // wid: i64, + // rate: Option, + // status: String, + // billable: Option, + // currency: Option, + // template: Option, + // fixed_fee: Option, + // recurring: bool, + // is_private: bool, + // start_date: String, + // template_id: Option, + // actual_hours: i64, + // actual_seconds: i64, + // auto_estimates: Option, + // estimated_hours: Option, + // estimated_seconds: Option, + // rate_last_updated: Option, + // recurring_parameters: Option, } /// Represents a client in Toggl.