# Update User Profile

## User Story

As a user with the appropriate role, I want to update another user's profile information, so that I can keep user records accurate and up to date.

## Story Diagram

```mermaid
flowchart TD
    A[Open User Detail] --> B[Click Edit]
    B --> C[Modify name or email]
    C --> D[Submit]
    D --> E{Validation}
    E -- Email already exists --> F[Show duplicate email error]
    E -- Required field missing --> G[Show validation error]
    E -- Valid --> H[Profile updated]
```

## Scenario Patterns

- Update another user's name
- Update another user's email address
- Duplicate email address is rejected with an error
- Submission with missing required fields is blocked by validation

## Test Cases

- Change a user's name and submit; verify the updated name is reflected on the detail page
- Change a user's email to a valid unique address and submit; verify the updated email is shown
- Change a user's email to one already assigned to another user; verify an error is shown and no change is saved
- Clear the name field and submit; verify a validation error is shown

## Screens

- [user-detail](../../../screen/user-detail.md)
- [user-edit-form](../../../screen/user-edit-form.md)

## Resolvers

- [updateUserProfile](../../../resolver/updateUserProfile.md)
