pub trait DomainTaskRepository {
// Required method
fn load_tasks(
&self,
change_id: &str,
) -> Result<TasksParseResult, DomainError>;
// Provided methods
fn get_progress(&self, change_id: &str) -> Result<ProgressInfo, DomainError> { ... }
fn get_task_counts(
&self,
change_id: &str,
) -> Result<(u32, u32), DomainError> { ... }
fn has_tasks(&self, change_id: &str) -> Result<bool, DomainError> { ... }
fn get_tasks(&self, change_id: &str) -> Result<Vec<TaskItem>, DomainError> { ... }
}Expand description
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) -> Result<TasksParseResult, DomainError>
fn load_tasks(&self, change_id: &str) -> Result<TasksParseResult, DomainError>
Load all tasks for a change.
Returns the full parse result including diagnostics.
Provided Methods§
Sourcefn get_progress(&self, change_id: &str) -> Result<ProgressInfo, DomainError>
fn get_progress(&self, change_id: &str) -> Result<ProgressInfo, DomainError>
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) -> Result<(u32, u32), DomainError>
fn get_task_counts(&self, change_id: &str) -> Result<(u32, u32), DomainError>
Get task counts (completed, total) for a change.
Implementations should return (0, 0) when the tasks file doesn’t exist.