pub trait TaskRepository {
// Required method
fn load_tasks(&self, change_id: &str) -> DomainResult<TasksParseResult>;
// Provided methods
fn get_progress(&self, change_id: &str) -> DomainResult<ProgressInfo> { ... }
fn get_task_counts(&self, change_id: &str) -> DomainResult<(u32, u32)> { ... }
fn has_tasks(&self, change_id: &str) -> DomainResult<bool> { ... }
fn get_tasks(&self, change_id: &str) -> DomainResult<Vec<TaskItem>> { ... }
}Expand description
Repository port for loading and querying task data. Port for accessing task data.
This trait defines the interface for reading task tracking information. Implementations (in the core layer) handle the file I/O and parsing details.
Consumers in the domain or adapter layers should rely on this trait to remain decoupled from storage specifics.
Required Methods§
Sourcefn load_tasks(&self, change_id: &str) -> DomainResult<TasksParseResult>
fn load_tasks(&self, change_id: &str) -> DomainResult<TasksParseResult>
Load all tasks for a change.
Returns the full parse result including diagnostics.
Provided Methods§
Sourcefn get_progress(&self, change_id: &str) -> DomainResult<ProgressInfo>
fn get_progress(&self, change_id: &str) -> DomainResult<ProgressInfo>
Get task progress for a change.
This is a convenience method that returns just the progress info.
Sourcefn get_task_counts(&self, change_id: &str) -> DomainResult<(u32, u32)>
fn get_task_counts(&self, change_id: &str) -> DomainResult<(u32, u32)>
Get task counts (completed, total) for a change.
Implementations should return (0, 0) when the tasks file doesn’t exist.
Sourcefn has_tasks(&self, change_id: &str) -> DomainResult<bool>
fn has_tasks(&self, change_id: &str) -> DomainResult<bool>
Check if a change has any tasks defined.