Workorder: no control to set primary service on charge list (Edit charges only today)

Objective

  • Make it possible to see and change which charge/service is primary in the normal workorder workflow, or deliberately keep Edit charges as the only place to set primary while improving discoverabilitydecision needed on the exact product rule.
  • Reduce friction when PAC thresholds, report matching, or reschedule logic treats the primary charge specially (primaryCharge / charge.isPrimary)—staff should not be blocked because the workorder charge list has no control.

Background

  • Intake noted that on the inspection workorder there is no way to change which service is primary; reordering vs primary were reported together from the same thread. Slack — workorder charges & primary
  • charge.isPrimary exists on attik-backend/src/models/chargeSchema.ts and surfaces in the UI via ChargeChips (attik-frontend/.../ChargeChips.tsx) on each charge row.
  • Edit charges flow compares isPrimary when detecting changes (EditChargesModal.tsx)—primary is editable there, not via a dedicated control on the Services & payments table on the workorder.
  • Downstream logic references the primary charge in places such as RescheduleJobModal.tsx (primaryCharge) and Reports.tsx (mapping primary service for reports)—so which charge is primary has product impact beyond labeling.

Scope

Frontend

  • attik-frontend/src/app/tools/inspections/[id]/components/ServicesPayments.tsx — charge table renders inspection.charges but does not offer a primary toggle; ChargeChips only displays.
  • attik-frontend/src/app/tools/inspections/[id]/components/EditChargesModal.tsx — where isPrimary is currently set in the service/charge editor.
  • attik-frontend/src/app/tools/inspections/[id]/components/ChargeChips.tsx — current primary badge behavior.
  • attik-frontend/src/app/tools/inspections/[id]/components/RescheduleJobModal.tsx — reads inspection.charges.find((c) => c.isPrimary).
  • attik-frontend/src/app/tools/inspections/[id]/components/reports/Reports.tsxcharge.isPrimary used for service/report mapping.

Backend

  • attik-backend/src/models/chargeSchema.tsisPrimary field persistence; PATCH charge routes as used when saving from Edit charges.

Product / architecture

  • Decision needed: Inline primary selector on the workorder charge row vs overflow menu vs keep modal-only with copy / link to Edit charges.
  • Decision needed: Exactly one primary per inspection vs validation when multiple flags exist (if ever).

References

  • Slack — workorder charges & primary
  • Related: ATT-1661 — charge display order after reorder (separate symptom).
  • attik-backend/src/models/chargeSchema.ts
  • attik-frontend/src/app/tools/inspections/[id]/components/ServicesPayments.tsx
  • attik-frontend/src/app/tools/inspections/[id]/components/EditChargesModal.tsx
  • attik-frontend/src/app/tools/inspections/[id]/components/ChargeChips.tsx

Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
🏠

Main App

Date

16 days ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.