Show “requested inspector” star when logged-in inspector is in `_inspectorRequestedIds`

Context

Web tools already flag when the client requested a specific inspector using inspection field _inspectorRequestedIds (array of inspector ids). Example: toolsv2 calendar uses event._inspectorRequestedIds?.includes(employeeId) and shows a small star badge (see CalendarEventWrapper.tsx — amber border, star icon, tooltip “Requested”).

Backend model: attik-backend inspectionSchema_inspectorRequestedIds: [{ type: String, ref: 'inspector' }] (alongside _inspectorId).

Problem

Mobile does not surface this signal. InspectionPopulatedWithServices in inspector-app/types/index.ts does not yet include _inspectorRequestedIds, and schedule/detail UI has no star.

Scope

  1. API / types
  • Confirm GET inspection/:id (used by useInspectionDetails) and schedule payloads include _inspectorRequestedIds for inspections. If missing, coordinate minimal backend/mobile API change so the app receives the array.
  • Add _inspectorRequestedIds?: string[] (or correct shape) to the inspection type used on mobile.
  1. Logic
  • Use logged-in inspector id from useAuth() (inspectorId).
  • isRequested = inspection._inspectorRequestedIds?.includes(inspectorId) ?? false.
  1. UI (parity with web)
  • Schedule: components/schedule/ScheduleCard.tsx — for item.type === 'inspection', show a small star badge when isRequested (e.g. MaterialIcons star or grade, warning/amber styling to mirror web).
  • Inspection detail header: app/(app)/inspection/[id].tsx — add the same indicator in the header badge area (badgesRow near status/job type) when isRequested.

Acceptance criteria

  • [ ] If current user’s inspector id is in _inspectorRequestedIds, star (or equivalent) appears on schedule card and inspection detail header.
  • [ ] If field absent or user not in list, no indicator.
  • [ ] Works with theme light/dark.

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board
🏠

Main App

Date

2 months ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.