This commit is contained in:
Daniel Flanagan 2024-03-19 12:23:47 -05:00
parent 4833cb7b0e
commit b0078dd224

View file

@ -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<MergeRequestRef>,
jira_priority: i64,
local_priority: i64,
status: String,
tags: HashSet<String>,
}
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<Vec<Task>> {}
/// 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(())
}
}