Skip to main content

Task Model

What is a task?​

A task represents one role's assignment to work on an episode. It links a role to a specific episode, with an optional user assigned.

Tasks are created automatically when roles are added in the Episode Creators Modal. They are not created manually by end users.

Fields​

FieldTypeDescription
idUUIDUnique identifier
titlestringTask name (typically the role name)
descriptionstring?Optional description
urlstring?Optional reference link
statusenumto-do / in-progress / blocked / done
roleIdUUID?The role this task is for
userIdUUID?The assigned user (nullable — task can exist without a user)

Statuses​

StatusMeaning
to-doNot started
in-progressActively being worked on
blockedWaiting on something external
doneCompleted

Episode linking​

Tasks are linked to episodes via the episode_tasks join table:

tasks ──── episode_tasks ──── episodes
(order: int)

The order field determines which stage the task belongs to in the episode's workflow. Stage 0 = first stage, stage 1 = second stage, etc.

When a task is deleted, its episode_tasks rows are removed automatically via ON DELETE CASCADE.

API endpoints​

MethodEndpointDescription
GET/api/tasks?userId=<id>Get tasks for a specific user
GET/api/tasks/allGet all tasks (Admin) — supports filter=today|monthly|range
POST/api/tasksCreate a task
PATCH/api/tasks/:idUpdate task's assigned user (pass userId: null to clear)
PATCH/api/tasks/:id/statusUpdate task status
POST/api/tasks/:id/episodesLink task to an episode at a given order/stage
DELETE/api/tasks/:id/episodes/:episodeIdUnlink task from an episode
DELETE/api/tasks/:idDelete task entirely

My Tasks page​

Users can view their own tasks (filtered by userId) on the My Tasks page. Admins can see all tasks with date filtering (today, this month, or a custom date range).