Contact Caregivers
Data Entity
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.
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
Columns: contact_id
idx_contact_caregivers_primary
Columns: contact_id, is_primary
idx_contact_caregivers_created_by
Columns: created_by
idx_contact_caregivers_relationship_type
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
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
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
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
When a contact record is deleted, all associated caregiver records are automatically deleted via database cascade.
relationship_description_required_for_other
When relationship_type is 'other', the relationship_description field should be provided to clarify the nature of the relationship.
sensitive_data_screen_reader_warning
Caregiver phone numbers and addresses are sensitive fields that trigger a screen reader warning before readout, consistent with the sensitive field readout warning feature.