pub struct Task {
pub id: String,
pub title: String,
pub description: String,
pub status: TaskStatus,
pub priority: TaskPriority,
pub dependencies: Vec<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}
Expand description
Represents a task in a specification with dependencies and tracking information.
A Task
represents a specific piece of work that needs to be completed as part
of implementing a specification. Tasks can depend on other tasks and are tracked
through various status states with assigned priorities.
§Task Dependencies
Tasks can depend on other tasks being completed first. The dependencies
field
contains a list of task IDs that must be completed before this task can begin.
This enables proper work sequencing and prevents conflicts.
§Fields
id
- Unique identifier for the task (e.g., “task_001”, “auth_implementation”)title
- Short, descriptive name for the taskdescription
- Detailed explanation of what needs to be donestatus
- Current progress state (Todo, InProgress, Completed, Blocked)priority
- Importance level for scheduling (Low, Medium, High, Critical)dependencies
- List of task IDs that must be completed firstcreated_at
- Timestamp when the task was createdupdated_at
- Timestamp of the last modification
§Examples
use project_manager_mcp::models::task::{Task, TaskStatus, TaskPriority};
use chrono::Utc;
// Simple independent task
let setup_task = Task {
id: "setup_database".to_string(),
title: "Set up PostgreSQL database".to_string(),
description: "Install and configure PostgreSQL with initial schema".to_string(),
status: TaskStatus::Todo,
priority: TaskPriority::High,
dependencies: vec![], // No dependencies
created_at: Utc::now(),
updated_at: Utc::now(),
};
// Task with dependencies
let api_task = Task {
id: "implement_api".to_string(),
title: "Implement REST API endpoints".to_string(),
description: "Create CRUD endpoints for user management".to_string(),
status: TaskStatus::Todo,
priority: TaskPriority::Medium,
dependencies: vec!["setup_database".to_string()], // Depends on database
created_at: Utc::now(),
updated_at: Utc::now(),
};
// Critical bug fix
let bug_task = Task {
id: "fix_memory_leak".to_string(),
title: "Fix memory leak in user session handling".to_string(),
description: "Investigate and fix memory leak causing OOM errors".to_string(),
status: TaskStatus::InProgress,
priority: TaskPriority::Critical,
dependencies: vec![],
created_at: Utc::now(),
updated_at: Utc::now(),
};
Fields§
§id: String
Unique identifier for the task
title: String
Short, descriptive name for the task
description: String
Detailed explanation of what needs to be done
status: TaskStatus
Current progress state of the task
priority: TaskPriority
Importance level for scheduling work
dependencies: Vec<String>
List of task IDs that must be completed first
created_at: DateTime<Utc>
Timestamp when the task was created
updated_at: DateTime<Utc>
Timestamp of the last modification