shoc-frontend-new/tmp/pr-descriptions/pr3-uplifts-column-tab.md
Arthur Bassi 31c5559d23 fix(work-orders): clear uplift form state only after successful mutations
[recover] remove malicious eslint payload (was 380188af)
2026-08-10 17:12:10 -03:00

2.6 KiB

Jira

QA residual

  • Conscious adaptation: dialog vs design slide-over tab (no slide-over on this dev).
  • P0 done: admin revoke of approved with required reason.
  • P1: + Add / Manage + attachments polish.

Summary

Adds the UPLIFT column to the work orders board table (after COMP DOC) with a status pill that opens a uplifts dialog (not a slide-over tab — board currently navigates to /workorders/:id on row detail).

  • Maps upliftSummary on each board row: { hasUplift, pendingCount, primaryStatus?, amount? }
  • Dialog: list uplifts, create (amount/notes + attachments UI stub), cancel pending, revoke auto_approved (optional reason) and approved for admin (required reason, SH-196); read-only when status is Completed/Canceled
  • WO-scoped API client + query keys under workorders/{id}/uplifts
  • DEV in-memory mock fallback when API calls fail

API / assumptions

Item Assumption
UI surface Dialog from UPLIFT column click — design ref uses slide-over tab, but dev has no slide-over; detail opens via route navigation
Row field upliftSummary on GET /board and /board/search rows (see docs/work-orders/pending-be-contract.md)
Endpoints GET/POST workorders/{id}/uplifts, POST …/uplifts/{id}/cancel|revoke — distinct from NTE queue uplifts API
Attachments Create form shows disabled attachments field until BE accepts files
DEV mock When import.meta.env.DEV and API throws, work-order-uplifts-mock-store serves list/create/cancel/revoke

Out of scope (later PRs)

  • Closability / Comp Doc pending gate (PR4)
  • Advanced filter uplift facets (PR5)
  • Vendor Portal NTE queue

Test plan

  • Board row shows UPLIFT pill after COMP DOC (pending count or primary status + amount)
  • Click UPLIFT opens dialog; Completed/Canceled rows are read-only
  • Create uplift (DEV mock) updates list; cancel pending / revoke auto_approved work
  • Admin can revoke approved uplifts with required reason; non-admin cannot
  • npm run verify green

Design ref

seahaven-desing — WorkOrders.tsx UpliftCell (~L4669)