core PK: id 9 required 1 unique

Description

A structured conversation prompt card used by peer mentors during support sessions. Cards provide guided topics and questions to facilitate meaningful conversations with contacts, particularly useful for peer mentors with lower digital skills or those needing conversational scaffolding.

11
Attributes
4
Indexes
6
Validation Rules
6
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key
PKrequiredunique
organization_id uuid Organization that owns this card. NULL means platform-wide default card available to all organizations.
-
title string Short display title of the card shown in the toolbox list
required
body text Main conversation prompt or question text displayed on the card face
required
category enum Thematic grouping used for filtering in the toolbox
required
sort_order integer Display order within category. Lower numbers appear first.
required
is_active boolean Whether the card is visible in the toolbox. Inactive cards are hidden without deletion.
required
is_default boolean Platform-provided default card (organization_id IS NULL). Default cards cannot be deleted, only deactivated per org via org-level overrides.
required
tags json Optional array of string tags for search and filtering (e.g. ["grief", "family", "health"])
-
created_at datetime Record creation timestamp
required
updated_at datetime Last modification timestamp
required

Database Indexes

idx_talking_cards_org_id
btree

Columns: organization_id

idx_talking_cards_category
btree

Columns: category

idx_talking_cards_org_active
btree

Columns: organization_id, is_active

idx_talking_cards_org_category_sort
btree

Columns: organization_id, category, sort_order

Validation Rules

title_required_non_empty error

Validation failed

body_required_non_empty error

Validation failed

category_valid_enum error

Validation failed

sort_order_non_negative error

Validation failed

tags_valid_json_array error

Validation failed

org_id_exists error

Validation failed

Business Rules

default_cards_org_null
on_delete

Platform default cards have organization_id = NULL and are visible to all organizations unless explicitly deactivated via an org-level override mechanism. They cannot be hard-deleted.

Enforced by: TalkingCardsRepository
org_cards_scoped
always

Cards with an organization_id are only visible to users belonging to that organization. Queries must always filter by organization_id IS NULL OR organization_id = :current_org_id.

inactive_cards_hidden
always

Cards with is_active = false must not appear in the toolbox list. Deactivation is preferred over deletion to preserve audit history.

module_toggle_gate
always

The conversation-tools module must be enabled for the organization before any talking cards are served. If the module is disabled, all card queries return empty.

Enforced by: TalkingCardsScreen

Storage Configuration

Storage Type
lookup_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage