Add payment activity log on workorders

Objective

  • Give CSRs a clear payment activity log on workorders: what happened on each payment, including status changes and payment attempts, without digging through unrelated activity or provider dashboards.
  • Reduce time spent reconciling card/ACH/PAC/manual payments, refunds, and failed tries on an inspection.
  • Decision needed: Whether this is a dedicated payment timeline (e.g. on Services & Payments) vs a filtered view of the existing Activity feed vs both.

Background

  • Product request (Slack): users want an activity log of all actions and status updates for payments and payment attempts on a workorder.
  • This is a feature / visibility gap, not a report that basic payment logging is fully broken.
  • What exists today:
  • Staff Activity feed on the workorder (InspectionActivityFeedActivityFeed on /tools/inspections/[id]) already receives some payment events.
  • paymentStream.ts enqueues activity for payment insert/update/delete; activityLinkWorker.ts attaches them to the parent inspection; paymentHandlers.ts formats descriptions.
  • Client portal PaymentHistoryList (/client/job/[slug]/pay) lists payment rows (amount, date, type, status) — not a step-by-step attempt audit trail.
  • What is missing or incomplete today:
  • No payment-specific timeline on the workorder; payment lines are mixed with notes, SMS, agreements, charges, etc.
  • Activity handlers only emit meaningful lines for payment insert/delete and top-level status / amount updates (paymentHandlers.ts).
  • Updates that only change nested provider fields (e.g. PAC isn.orderStatus / statusHistory, Guardian statusHistory) often produce no activity row because buildChangesFromPaymentEvents ignores those fields and the worker skips “no meaningful changes.”
  • Failed attempts that never create or update a Payment document are not represented anywhere in activity.
  • Decision needed: Definition of “payment attempt” (failed card/ACH before success, webhook steps, PAC FlexFund statuses, manual entry, refund/void/queued refund, etc.).

Scope

Backend — Activity / payments today

  • Payment change stream: attik-backend/src/events/streamHandlers/paymentStream.tsenqueueActivityLinkFromChange in attik-backend/src/util/functions/activity/enqueueActivityLinkFromChange.ts.
  • Merge and persist: attik-backend/src/events/bullmq/activityLinkWorker.ts (payment events roll up to inspection-{id}; Activity created with _inspectionId).
  • Payment change text: attik-backend/src/util/functions/activity/paymentHandlers.ts.
  • Activity system overview: attik-backend/src/util/functions/activity/ACTIVITY_SYSTEM_README.md.
  • Payment model (status, type, nested isn / guardian / refunds): attik-backend/src/models/paymentSchema.ts; PAC webhook history in attik-backend/src/routes/webhooks/flexfund/flexfundWebhook.ts.
  • Decision needed: Extend activity handlers for more payment fields vs new PaymentActivity (or similar) collection and API vs hybrid.

Frontend — Workorder

  • Activity feed tab: attik-frontend/src/app/tools/inspections/[id]/components/InspectionActivityFeed.tsx, attik-frontend/src/components/activityFeed/ActivityFeed.tsx.
  • Payments UI (no dedicated attempt log today): attik-frontend/src/app/tools/inspections/[id]/components/ServicesPayments.tsx.
  • Workorder shell / tabs: InspectionWorkorderShell.tsx, page.tsx (activityFeedContent).
  • Decision needed: Primary surface — new section under Services & Payments, Activity feed filter (“Payments only”), or both.

Frontend — Client portal (optional)

  • attik-frontend/src/app/client/job/[slug]/pay/PaymentHistoryList.tsx — summary list only; decision needed whether client-facing attempt log is in scope.

Out of scope unless expanded

  • QuickBooks sync, settlement batches, company billing subscription payments.
  • Mobile app.

References

  • Slack request: https://attik-talk.slack.com/archives/C0AQFEHRWG6/p1779795516590509
  • Activity: attik-backend/src/util/functions/activity/paymentHandlers.ts, attik-backend/src/events/bullmq/activityLinkWorker.ts
  • Payment stream: attik-backend/src/events/streamHandlers/paymentStream.ts
  • Staff UI: attik-frontend/src/app/tools/inspections/[id]/components/InspectionActivityFeed.tsx

Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
🏠

Main App

Date

5 days ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.