summaryrefslogtreecommitdiff
path: root/internal/store/native_tasks.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/store/native_tasks.go')
-rw-r--r--internal/store/native_tasks.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/store/native_tasks.go b/internal/store/native_tasks.go
index f43a160..7789a0d 100644
--- a/internal/store/native_tasks.go
+++ b/internal/store/native_tasks.go
@@ -32,6 +32,9 @@ func (s *Store) GetNativeTasks() ([]models.Task, error) {
}
// GetNativeTasksByDateRange returns non-completed native tasks due within the given range.
+// Overdue tasks (due before start) are deliberately excluded here -- BuildTimeline fetches
+// those separately via GetOverdueNativeTasks so callers that only want "in range" can use this
+// without double-counting against that separate fetch.
func (s *Store) GetNativeTasksByDateRange(start, end time.Time) ([]models.Task, error) {
rows, err := s.db.Query(`
SELECT id, content, description, project_name, due_date, priority, completed, labels, created_at
@@ -100,6 +103,15 @@ func (s *Store) UpdateNativeTask(id, content, description string) error {
return err
}
+// UpdateNativeTaskDescription updates only a native task's description, leaving content untouched.
+func (s *Store) UpdateNativeTaskDescription(id, description string) error {
+ _, err := s.db.Exec(`
+ UPDATE native_tasks SET description = ?, updated_at = CURRENT_TIMESTAMP
+ WHERE id = ?
+ `, description, id)
+ return err
+}
+
// CompleteNativeTask marks a task as completed. Returns ErrNativeTaskNotFound
// if id doesn't match any row.
func (s *Store) CompleteNativeTask(id string) error {