Skip to content

Admin "what this form submission changed" page - #2303

Open
maebeale wants to merge 5 commits into
mainfrom
maebeale/form-affiliations-orgs-sectors
Open

Admin "what this form submission changed" page#2303
maebeale wants to merge 5 commits into
mainfrom
maebeale/form-affiliations-orgs-sectors

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 one read-model PORO + a small admin page and two links; logic is contained and spec-covered

Why

Gives admins a per-submission audit of everything a registration's smart-field answers changed across records — the consumer side of the change-tracking foundation.

What

  • FormSubmissionChanges — reads the Ahoy lifecycle events stamped with a submission id, groups them by the record they touched (tags attributed to their owner), and labels each with what actually happened: Added / Removed / Replaced / Filled.
  • Admin-only page at /form_submissions/:id/changes (changes?admin?), with an outcome chip per row and a return_to-aware eyebrow.
  • Links in from the linked-organizations page and any form-submission view (both admin-gated).

Depends on

Tests

  • form_submission_changes_spec — grouping, owner attribution, sector/age name resolution, replaced vs. filled, bookkeeping-record filtering, submission scoping.
  • form_submissions_spec — admin renders the grouped changes + empty state; non-admin redirected.
  • page_bg_class_alignment_spec — new view registered.

Reconstruct everything a submission's smart-field answers changed across
records — read back from the stamped Ahoy lifecycle events — grouped by
record and labelled with what actually happened to each (added, removed,
replaced, or filled a blank). Reachable from the linked-organizations page
and any form-submission view, both admin-gated.

The event stamping this reads is produced separately (PR #2301); the page
and its read model are self-contained and tested against synthetic events.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale marked this pull request as ready for review August 21, 2026 15:48
maebeale and others added 4 commits August 21, 2026 11:50
The per-event registrant submissions view lists a person's submissions; add
the same admin-gated "what this submission changed" jump to each, and teach
the changes page's eyebrow to return there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"Changed" now means a submission overwrote a value that already existed —
the risky case worth reviewing. Creating records, adding tags, and filling
blanks are a new submission's own data, not edits, so they no longer count.
The link only appears when there's at least one overwrite and shows how many.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"Changed" means a submission edited a record that already existed — a value
replaced or a blank filled (both from an update event). New records and added
tags are still excluded as new data. This lets linking an org that wasn't a
clean match raise the count, since the fill lands on the pre-existing org.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Give Maria Johnson (an existing dev-seed person) a registration that arrived
after she was on record and edited six details already there — profile,
address, phone, and her org's website/type — recorded as stamped Ahoy events
so the "what this submission changed" page has a realistic worked example.

Also give a few common columns friendlier labels on that page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant