diff --git a/src/tasks.rs b/src/tasks.rs index 853a831..4617c3c 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -1,7 +1,24 @@ -use std::{env, process::Command}; +use std::{collections::HashSet, env, process::Command}; use crate::{gitlab::GitLab, jira::Jira, result::Result}; +#[derive(Serialize, Deserialize, Debug)] +pub struct MergeRequestRef { + url: String, + state: String, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct Task { + jira_key: String, + description: String, + merge_requests: Vec, + jira_priority: i64, + local_priority: i64, + status: String, + tags: HashSet, +} + pub struct Tasks { pub gitlab: GitLab, pub jira: Jira, @@ -29,4 +46,14 @@ impl Tasks { Ok(Self { gitlab, jira }) } + + pub async fn all(&self) -> Result> {} + + /// fetches jira issues and compares to known local tasks + /// for use when sync'ing local tasks to remote state (jira, gitlab) + pub async fn desyncs(&self) -> Result<()> { + let issues = self.jira.assigned_open_issues().await?; + + Ok(()) + } }