Skip to content

Edit a donor workflow

nmpaul17 edited this page May 5, 2025 · 3 revisions

πŸ“ Workflow: Editing an Existing Donor

Goal: To modify the contact information or other editable details associated with an existing donor record.

User Role(s): Main Admin, Admin, Editor
Users with these roles should be able to edit donor records. Viewer roles should not have access to this functionality.


πŸ“„ Pages Involved

  • /donors β€” Donors List page
  • "Edit Donor" Modal β€” launched from the /donors page

🧭 Workflow Steps

  1. Navigate to Donors:
    User navigates to the Donors tab, loading the /donors page.

  2. Locate Donor:
    User finds the donor record they wish to edit in the table.

  3. Click Edit:
    User clicks the Edit button next to the desired donor.

  4. Load Edit Modal:
    Modal opens with donor's existing contact and note fields pre-filled.

  5. Modify Donor Details:
    Editable fields include:

    • firstName, lastName
    • organizationName, email, phoneNumber
    • address, contactNotes
    • lastContacted, donorNotes
  6. Submit Update:
    User clicks Update or Save Changes.

  7. Data Processing:

    • Client-side validation ensures proper input formatting (e.g., valid email)
    • updateDonor in useDonors sends a PUT request to /api/donors/[id]
    • Backend updates contactInfo and editable donor fields
    • lastEditorID is set automatically based on the user
  8. On Success:

    • Modal closes
    • Donors list refreshes
    • Optional success notification may appear
  9. On Failure:

    • Validation or backend error (e.g., duplicate email) returns an error
    • Error message appears inside modal
    • User remains in modal to fix and resubmit

πŸ—‚ Key Data Fields Modified

Editable Fields:

  • firstName, lastName, organizationName
  • email, phoneNumber, address, contactNotes
  • lastContacted, donorNotes

Read-Only/System Fields:

  • donorID, contactInfoID
  • firstDonationDate, lastDonationDate
  • numDonations, lifetimeDonations

πŸ“ Notes

  • lastEditorID is updated automatically on the backend
  • Donation-related aggregates (lifetimeDonations, numDonations, lastDonationDate) are managed automatically when donations change
  • Updating contact information may impact other entities using the same contactInfoID (though current API logic scopes changes to donor edits only)

Clone this wiki locally