Contact Note
Data Entity
Description
Structured notes written by peer mentors or coordinators about a specific contact, capturing observations, follow-up needs, and interaction context separate from formal activity registrations.
Data Structure
| Name | Type | Description | Constraints |
|---|---|---|---|
id |
uuid |
Primary key | PKrequiredunique |
contact_id |
uuid |
Foreign key to the contact this note belongs to | required |
author_id |
uuid |
Foreign key to the user (peer mentor or coordinator) who wrote the note | required |
organization_id |
uuid |
Tenant scoping — the organization this note belongs to | required |
content |
text |
The body of the note, free-text written by the author | required |
note_type |
enum |
Category of the note to support filtering and display | required |
is_private |
boolean |
Whether the note is visible only to the author or also to coordinators | required |
created_at |
datetime |
Timestamp when the note was created | required |
updated_at |
datetime |
Timestamp of last edit | required |
deleted_at |
datetime |
Soft delete timestamp; null means active | - |
linked_activity_id |
uuid |
Optional reference to an activity this note relates to | - |
Database Indexes
idx_contact_notes_contact_id
Columns: contact_id
idx_contact_notes_author_id
Columns: author_id
idx_contact_notes_organization_id
Columns: organization_id
idx_contact_notes_contact_created
Columns: contact_id, created_at
idx_contact_notes_deleted_at
Columns: deleted_at
Validation Rules
content_not_empty
error
Validation failed
content_max_length
error
Validation failed
note_type_valid_enum
error
Validation failed
contact_id_exists
error
Validation failed
updated_at_after_created_at
error
Validation failed
Business Rules
author_must_belong_to_same_org
The note author must be a member of the same organization as the contact being noted
private_notes_visible_to_author_only
Notes marked is_private=true are only returned when queried by the author; coordinators cannot see them
coordinator_can_view_non_private_notes
Coordinators can read all non-private notes for contacts in their local association
soft_delete_only
Notes are never hard-deleted; deleted_at is set instead to preserve audit trail
linked_activity_must_belong_to_same_contact
If linked_activity_id is set, the referenced activity must have the same contact_id