use chrono::{DateTime, NaiveDate, Utc};
use rmcp::schemars;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum ProjectStatus {
Planning,
Active,
OnHold,
Completed,
Archived,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum TaskType {
Epic,
Story,
Task,
Bug,
Subtask,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum TaskStatus {
Backlog,
Todo,
InProgress,
InReview,
Blocked,
Done,
Cancelled,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum Priority {
Critical,
High,
Medium,
Low,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum DependencyType {
BlockedBy,
Blocks,
RelatesTo,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum SprintStatus {
Planned,
Active,
Closed,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum MilestoneStatus {
Open,
Reached,
Missed,
}
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Project {
pub id: String,
pub key: String,
pub name: String,
pub description: String,
pub status: ProjectStatus,
pub lead: Option<String>,
pub members: Vec<String>,
pub start_date: Option<NaiveDate>,
pub target_date: Option<NaiveDate>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Dependency {
pub dep_type: DependencyType,
pub task_id: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Comment {
pub id: String,
pub author: String,
pub body: String,
pub created_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct TimeLog {
pub id: String,
pub user: String,
pub hours: f64,
pub note: Option<String>,
pub logged_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Task {
pub id: String,
pub project_id: String,
pub task_type: TaskType,
pub title: String,
pub description: String,
pub status: TaskStatus,
pub priority: Priority,
pub assignee: Option<String>,
pub reporter: String,
pub parent_id: Option<String>,
pub sprint_id: Option<String>,
pub milestone_id: Option<String>,
pub labels: Vec<String>,
pub estimate: Option<f64>,
pub dependencies: Vec<Dependency>,
pub comments: Vec<Comment>,
pub time_logs: Vec<TimeLog>,
pub due_date: Option<NaiveDate>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub completed_at: Option<DateTime<Utc>>,
}
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Sprint {
pub id: String,
pub project_id: String,
pub name: String,
pub goal: Option<String>,
pub status: SprintStatus,
pub start_date: Option<NaiveDate>,
pub end_date: Option<NaiveDate>,
pub created_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Milestone {
pub id: String,
pub project_id: String,
pub name: String,
pub description: String,
pub status: MilestoneStatus,
pub due_date: Option<NaiveDate>,
pub created_at: DateTime<Utc>,
}