Link up db types
This commit is contained in:
parent
84b4c747f5
commit
0f3c031b7a
@ -67,6 +67,10 @@ impl Project {
|
|||||||
client_id: Set(self.client_id.map(|id| id as i32)),
|
client_id: Set(self.client_id.map(|id| id as i32)),
|
||||||
workspace_id: Set(self.workspace_id as i64),
|
workspace_id: Set(self.workspace_id as i64),
|
||||||
raw_json: Set(serde_json::to_value(self).unwrap()),
|
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())),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,9 +61,30 @@ pub struct Project {
|
|||||||
pub client_id: Option<u64>,
|
pub client_id: Option<u64>,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub active: bool,
|
pub active: bool,
|
||||||
|
pub color: String,
|
||||||
|
pub at: String,
|
||||||
|
pub server_deleted_at: Option<String>,
|
||||||
|
pub created_at: String,
|
||||||
|
|
||||||
#[serde(flatten)]
|
// cid: Option<serde_json::Value>,
|
||||||
pub rest: HashMap<String, Value>,
|
// wid: i64,
|
||||||
|
// rate: Option<serde_json::Value>,
|
||||||
|
// status: String,
|
||||||
|
// billable: Option<serde_json::Value>,
|
||||||
|
// currency: Option<serde_json::Value>,
|
||||||
|
// template: Option<serde_json::Value>,
|
||||||
|
// fixed_fee: Option<serde_json::Value>,
|
||||||
|
// recurring: bool,
|
||||||
|
// is_private: bool,
|
||||||
|
// start_date: String,
|
||||||
|
// template_id: Option<serde_json::Value>,
|
||||||
|
// actual_hours: i64,
|
||||||
|
// actual_seconds: i64,
|
||||||
|
// auto_estimates: Option<serde_json::Value>,
|
||||||
|
// estimated_hours: Option<serde_json::Value>,
|
||||||
|
// estimated_seconds: Option<serde_json::Value>,
|
||||||
|
// rate_last_updated: Option<serde_json::Value>,
|
||||||
|
// recurring_parameters: Option<serde_json::Value>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents a client in Toggl.
|
/// Represents a client in Toggl.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user