Activity feed should show inspection date and time when a job is created

Objective

  • When a job is created (online or internal), the inspection Activity Feed / System Log should show the scheduled inspection date and time at creation—not only on a later reschedule.
  • Give ops and CS a clear audit trail of what was originally booked without opening the inspection header or Spectora changelog.

Background

  • On inspection 1008594643 (RIA), the System Log at job create (~1:32 AM) shows entries such as “job created with status confirmed” but does not include the original inspection date/time. The first explicit datetime change appears only after a later “Inspection rescheduled” entry (e.g. when staff moved the job).
  • Example log sequence at create (no scheduled time recorded):
  • System — job created with status confirmed
  • System — agreement / charge linkage updates
  • Slack context: attik-talk thread. Split from overnight scheduling investigation (ATT-1739) which covers slot-settings only.
  • Root cause (code): Inspection insert activities use buildChangesForInsert() in src/util/functions/activity/changesBuilder.ts, which records only status (“Job created with status …”). datetime is defined in FIELD_LABELS and handled on update via buildGenericChangeDescription() in descriptionUtils.ts (“Inspection rescheduled”), not on insert.
  • Activity pipeline: Mongo change → src/events/bullmq/activityLinkWorker.tsbuildChangesForInsert / buildChangesArrayActivity model (src/models/activitySchema.ts). Display: src/components/activityFeed/ActivityFeed.tsx, InspectionActivityFeed.tsx.
  • Decision needed: Whether insert should log datetime + endtime, formatted address, and/or inspector assignment in the same activity row vs. separate “scheduled for” line; timezone display should match inspection/company TZ patterns used elsewhere in the feed.

Scope

Backend

  • src/util/functions/activity/changesBuilder.tsbuildChangesForInsert() for inspection entity type.
  • src/util/functions/activity/descriptionUtils.tsdatetime labeling; reuse or extend for insert copy.
  • src/util/functions/activity/constants.tsFIELD_LABELS, IGNORED_UPDATE_KEYS, COLLECTION_TRACKED_FIELDS.
  • src/events/bullmq/activityLinkWorker.ts — inspection insert activity creation path.
  • src/models/activitySchema.ts — activity changes[] shape consumed by the UI.

Frontend

  • src/components/activityFeed/ActivityFeed.tsx and src/app/tools/inspections/[id]/components/InspectionActivityFeed.tsx — ensure new insert change fields render readably (may already support generic before/after if backend sends them).

References

  • Example inspection: 1008594643
  • Related scheduling work: ATT-1739 (overnight same-day booking — separate)
  • Slack: thread
  • Backend entry: src/util/functions/activity/changesBuilder.ts

Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
🏠

Main App

Date

9 days ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.