core PK: id 8 required 1 unique

Description

Task items created within the context of a mentor program workshop, enabling coordinators and facilitators to track action items, assignments, and follow-up tasks for workshop participants.

13
Attributes
4
Indexes
4
Validation Rules
9
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key
PKrequiredunique
workshop_id uuid Foreign key to mentor_workshops
required
title string Short title or label for the to-do item
required
description text Optional detailed description or notes for the to-do item
-
is_completed boolean Whether the to-do item has been marked as done
required
completed_at datetime Timestamp when the item was marked completed
-
completed_by_user_id uuid User who marked the item completed
-
assigned_to_user_id uuid User (participant or facilitator) responsible for this to-do
-
due_date datetime Optional deadline for completing this to-do item
-
sort_order integer Display order of the to-do item within its workshop list
required
created_by_user_id uuid User who created this to-do item
required
created_at datetime Record creation timestamp
required
updated_at datetime Record last-updated timestamp
required

Database Indexes

idx_workshop_todos_workshop_id
btree

Columns: workshop_id

idx_workshop_todos_workshop_sort
btree

Columns: workshop_id, sort_order

idx_workshop_todos_assigned_user
btree

Columns: assigned_to_user_id

idx_workshop_todos_is_completed
btree

Columns: workshop_id, is_completed

Validation Rules

title_required error

Validation failed

due_date_not_in_past_on_create warning

Validation failed

sort_order_non_negative error

Validation failed

assigned_user_belongs_to_workshop warning

Validation failed

Business Rules

workshop_must_exist
on_create

A to-do item can only be created for an existing mentor workshop; the workshop_id must reference a valid mentor_workshops record.

Enforced by: TodoListService
completion_timestamp_on_done
on_update

When is_completed is set to true, completed_at must be set to the current timestamp and completed_by_user_id must be recorded.

Enforced by: TodoListService
clear_completion_on_reopen
on_update

When is_completed is set back to false, completed_at and completed_by_user_id must be cleared to null.

Enforced by: TodoListService
only_workshop_participants_can_complete
on_update

Only users who are participants or facilitators of the associated workshop (or coordinators of the owning organization) may mark a to-do item as completed.

Enforced by: TodoListService

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage