CRITICAL story-contact-detail-edit-screen-peer-mentor-002 5 pts
5
Story Points
Critical
Priority
Contact Detail & Edit Screen
Feature

User Story

As a Peer Mentor (Likeperson)
I want to edit a contact's profile information including name, phone number, address, and notes, with real-time validation feedback
So that I can keep contact records accurate and up-to-date without requiring IT support or administrator intervention

Audience Summaries

Accurate, up-to-date contact information is the foundation of effective peer mentor coordination. Today, coordinators must route every contact update through an administrator — introducing delays, transcription errors, and friction that directly degrades assignment matching quality and Bufdir reporting accuracy. This story delivers self-service contact editing to coordinators, eliminating that bottleneck. The business impact is immediate: faster response to real-world changes like a mentor's return from illness, reduced administrative overhead across all four partner organizations, improved data quality for compliance reporting, and stronger coordinator autonomy that supports retention.

The encrypted-field confirmation flow also ensures legal obligations under Norwegian personal data regulation are met without sacrificing usability. For organizations like NHF and Barnekreftforeningen where coordinators manage large mentor pools, the cumulative time savings and error reduction represent a significant operational efficiency gain that compounds across every reporting cycle.

This story is classified as critical priority and covers a multi-component edit flow: navigation from contact detail to edit screen, real-time inline validation, a contact edit service for transactional data persistence, a separate confirmation flow for encrypted sensitive fields, and a discard-changes guard dialog. Effort is moderate-to-high given the six acceptance criteria spanning pre-population, field-level validation, save persistence, encrypted-field gating, and back-navigation safety. Dependencies include the contact detail screen story (story-contact-detail-edit-screen-coordinator-1), so sequencing must be confirmed before sprint planning. Stakeholder sign-off is needed on the UX copy for plain-language validation errors and the sensitive data confirmation dialog.

UAT should involve coordinators from at least two partner organizations to validate real-world phone number formats and field requirements. Rollout risk is low if the edit service is transactional and the validation library is well-tested; regression risk on the detail screen navigation flow should be explicitly covered in QA.

Implementation requires four main system touchpoints. First, a new edit contact screen with a form layout that pre-populates all fields from the existing contact data model on mount. Second, the contact form validator must run real-time (onChange) validation for Norwegian phone number format (E.164 or local format), email format, and required-field presence — with field-level error state surfaced as inline messages below each input. Third, the contact edit service must wrap the update in a transaction guaranteeing data integrity before confirming success; on success, navigate back to the detail screen and trigger a toast notification.

Fourth, encrypted sensitive fields require a separate confirmation dialog flow — likely a modal with explicit acknowledgement — before the field becomes editable; this gating logic should be driven by a field metadata flag rather than hardcoded field names. Edge cases include concurrent edit detection if multiple devices can edit the same contact, and ensuring the discard-changes dialog fires reliably on back-navigation regardless of gesture vs button. Unit tests should cover each validation rule; integration tests should cover the full save and cancel flows.

Acceptance Criteria

  • Given I am on the contact detail screen, When I tap the edit button, Then the edit contact screen opens with all current field values pre-populated
  • Given I am on the edit contact screen, When I clear a required field and tap outside it, Then a plain-language error message appears beneath that field
  • Given I am editing a phone number field, When I enter an invalid Norwegian phone number format, Then the field shows an inline validation error before I attempt to save
  • Given I have made valid changes on the edit screen, When I tap the Save button, Then the contact edit service persists the changes and I am navigated back to the detail screen with a success confirmation
  • Given I am on the edit contact screen, When I attempt to edit an encrypted sensitive field, Then a confirmation dialog appears requiring me to acknowledge I am viewing and modifying sensitive personal data
  • Given I am editing a contact, When I tap the back button without saving, Then a discard changes confirmation dialog is shown before navigation proceeds

Business Value

Keeping contact data accurate is critical for correct assignment matching, Bufdir reporting, and legal compliance. Currently coordinators must contact administrators to update basic contact information, creating delays and errors. Enabling direct editing reduces administrative overhead, improves data quality, and ensures coordinators can respond immediately when a peer mentor's contact details change — for example when updating a return date after a period of illness.