tasks

v1.0

4 commands · 1 schemas

Commands

create_task

Create new task

Source: S02.2 Step 5 → Step 8. Inserts a new row into the tasks table; done defaults to false.

Params

NameTypeRequiredDescription
user_id integer Current signed-in user ID, from the Zustand store
name string maxLen: 100, minLen: 1 Task title (required; validated non-empty on the frontend)
category_id integer Category ID; null means no category
note string maxLen: 500 Note (optional)

Returns → TaskItem

Full task record

NameTypeRequiredDescription
id integer Task primary key ID
user_id integer Owning user ID
category_id integer Owning category ID; null means no category
name string maxLen: 100 Task title
note string maxLen: 500 Note
done boolean Completion: false = incomplete, true = complete
created_at string Created at (ISO 8601 string)
updated_at string Last updated at (ISO 8601 string)

Errors

DB_WRITE_ERROR EX-6.1
Save failed; please retry
Source: S02.2 Step 6 INSERT failed

update_task

Update task content

Source: S02.3b Step 5 → Step 8. Updates name, category, and note; also refreshes updated_at.

Params

NameTypeRequiredDescription
task_id integer Target task ID
name string maxLen: 100, minLen: 1 Updated task title
category_id integer Updated category ID; null means no category
note string maxLen: 500 Updated note

Returns → TaskItem

Full task record

NameTypeRequiredDescription
id integer Task primary key ID
user_id integer Owning user ID
category_id integer Owning category ID; null means no category
name string maxLen: 100 Task title
note string maxLen: 500 Note
done boolean Completion: false = incomplete, true = complete
created_at string Created at (ISO 8601 string)
updated_at string Last updated at (ISO 8601 string)

Errors

TASK_NOT_FOUND EX-6.1 (edit flow)
Task not found
UPDATE affected 0 rows; task was removed (concurrent use)

update_task_status

Toggle task completion

Source: S02.3a Step 2 → Step 5. Only toggles done, separate from content updates (single responsibility).

Params

NameTypeRequiredDescription
task_id integer Target task ID
done boolean Target state: true = mark complete, false = mark incomplete

Returns

NameTypeRequiredDescription
task_id integer
done boolean

Errors

TASK_NOT_FOUND EX (concurrent)
Task not found
UPDATE affected 0 rows

delete_task

Delete task

Source: S02.3c Step 4 → Step 7. Hard delete; not recoverable. WHERE includes user_id to prevent cross-user access.

Params

NameTypeRequiredDescription
task_id integer Target task ID

Returns

NameTypeRequiredDescription
success boolean

Errors

TASK_NOT_FOUND EX-6.1
Task not found (handled silently)
Source: S02.3c Step 6 DELETE affected 0 rows; frontend ignores; state converges

Schemas

TaskItem

Full task record

object

Properties

NameTypeRequiredDescription
id integer Task primary key ID
user_id integer Owning user ID
category_id integer Owning category ID; null means no category
name string maxLen: 100 Task title
note string maxLen: 500 Note
done boolean Completion: false = incomplete, true = complete
created_at string Created at (ISO 8601 string)
updated_at string Last updated at (ISO 8601 string)