shoc-frontend-new/tmp/pr-descriptions/pr7-add-technician.md
Arthur Bassi a30ac73d29
Some checks are pending
CI / ci (push) Waiting to run
CI / governance (push) Waiting to run
CI / vendor-visual-regression (push) Waiting to run
Deploy / deploy (push) Waiting to run
feat(work-orders): draft technician until vendor dialog save (SH-193) (#89)
* docs(work-orders): add pending BE contract checklist for design parity gaps

* feat(work-orders): add technician affordance in wo vendor dialog

* fix(work-orders): defer technician create until vendor dialog save

* docs(work-orders): align pr description with jira and qa residuals

* fix(vendors): harden draft technician optional field typing

* refactor(workorders): extract vendor dialog body footer and save hook

* fix(work-orders): coerce null company vendor for add-technician prop

* fix(work-orders): preserve draft technician staging on save [SH-193]

* fix(work-orders): select technicians by stable id [SH-193]

Keep selectedKey as explicit dialog state (SiteDialog pattern) so same-name drafts do not collide with existing vendors, and cover the regression with interaction tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Alexandre Brandizzi <alex_brandizzi@hotmail.com>
2026-08-11 14:01:31 -03:00

1.2 KiB

Jira

QA residual

  • P0 done: technician is staged as a local draft until the vendor dialog is saved / wizard submitted — Cancel does not orphan a vendor row.

Summary

  • Adds + Add technician to the WO board vendor dialog when a company context is known (from the row or the current selection).
  • Stages a draft technician locally (draft: id) without calling POST vendors until the dialog save commits the selection.
  • On save, create runs via the existing POST vendors REST endpoint (vendorsApi.create / useCreateVendor) using the company profile + new contactName.

Backend

Uses the established vendor create API (API_PATHS.rest.vendors → POST /vendors). Each vendor record represents one technician; linking to an existing company is done by sending the same companyName (and optional companyId when available). No new endpoint.

Test plan

  • Open vendor dialog → + Add technician → fill name → Cancel dialog → no vendor create API call.
  • Add technician → Save dialog → POST /vendors once; row shows new tech.
  • npm run verify

Out of scope

  • Multi-POC, multi-tech arrays on WO, vendors directory redesign.