Skip to content

Build the person + per-record activity timeline on PaperTrail #2362

Description

@maebeale

🤖 From Claude:

Background

PR #2245 makes PaperTrail the source of record-change activity and adds an indexed versions.subject_person_id populated across the registration cluster, money/membership models, and the person cluster (Person/Affiliation/Address/ContactMethod/Asset; Organization/Discount tracked but unscoped). It does not build the timeline itself — that's this issue.

Goal

Build the real activity timeline as a chronological interleave of three sources, each doing what it's best at:

  • PaperTrail — record changes (create/update/destroy, incl. deleted records)
  • Notifications — communications, read directly (not versioned)
  • Ahoy — visits + page/views (PaperTrail can't produce these)

Scope

  1. Person timeline — single indexed sweep PaperTrail::Version.where(subject_person_id: person.id).order(:created_at), merged with the person's Notifications and Ahoy visit/view events. Extend Analytics::PersonTimeline (already interleaves sources).
  2. Per-record timeline — a record's own versions plus its children's (query by item_type/item_id for the record + its dependent children). E.g. a registration timeline = the registration + its attendance entries, checklist completions, org links, CE regs, allocations, comments.
  3. Deleted-record viewer — versions persist after deletion but nothing surfaces them today (the Change Log partial reads a live record.versions). Add a view that queries the versions table directly.
  4. Presenter — render each version as a human line (event + changed fields + whodunnit); derive semantic labels where useful (see [Parked] Restore semantic User auth events on the PaperTrail timeline #2249 for User auth labels).

Then (separate cleanup, after this lands)

  • Retire the redundant Ahoy lifecycle/mutation tracking (AhoyTrackable) once PaperTrail fully covers it. Keep Ahoy's visit/view tracking — that's the piece only Ahoy does.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions