Commit graph

344 commits

Author SHA1 Message Date
Alexandre Brandizzi
a71407b426
Merge branch 'dev' into feat/sh-250-fe-additive-add 2026-08-19 10:28:04 -03:00
Codex Review Integration
1305bf35dd fix(vendors): bypass the query cache when reloading after a conflict (SH-250)
The reload fix re-seeded the form from queryClient.fetchQuery, which inherits the
global 5-minute staleTime. A 409 never invalidates that key -
useSaveVendorCompanyRoster invalidates only in onSuccess and its onError returns
early for conflicts - and the Add flow has no mounted observer on it, so reload
returned the cached roster with the same stale rowVersion and every retry 409'd
again. Update mode was unaffected because it recovers via query.refetch(), which
bypasses staleTime.

Pass staleTime: 0 on that fetch, since its sole purpose is the freshest
rowVersion. The regression test uses a client with the app's real staleTime; the
default test client uses 0, which masked this entirely.
2026-08-19 10:26:28 -03:00
Arthur Bassi
a62d66a2d1
Merge pull request #109 from Sea-Haven-Industries/feature/wo-advanced-filters-parity
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): advanced filter facets for severity and uplift (SH-121/SH-196)
2026-08-19 09:40:14 -03:00
Arthur Bassi
d534e92d03
Merge branch 'dev' into feature/wo-advanced-filters-parity 2026-08-19 09:33:07 -03:00
Arthur Bassi
88b04a2481
Merge pull request #104 from Sea-Haven-Industries/feature/wo-uplifts-column-and-tab
feat(work-orders): uplift column and dialog with admin revoke (SH-196)
2026-08-19 09:05:26 -03:00
arthur.bassi
9801d6a50e chore(work-orders): merge origin/dev and keep both search date windows
Keep SH-121 all-weeks constants and the SH-165 unassigned Custom range.
2026-08-18 22:13:51 -03:00
arthur.bassi
93df28335f fix(work-orders): keep SH-196 uplift mapping typed after merging origin/dev 2026-08-18 21:44:55 -03:00
arthur.bassi
fe86d46bec Merge remote-tracking branch 'origin/dev' into feature/wo-uplifts-column-and-tab
# Conflicts:
#	src/domain/work-orders/mappers/work-order-table-row-mapper.ts
#	src/domain/work-orders/types/work-order-table-row.ts
2026-08-18 21:42:53 -03:00
Arthur Bassi
b3180ef886
Merge pull request #111 from Sea-Haven-Industries/feat/SH-165-unscheduled-pin
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): align Unscheduled board pin with design (SH-165)
2026-08-18 21:04:51 -03:00
arthur.bassi
07c8c72ee6 Merge remote-tracking branch 'origin/dev' into feat/SH-165-unscheduled-pin 2026-08-18 20:53:13 -03:00
Arthur Bassi
08a32b71dd
Merge pull request #105 from Sea-Haven-Industries/feature/wo-uplift-pending-close-gate
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
fix(work-orders): unify closability and block Completed on pending uplift (SH-188)
2026-08-18 18:37:41 -03:00
arthur.bassi
2554e40fd8 test(work-orders): assert all-weeks total and Clear All restores the bar 2026-08-18 18:13:43 -03:00
Alexandre Brandizzi
2c10d2b7cb
Merge branch 'dev' into feature/wo-advanced-filters-parity 2026-08-18 17:46:53 -03:00
Alexandre Brandizzi
0de695362a
Merge branch 'dev' into feat/sh-250-fe-additive-add 2026-08-18 17:46:49 -03:00
arthur.bassi
b0b94e8a53 merge origin/feat/SH-165-unscheduled-pin 2026-08-18 17:44:39 -03:00
arthur.bassi
bea2858c81 fix(work-orders): search all weeks when advanced filters are applied 2026-08-18 17:40:47 -03:00
arthur.bassi
358495cfe9 fix(work-orders): distinguish unassigned loading from empty pin 2026-08-18 17:40:16 -03:00
Codex Review Integration
9a066092b3 fix(vendors): correct additive add reload, phone and contact (SH-250, SH-246)
Three review findings on the additive add path:

- Create-mode reload refreshed selectedRoster (including rowVersion) but left
  the form company fields on their pre-conflict values, so a retry diffed stale
  fields against the reloaded roster and could overwrite the concurrent company
  update that caused the 409. Reload now resets the form from the fresh roster,
  matching the select path.
- mapVendorRosterAdditivePatchToBackend copied companyFields verbatim while the
  reconcile write mapper canonicalizes companyPhone, so PATCH and PUT could send
  different phone shapes for the same input.
- emptyRosterTechnician seeded preferredContact "Phone" even though that
  control was removed from the form, so filling the first blank row submitted a
  fabricated value. append already omitted it; both paths now agree.
2026-08-18 17:28:48 -03:00
arthur.bassi
a109a68f40 fix(work-orders): keep SH-188 tooltip when mixed with other gaps
Stop copying WO lifecycle status into uplift primaryStatus on flat board rows.
2026-08-18 17:28:14 -03:00
Codex Review Integration
ac9ce34101 fix(work-orders): distinguish loading from empty in Unassigned pin (SH-165)
The pinned Unassigned section folded the queue query's pending state into
isFetching only, which the section never read. On first mount, once GET /board
resolved while the queue was still paging GET /board/search, the pin announced
"No unassigned work orders." instead of a loading state.

Expose the queue query's own isLoading as unassignedLoading, thread it through
the table data hook, and render an aria-busy loading row while it is true so the
loading and empty states are separately observable.
2026-08-18 17:22:32 -03:00
Codex Review Integration
9624c264de fix(vendors): send only user-edited company fields on additive add (SH-250)
Adversarial review found a last-writer-wins window: after a stale 409 the
roster is refetched while the form keeps its pre-conflict values, so the
form-vs-roster diff resent our stale value for any company field another
user changed in that window, silently reverting their edit.

Transmit only fields the user actually edited, taken from react-hook-form
dirty state. Selecting a company calls reset(), so loaded values are never
dirty and only genuine edits are sent.

dirtyFields is resolved during render: formState is a Proxy that only tracks
properties read at render time, so reading it inside the submit callback
returned empty. The vendors E2E caught that; unit tests could not, since
they pass the flags in directly.
2026-08-18 14:42:01 -03:00
arthur.bassi
090130a2c0 chore(work-orders): merge origin/dev into uplifts PR
Keep upliftSummary fixtures and add isAddOn after the Add-On indicator landed on dev.
2026-08-18 13:24:21 -03:00
arthur.bassi
dc9e146080 merge origin/dev into feat/SH-165-unscheduled-pin
Keep SH-165 non-terminal lifecycle statuses next to the Add-On type mapping from dev.
2026-08-18 13:19:44 -03:00
Codex Review Integration
4d1f02b87d test(vendors): e2e asserts additive PATCH and no destructive PUT from add flow (SH-250, SH-246) 2026-08-18 13:13:04 -03:00
Codex Review Integration
a710e21281 fix(vendors): additive technician add for existing companies (SH-250, SH-246) 2026-08-18 13:09:33 -03:00
arthur.bassi
32177e831b fix(work-orders): set isAddOn on pending-uplift StatusCell fixture
Keep the SH-188 fixture assignable to WorkOrderTableRow after the SH-184 merge.
2026-08-18 12:04:55 -03:00
arthur.bassi
bf1def809b chore(work-orders): merge origin/dev into SH-188 closability gate
Keep PastDueStatusCell extraction and SH-185 Schedule On copy from merged #102.
2026-08-18 12:01:23 -03:00
Arthur Bassi
d43341f77a
Merge pull request #102 from Sea-Haven-Industries/feature/sh-126-wo-addon-indicator
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): SH-126/SH-184 — Add-On indicator (BE-authoritative)
2026-08-18 11:58:38 -03:00
arthur.bassi
0966962d8f fix(work-orders): keep Unassigned pin visible when empty
Render the weekly Unassigned section at count 0 and cover assignment through the board PATCH path.
2026-08-18 11:50:46 -03:00
Arthur Bassi
7902476e2a test(work-orders): cover remaining SH-121 facets and document BE producer on dev 2026-08-18 10:27:45 -03:00
arthur.bassi
b60d0474bc fix(work-orders): keep admin-approved revoke off the WO dialog (SH-214)
SH-214/SH-212 own that action on Uplift Approvals; the WO surface only revokes the requester's auto-approved uplift.
2026-08-18 09:28:49 -03:00
Arthur Bassi
8d1a3340a8 fix(work-orders): align Past Due overlay and copy to Schedule On (SH-185)
Dispatchers were told to change Due Date, which cannot clear Past Due.
Drive the table overlay from Schedule On and match the 422 contract.
2026-08-18 09:20:18 -03:00
arthur.bassi
958467fe40 fix(work-orders): load SH-165 Unassigned queue from global board search 2026-08-17 14:57:39 -03:00
arthur.bassi
e1667702e1 chore(work-orders): merge origin/dev into SH-165 Unassigned pin 2026-08-17 14:39:19 -03:00
Arthur Bassi
260f57ff23 chore(work-orders): merge origin/dev into SH-121 advanced filters 2026-08-17 14:21:09 -03:00
arthur.bassi
37a6098ecb fix(work-orders): require company not technician for Completed (SH-183) 2026-08-17 13:54:05 -03:00
arthur.bassi
aaba7ca2ea Merge remote-tracking branch 'origin/dev' into feature/wo-uplift-pending-close-gate 2026-08-17 13:50:22 -03:00
arthur.bassi
0941a1aa3f chore(work-orders): merge origin/dev and keep SH-196 uplift column 2026-08-17 13:28:52 -03:00
Arthur Bassi
4a95da32d2 chore(work-orders): merge origin/dev and keep SH-184 Add-On with severity gates 2026-08-17 09:36:07 -03:00
Arthur Bassi
b4cb9d0288
feat(work-orders): severity gates and wizard type/WO# parity (SH-192) (#106)
Some checks failed
CI / ci (push) Has been cancelled
CI / governance (push) Has been cancelled
CI / vendor-visual-regression (push) Has been cancelled
Deploy / deploy (push) Has been cancelled
* fix(work-orders): allow blank WO number in wizard create path

[recover] remove malicious eslint payload (was d0d08508)

* fix(work-orders): emit severity before type in board scalar PATCH ops

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

* chore(work-orders): drop vendor collateral from SH-192 lane

* fix(work-orders): add severity to unscheduled highlight fixture after dev merge

* refactor(work-orders): extract inline type/severity cell under function line cap

* fix(work-orders): add severity to comp-doc and media fixtures after dev merge

PR #45 introduced completion-doc, media and table-mutation fixtures that predate the required severity field, so the integrated head failed tsc. Fill severity on those row builders (null for PM, SEV 1 for the Emergency fixture) and type the mutation BASE_ROW instead of asserting it.

* test(work-orders): align merge fixes with severity field and WO# placeholder

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Arthur Bassi <bassi-arthurr@users.noreply.github.com>
Co-authored-by: Alexandre Brandizzi <alex_brandizzi@hotmail.com>
2026-08-14 11:59:52 -03:00
Arthur Bassi
4af826a1e0
feat(work-orders): query broadcast, remove auth bypass, dispatch polish (#100)
* fix(work-orders): address wizard create review findings

[recover] remove malicious eslint payload (was 166c63e4)

* fix(work-orders): remove legacy completedDate EditWorkorder path

[recover] remove malicious eslint payload (was f4e6132b)

* fix(work-orders): use local calendar day for completedDate

Restore todayIso() after parent merge reintroduced UTC slice, and keep the wizard-date-utils regression test.

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

* fix(work-orders): send wizard status and clear POC notes on site change

Map draft.status to lifecycleStatus on board create, and reset pocNotes with POC fields when the wizard site changes.

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

* fix(query): scope broadcast channel per account and clear on auth

Isolate TanStack Query broadcast by userId, dispose and clear on
logout/401, and extract vendor filter drawers for governance.

* feat(work-orders): board wizard create with service notes

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

* fix(work-orders): enforce single-service wizard create per SH-118

Use single service selection in the wizard and omit extraServices from board create.

* fix(vendors): restore filter drawer labels for e2e and visual CI

Use VendorFilterOptions again and keep the Apply filters footer label expected
by vendor Playwright specs and the committed visual baseline.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 11:52:48 -03:00
Arthur Bassi
5d7ac297e4 fix(work-orders): drop vendor string from Completed closability (SH-114) 2026-08-14 10:55:06 -03:00
Arthur Bassi
3c914f4e57 Merge remote-tracking branch 'origin/dev' into feature/wo-uplift-pending-close-gate 2026-08-14 10:51:28 -03:00
arthur.bassi
c721b407b6 fix(work-orders): merge dev and gate uplift create on pending and allowance
Hide a second create while a pending request exists, surface remaining auto-approval in the dialog, and refresh the branch onto current origin/dev.
2026-08-14 10:36:45 -03:00
arthur.bassi
65e2741fd0 merge(dev): refresh SH-196 branch onto current origin/dev 2026-08-14 10:29:12 -03:00
Arthur Bassi
d3bfd35d9b chore(work-orders): merge origin/dev and keep SH-184 Add-On with wizard range 2026-08-14 10:06:56 -03:00
Arthur Bassi
ee90d73a44
feat(work-orders): board wizard create with service notes (#99)
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): board wizard create with service notes

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

* fix(work-orders): enforce single-service wizard create per SH-118

Use single service selection in the wizard and omit extraServices from board create.

* refactor(work-orders): extract wizard controller for maintainability gate

Move duplicate-WO wiring and lookup hooks out of NewWoWizard so the
changed-file function line cap passes after merging dev.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-13 18:43:11 -03:00
arthur.bassi
93034f5da2 fix(work-orders): implement SH-165 Unassigned pinned queue
Replace Unscheduled-focused changes with assignment-based board partition,
accessible disclosure, duplicate prevention, and inline unassign support.
2026-08-13 16:49:50 -03:00
Arthur Bassi
8e61f97200 Merge remote-tracking branch 'origin/dev' into feature/wo-advanced-filters-parity 2026-08-13 16:18:51 -03:00
Arthur Bassi
1835a5939a fix(work-orders): dedupe completedDate and gate Completed on technician (SH-188)
Refresh onto current dev and resolve exact-head review blockers:

- Remove duplicate WorkOrderBoardRowApi.completedDate after merge with dev

- Add SH-114 Technician closability gate alongside company/vendor check

- Update wo-closability regressions for missing technician
2026-08-13 15:21:16 -03:00