core PK: id 11 required 1 unique

Description

Stores caregiver and next-of-kin relationships for contacts in the peer mentor program. Each contact can have one or more registered caregivers with contact details and relationship metadata, enabling peer mentors and coordinators to reach family members or guardians when needed.

17
Attributes
4
Indexes
7
Validation Rules
16
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Unique identifier for the caregiver record
PKrequiredunique
contact_id uuid Foreign key referencing the contact this caregiver is associated with
required
first_name string First name of the caregiver
required
last_name string Last name of the caregiver
required
relationship_type enum Type of relationship between the caregiver and the contact
required
relationship_description string Free-text clarification when relationship_type is 'other' or additional context is needed
-
phone string Primary phone number of the caregiver
-
email string Email address of the caregiver
-
address text Postal address of the caregiver, if different from the contact
-
is_primary boolean Whether this is the primary caregiver or next-of-kin for the contact
required
is_emergency_contact boolean Whether this caregiver should be contacted in emergencies
required
notes text Free-text notes about the caregiver relationship, availability, or special considerations
-
lives_with_contact boolean Whether the caregiver lives at the same address as the contact
required
created_by uuid User ID of the peer mentor or coordinator who created this record
required
updated_by uuid User ID of the person who last updated this record
-
created_at datetime Timestamp when the caregiver record was created
required
updated_at datetime Timestamp when the caregiver record was last updated
required

Database Indexes

idx_contact_caregivers_contact_id
btree

Columns: contact_id

idx_contact_caregivers_primary
btree

Columns: contact_id, is_primary

idx_contact_caregivers_created_by
btree

Columns: created_by

idx_contact_caregivers_relationship_type
btree

Columns: relationship_type

Validation Rules

valid_contact_reference error

Validation failed

valid_phone_format error

Validation failed

valid_email_format error

Validation failed

name_not_empty error

Validation failed

valid_relationship_type_enum error

Validation failed

valid_created_by_reference error

Validation failed

name_max_length error

Validation failed

Business Rules

single_primary_caregiver_per_contact
on_create

Each contact may have at most one caregiver marked as is_primary=true. Setting a new primary automatically unsets the previous primary caregiver for that contact.

at_least_one_contact_method
on_create

A caregiver record must have at least one contact method (phone or email) to be useful for emergency or coordination purposes.

role_based_edit_access
always

Only the assigned peer mentor for the contact or a coordinator within the same local association may create, update, or delete caregiver records.

cascade_delete_on_contact_removal
on_delete

When a contact record is deleted, all associated caregiver records are automatically deleted via database cascade.

Enforced by: Caregiver Store
relationship_description_required_for_other
on_create

When relationship_type is 'other', the relationship_description field should be provided to clarify the nature of the relationship.

sensitive_data_screen_reader_warning
always

Caregiver phone numbers and addresses are sensitive fields that trigger a screen reader warning before readout, consistent with the sensitive field readout warning feature.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage