Skip to main content

DomainTaskRepository

Trait DomainTaskRepository 

Source
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.

Domain and adapters should depend on this interface rather than concrete storage details.

Required Methods§

Source

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§

Source

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.

Source

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.

Source

fn has_tasks(&self, change_id: &str) -> Result<bool, DomainError>

Check if a change has any tasks defined.

Source

fn get_tasks(&self, change_id: &str) -> Result<Vec<TaskItem>, DomainError>

Get all tasks for a change.

Implementors§