Note
Data Entity
Description
Personal notes created by peer mentors and coordinators, optionally linked to a specific contact. Supports free-text content for informal observations, follow-up reminders, and context that doesn't fit structured activity forms.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Primary key | PKrequiredunique |
user_id |
uuid |
Author of the note — FK to users | required |
contact_id |
uuid |
Optional contact this note is about — FK to contacts | - |
title |
string |
Short title or heading for the note | - |
content |
text |
Full note body in plain text or simple markdown | required |
is_pinned |
boolean |
Whether the note is pinned to the top of the list | required |
organization_id |
uuid |
Tenant scoping — FK to organizations | required |
created_at |
datetime |
Timestamp when note was created | required |
updated_at |
datetime |
Timestamp of last edit | required |
deleted_at |
datetime |
Soft-delete timestamp; null means active | - |
Database Indexes
idx_notes_user_id
Columns: user_id
idx_notes_contact_id
Columns: contact_id
idx_notes_organization_id
Columns: organization_id
idx_notes_user_created
Columns: user_id, created_at
idx_notes_deleted_at
Columns: deleted_at
Validation Rules
content_not_empty
error
Validation failed
title_max_length
error
Validation failed
valid_contact_ref
error
Validation failed
user_must_exist
error
Validation failed
Business Rules
owner_only_access
A note is private to the user who created it. Other users within the same organization cannot read or modify it.
contact_org_match
If contact_id is set, the referenced contact must belong to the same organization as the note author.
soft_delete_only
Notes are never hard-deleted; deleted_at is set instead so the record is excluded from list queries but retained for audit.
offline_sync_eligible
Notes are included in the offline mutation outbox so peer mentors can create and edit notes without connectivity, with sync on reconnect.