mnemosyne/lib/Mnemosyne/Task.pm

18 lines
859 B
Perl

package Mnemosyne::Task;
use strict;
use warnings;
# CRUD operations for the tasks table, plus class-specific field validation.
#
# TODO: create($dbh, \%fields) — insert a new task, validate class + required fields
# TODO: get($dbh, $id) — fetch one task by id (returns hashref or undef)
# TODO: list($dbh, %filters) — list tasks; filters: class, active, priority
# TODO: update($dbh, $id, \%fields) — partial update; sets updated_at
# TODO: delete($dbh, $id) — hard delete (completions cascade)
# TODO: disable($dbh, $id) — set active=0
# TODO: complete($dbh, $id) — insert into completions; for floating, also sets active=0
# TODO: undo_completion($dbh, $completion_id) — delete a completion row (misclick undo)
# TODO: last_completion($dbh, $id) — returns the most recent completions row for a task
1;