Notes
Data Entity
Description
Lightweight free-text notes captured by peer mentors and coordinators, optionally linked to a contact, used to record observations and follow-up reminders outside of formal activity reports.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Unique identifier for the note | PKrequiredunique |
user_id |
uuid |
Author of the note (peer mentor or coordinator) | required |
contact_id |
uuid |
Optional contact the note is associated with | - |
organization_id |
uuid |
Tenant scope for multi-tenant isolation | required |
title |
string |
Short note title or subject | - |
body |
text |
Encrypted note body content (AES-256-GCM at application layer) | required |
is_pinned |
boolean |
Whether the note is pinned to the top of the author's list | required |
is_sensitive |
boolean |
Marks the note as containing sensitive content triggering screen reader readout warning | required |
tags |
json |
Free-form tags array for categorisation and search | - |
visibility |
enum |
Who can see the note | required |
created_at |
datetime |
Timestamp of note creation | required |
updated_at |
datetime |
Timestamp of last modification | required |
deleted_at |
datetime |
Soft-delete timestamp; null for active notes | - |
sync_status |
enum |
Offline sync state for outbox reconciliation | required |
client_generated_id |
string |
Client-side UUID used for ID mapping when note is created offline | unique |
Database Indexes
idx_notes_user_id
Columns: user_id
idx_notes_contact_id
Columns: contact_id
idx_notes_org_user_updated
Columns: organization_id, user_id, updated_at
idx_notes_client_generated_id
Columns: client_generated_id
idx_notes_deleted_at
Columns: deleted_at
Validation Rules
body_required_non_empty
error
Validation failed
body_max_length
error
Validation failed
title_length_limit
error
Validation failed
contact_id_must_exist
error
Validation failed
visibility_enum_check
error
Validation failed
encryption_required
error
Validation failed
Business Rules
author_scoped_visibility
Private notes are only visible to the authoring user; coordinator_shared visibility surfaces them to coordinators of the same organization
tenant_isolation
Notes are strictly scoped by organization_id; cross-tenant reads are rejected
soft_delete_only
Notes are soft-deleted by setting deleted_at to preserve audit trail; hard-delete reserved for retention sweeps
sensitive_readout_warning
When is_sensitive=true, the screen reader prompts confirmation before reading note body aloud
offline_outbox_capture
Notes created or modified offline are queued in the sync outbox with a client_generated_id and reconciled on reconnect
audit_logging
Create, update, and delete operations on notes emit audit log entries scoped to the organization