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
- API / types
- Confirm
GET inspection/:id(used byuseInspectionDetails) and schedule payloads include_inspectorRequestedIdsfor 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.
- Logic
- Use logged-in inspector id from
useAuth()(inspectorId). isRequested = inspection._inspectorRequestedIds?.includes(inspectorId) ?? false.
- UI (parity with web)
- Schedule:
components/schedule/ScheduleCard.tsx— foritem.type === 'inspection', show a small star badge whenisRequested(e.g.MaterialIconsstarorgrade, warning/amber styling to mirror web). - Inspection detail header:
app/(app)/inspection/[id].tsx— add the same indicator in the header badge area (badgesRownear status/job type) whenisRequested.
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.
Status: Completed
Log in to comment and vote
No comments yet
Be the first to share your thoughts.