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
_inspectorRequestedIdson the inspection; charges are not recalculated automatically unless someone edits charges manually. - Requested-inspector pricing uses basis
requestedinmodifierPriceAdjFn(the third argument must betruefor that fee to apply). Scheduling and quote flows pass that flag; the work-order request toggle does not run that pricing pipeline. recalculateChargesForRequiredInfocallsmodifierPriceAdjFnwithrequestedhard-coded tofalse, 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 fromsrc/app/tools/inspections/[id]/components/WorkorderPage.tsxalongsideuseWorkorderPricingSaveand 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
_inspectorRequestedIdsand lock-related fields—live insrc/routes/inspection.tsandsrc/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.tsxattik-frontend/src/util/functions/data/modifierPriceAdjFn.tsattik-frontend/src/util/functions/schedulingHelpers/recalculateChargesForRequiredInfo.tsattik-frontend/src/app/tools/inspections/[id]/hooks/useWorkorderPricingSave.tsattik-frontend/src/app/tools/inspections/[id]/components/workorderPriceSavePlan.tsattik-backend/src/routes/inspection.ts
Status: Completed
Log in to comment and vote
No comments yet
Be the first to share your thoughts.