Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 3.55 KB

File metadata and controls

83 lines (58 loc) · 3.55 KB

Tasks

User-assigned work items in wf_task. Tasks are independent of workflow: target_type and target_id are optional. A task with no target is valid.

See CANONICAL_MODEL.md and COMMENTS.md for the shared loose-coupling model.

Model: wf_task

Column Type Description
id CHAR(36) Primary key
site_id VARCHAR(255) Crafter site
title VARCHAR(512) Task title
priority VARCHAR(16) high, medium, or low (default medium)
assignee_id BIGINT Assigned Studio user
assignee_username VARCHAR(255) Username snapshot
start_on DATETIME Optional start date (V011)
due_on DATETIME Optional due date
complete_b TINYINT(1) Completion flag
archived_b TINYINT(1) Archive flag
target_type VARCHAR(64) Optional link target type
target_id VARCHAR(1024) Optional link target ID
created_on DATETIME Created timestamp
modified_on DATETIME Last modified
completed_on DATETIME When marked complete

Common target types

target_type target_id UI behavior
workflow_package Package UUID Shows package title; click opens board with package expanded
content Content path Content comments context

Tasks may be created with no target (standalone in the Tasks panel).

Validation asymmetry

CommentService verifies the package exists when target_type=workflow_package. TaskService does not validate targets on create — a task may reference a non-existent package ID until enriched DTO fields are read. See CANONICAL_MODEL.md — coupling notes.

API

See API_CONTRACT.md — task/* endpoints:

  • task/list.json — list by assignee with optional target filter; pass allTasks=true (or scope=all) for all site tasks
  • task/get.json — single task by ID
  • task/create.json, task/update.json, task/complete.json, task/archive.json
  • task/open-count.json — returns { openCount, overdueCount } for toolbar badge

Task DTOs may include enriched fields when linked to a package: targetTitle, targetWorkflowId.

Notifications

TaskNotificationSupport creates in-app notifications for the assignee (not the actor) on:

  • Task created (assigned)
  • Task updated (assignee unchanged)
  • Reassignment to a new user
  • Task completed / reopened
  • Task archived / restored

Each audit-worthy task event also writes to wf_audit_log (see AUDIT_LOG.md).

UI

Tasks panel with assignee, priority, and due dates

Site calendar month view with tasks and package due dates

Widget Purpose
tasksToolbarButton / tasksPanel Tasks list (assignee-scoped) with optional calendar tab
calendarToolbarButton / calendarPanel Site calendar (day view default, today’s events); aggregates date-based items from multiple sources

The calendar uses a generic CalendarEvent model. Tasks are the first source (sourceId: task); additional sources (e.g. campaigns) can be registered in loadSiteCalendarEvents.

Tasks can also be created from a WorkflowPackage card detail dialog.

Related documents