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()insrc/util/functions/activity/changesBuilder.ts, which records only status (“Job created with status …”).datetimeis defined inFIELD_LABELSand handled on update viabuildGenericChangeDescription()indescriptionUtils.ts(“Inspection rescheduled”), not on insert. - Activity pipeline: Mongo change →
src/events/bullmq/activityLinkWorker.ts→buildChangesForInsert/buildChangesArray→Activitymodel (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.ts—buildChangesForInsert()forinspectionentity type.src/util/functions/activity/descriptionUtils.ts—datetimelabeling; reuse or extend for insert copy.src/util/functions/activity/constants.ts—FIELD_LABELS,IGNORED_UPDATE_KEYS,COLLECTION_TRACKED_FIELDS.src/events/bullmq/activityLinkWorker.ts— inspection insert activity creation path.src/models/activitySchema.ts— activitychanges[]shape consumed by the UI.
Frontend
src/components/activityFeed/ActivityFeed.tsxandsrc/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
Status: Planned
Log in to comment and vote
No comments yet
Be the first to share your thoughts.