TaskValidator.Core.Task (TaskValidator v0.9.1)

View Source

Core domain model representing a task in the task list.

This struct encapsulates all task-related data and provides a clear contract for working with tasks throughout the validation system.

Summary

Functions

Adds a subtask to the task.

Checks if the task is completed.

Determines the category based on the task ID number.

Extracts the prefix from a task ID (e.g., "SSH" from "SSH0001").

Gets the parent task ID for a subtask.

Checks if the task is in progress.

Checks if the task is a main task.

Checks if the task is a subtask.

Types

t()

@type t() :: %TaskValidator.Core.Task{
  category: atom() | nil,
  content: [String.t()],
  description: String.t(),
  id: String.t(),
  line_number: non_neg_integer(),
  parent_id: String.t() | nil,
  prefix: String.t() | nil,
  priority: String.t(),
  review_rating: String.t() | nil,
  status: String.t(),
  subtasks: [t()],
  type: task_type()
}

task_type()

@type task_type() :: :main | :subtask

Functions

add_subtask(task, subtask)

@spec add_subtask(t(), t()) :: t()

Adds a subtask to the task.

completed?(arg1)

@spec completed?(t()) :: boolean()

Checks if the task is completed.

determine_category(id)

@spec determine_category(String.t()) :: atom() | nil

Determines the category based on the task ID number.

extract_prefix(id)

@spec extract_prefix(String.t()) :: String.t() | nil

Extracts the prefix from a task ID (e.g., "SSH" from "SSH0001").

get_parent_id(subtask_id)

@spec get_parent_id(String.t()) :: String.t() | nil

Gets the parent task ID for a subtask.

in_progress?(arg1)

@spec in_progress?(t()) :: boolean()

Checks if the task is in progress.

main_task?(arg1)

@spec main_task?(t()) :: boolean()

Checks if the task is a main task.

new_main_task(id, description, status, priority, content, line_number)

@spec new_main_task(
  String.t(),
  String.t(),
  String.t(),
  String.t(),
  [String.t()],
  non_neg_integer()
) :: t()

Creates a new main task.

new_subtask(id, description, status, content, line_number, parent_id)

@spec new_subtask(
  String.t(),
  String.t(),
  String.t(),
  [String.t()],
  non_neg_integer(),
  String.t()
) :: t()

Creates a new subtask.

subtask?(arg1)

@spec subtask?(t()) :: boolean()

Checks if the task is a subtask.