core PK: id 10 required 1 unique

Description

Conversation-starter cards designed to help peer mentors facilitate meaningful dialogue during support sessions. Each card contains a topic, prompt text, and optional guidance notes, organized by category for easy filtering and random selection.

12
Attributes
5
Indexes
5
Validation Rules
9
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Unique identifier for the talking card
PKrequiredunique
category string Topic category grouping for filtering and browsing (e.g., health, social, practical, emotional, getting-started)
required
topic string Specific topic label within the category, displayed as a card heading
required
prompt_text text The conversation-starter question or prompt displayed on the card face
required
guidance_notes text Optional facilitator guidance for the peer mentor on how to use this prompt effectively
-
language string BCP 47 locale code for the card content (nb for Norwegian Bokmål, en for English, se for Northern Sami)
required
display_order integer Sort order within the category for deterministic default ordering
required
is_active boolean Whether the card is currently available for display; inactive cards are hidden from the deck
required
organization_id uuid Optional organization scope; null means the card is available to all organizations (global/bundled content)
-
content_version integer Monotonically increasing version number for sync conflict resolution; incremented on every update
required
created_at datetime Timestamp when the card was created
required
updated_at datetime Timestamp of the last modification, used by mobile sync to detect changes
required

Database Indexes

idx_talking_cards_category
btree

Columns: category

idx_talking_cards_language
btree

Columns: language

idx_talking_cards_org_active
btree

Columns: organization_id, is_active

idx_talking_cards_category_order
btree

Columns: category, display_order

idx_talking_cards_updated_at
btree

Columns: updated_at

Validation Rules

prompt_text_not_empty error

Validation failed

valid_language_code error

Validation failed

category_lowercase_kebab warning

Validation failed

organization_id_exists error

Validation failed

display_order_non_negative error

Validation failed

Business Rules

global_cards_immutable_by_org
on_update

Cards with null organization_id are global bundled content managed only by the platform; organization admins cannot modify or delete them

Enforced by: Cards Content Service
category_requires_at_least_one_card
on_update

A category should not exist with zero active cards; warn when deactivating the last card in a category

Enforced by: Cards Content Service
org_scoped_visibility
always

Users see global cards (organization_id IS NULL) plus cards scoped to their own organization; cards from other organizations are never visible

content_version_increment
on_update

Every update to a card must increment content_version by exactly one to support mobile sync conflict detection

Enforced by: Cards Content Service
shuffle_excludes_inactive
always

Shuffle and random selection operations must only include cards where is_active is true

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage