Post-confirmation requested-inspector toggle: preview cost/duration and accept/decline (parity with required-info modifiers)

Objective

  • After an order is confirmed, when someone marks an inspector as requested (or removes that request), show the same kind of price/duration impact experience used for required info changes that drive service modifiers: preview the delta and let the user accept (apply inspection + charge updates) or decline (keep prior state).
  • Align behavior so a requested inspector modifier does not look like a silent metadata-only change when it should affect pricing—similar to the required-info save flow (no surprise line changes without confirmation).
  • Parity for unconfirmed jobs is a product decision if teams want the same modal there.

Background

  • Today, the work order InspectorBox toggles only PATCH _inspectorRequestedIds on the inspection; charges are not recalculated automatically unless someone edits charges manually.
  • Requested-inspector pricing uses basis requested in modifierPriceAdjFn (the third argument must be true for that fee to apply). Scheduling and quote flows pass that flag; the work-order request toggle does not run that pricing pipeline.
  • recalculateChargesForRequiredInfo calls modifierPriceAdjFn with requested hard-coded to false, so that path also misses requested-inspector modifiers.
  • Required-info edits already use useWorkorderPricingSave, WorkorderPriceSavePlan, and related UI to preview and optionally apply charge updates—that interaction pattern is what teams want mirrored.

Scope

Frontend (attik-frontend)

  • Inspector request/remove handlers live in src/components/ui/InspectorBox.tsx, used from src/app/tools/inspections/[id]/components/WorkorderPage.tsx alongside useWorkorderPricingSave and required-info flows (RequiredInfoSection.tsx, workorderPriceSavePlan.ts).
  • Pricing helpers: src/util/functions/data/modifierPriceAdjFn.ts, src/util/functions/schedulingHelpers/recalculateChargesForRequiredInfo.ts, calculateServicePrices.ts.

Backend (attik-backend)

  • Inspection PATCH and inspection shape—including _inspectorRequestedIds and lock-related fields—live in src/routes/inspection.ts and src/models/inspectionSchema.ts. Confirm whether server-side validation or hooks should participate when charges change with requested inspectors.

References

  • attik-frontend/src/components/ui/InspectorBox.tsx
  • attik-frontend/src/util/functions/data/modifierPriceAdjFn.ts
  • attik-frontend/src/util/functions/schedulingHelpers/recalculateChargesForRequiredInfo.ts
  • attik-frontend/src/app/tools/inspections/[id]/hooks/useWorkorderPricingSave.ts
  • attik-frontend/src/app/tools/inspections/[id]/components/workorderPriceSavePlan.ts
  • attik-backend/src/routes/inspection.ts

Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
🏠

Main App

Date

About 1 month ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.