toga-ai 1.0.446 → 1.0.448
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
| Doc | Summary | Files |
|
|
4
4
|
|-----|---------|-------|
|
|
5
5
|
| [TOGa Supply (toga2-supply) Architecture](architecture.md) | `toga2-supply` is the **React + Vite frontend** for TOGa Supply — warehouse fulfillment tooling (shipment selection, fulfill & ship against carrier APIs, NetSui | toga2-supply/src/api/toga.ts, toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx |
|
|
6
|
-
| [Fulfill & Ship](features/fulfill-and-ship.md) | Fulfill & Ship lets a warehouse user select sales-order line items, enter serials, pick a carrier/method, and in one action: create the Item Fulfillment records | _underscore/Model/Client/Measure.php, _underscore/Model/Client/TrackingNumber.php, toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/getEditShipmentFormOptions.ts, toga2-supply/src/components/ui/Tables/BasicTable/BasicTable.tsx, toga2-supply/src/components/ui/Tables/types.ts, toga2-supply/src/components/ui/GoogleMapsLink.tsx, toga2-supply/src/pages/ShipmentItems/view/forms/ShipmentItemsTable.tsx, toga2-supply/src/pages/ShipmentItems/api/ShipmentItemsApi.ts, toga2-supply/src/pages/ShipmentItems/types.ts, toga2-supply/src/pages/EditShipment/viewModel/FIELDS/RETURNLABELFIELDS.json, toga2-supply/src/pages/EditShipment/view/components/forms/EditShipmentForm.tsx, toga2-supply/src/components/ui/BaseInput/UnitSelect.tsx, toga2-supply/src/pages/EditShipment/view/modals/SerialNumbersModal.tsx, toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/view/components/forms/EditShipmentForm.tsx, toga2-supply/src/pages/EditShipment/view/components/SelectedShipmentItemsTable.tsx, toga2-supply/src/pages/EditShipment/view/helpers/ShipmentDetailsForm/renderEditShipmentFormInput.tsx, toga2-supply/src/pages/EditShipment/viewModel/FIELDS/DUMMYUPDATESHIPMENTFIELDS.json, toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/renderEditShipmentFormInput.tsx, toga2-supply/tailwind.config.cjs, toga2-supply/src/pages/EditShipment/view/modals/ReturnShippingModal.tsx, toga2-supply/src/styles/index.scss, toga2-supply/src/components/ui/BaseInput/BaseInput.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/EditShipment/viewModel/signatureTypes.ts, toga2-supply/src/pages/EditShipment/view/modals/SelectReturnAddressModal.tsx, toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/formatShipmentData.ts, toga2-supply/src/pages/EditShipment/types.ts, toga2-supply/src/pages/Shipments/view/ShipmentsPage.tsx, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx, toga2-supply/src/pages/Shipments/api/ShipmentsApi.ts, toga2-supply/src/pages/Shipments/types.ts, toga2-supply/src/pages/FulfilledShipments/view/FulfilledShipmentsPage.tsx, toga2-supply/src/components/ui/CardTable/CardTable.tsx, toga2-supply/src/components/ui/CardTable/types.ts, toga2-supply/src/assets/pen-line.svg, _underscore/Model/Client/ItemFulfillment.php, _underscore/Trait/Netsuite/ItemFulfillment.php, _underscore/Component/Library/Carriers/Ups/Ups.php |
|
|
6
|
+
| [Fulfill & Ship](features/fulfill-and-ship.md) | Fulfill & Ship lets a warehouse user select sales-order line items, enter serials, pick a carrier/method, and in one action: create the Item Fulfillment records | _underscore/Model/Client/Measure.php, _underscore/Model/Client/TrackingNumber.php, toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/getEditShipmentFormOptions.ts, toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/validateFormOnSubmit.ts, toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/checkDimensions.ts, toga2-supply/src/components/ui/Tables/BasicTable/BasicTable.tsx, toga2-supply/src/components/ui/Tables/types.ts, toga2-supply/src/components/ui/GoogleMapsLink.tsx, toga2-supply/src/pages/ShipmentItems/view/forms/ShipmentItemsTable.tsx, toga2-supply/src/pages/ShipmentItems/api/ShipmentItemsApi.ts, toga2-supply/src/pages/ShipmentItems/types.ts, toga2-supply/src/pages/EditShipment/viewModel/FIELDS/RETURNLABELFIELDS.json, toga2-supply/src/pages/EditShipment/view/components/forms/EditShipmentForm.tsx, toga2-supply/src/components/ui/BaseInput/UnitSelect.tsx, toga2-supply/src/pages/EditShipment/view/modals/SerialNumbersModal.tsx, toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/view/components/forms/EditShipmentForm.tsx, toga2-supply/src/pages/EditShipment/view/components/SelectedShipmentItemsTable.tsx, toga2-supply/src/pages/EditShipment/view/helpers/ShipmentDetailsForm/renderEditShipmentFormInput.tsx, toga2-supply/src/pages/EditShipment/viewModel/FIELDS/DUMMYUPDATESHIPMENTFIELDS.json, toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/renderEditShipmentFormInput.tsx, toga2-supply/tailwind.config.cjs, toga2-supply/src/pages/EditShipment/view/modals/ReturnShippingModal.tsx, toga2-supply/src/styles/index.scss, toga2-supply/src/components/ui/BaseInput/BaseInput.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/EditShipment/viewModel/signatureTypes.ts, toga2-supply/src/pages/EditShipment/view/modals/SelectReturnAddressModal.tsx, toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/formatShipmentData.ts, toga2-supply/src/pages/EditShipment/types.ts, toga2-supply/src/pages/Shipments/view/ShipmentsPage.tsx, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx, toga2-supply/src/pages/Shipments/api/ShipmentsApi.ts, toga2-supply/src/pages/Shipments/types.ts, toga2-supply/src/pages/FulfilledShipments/view/FulfilledShipmentsPage.tsx, toga2-supply/src/components/ui/CardTable/CardTable.tsx, toga2-supply/src/components/ui/CardTable/types.ts, toga2-supply/src/assets/pen-line.svg, _underscore/Model/Client/ItemFulfillment.php, _underscore/Trait/Netsuite/ItemFulfillment.php, _underscore/Component/Library/Carriers/Ups/Ups.php |
|
|
7
7
|
| [AWS Amplify Build & Deploy (non-prod environments)](workflows/amplify-build-and-deploy.md) | How `toga2-supply` (React + Vite) builds and deploys on **AWS Amplify**. | toga2-supply/amplify.yml, toga2-supply/.gitattributes, toga2-supply/.github/workflows/sync-stage-environments.yml, toga2-supply/.env.qc-security |
|
|
@@ -12,6 +12,8 @@ files:
|
|
|
12
12
|
- _underscore/Model/Client/Measure.php
|
|
13
13
|
- _underscore/Model/Client/TrackingNumber.php
|
|
14
14
|
- toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/getEditShipmentFormOptions.ts
|
|
15
|
+
- toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/validateFormOnSubmit.ts
|
|
16
|
+
- toga2-supply/src/pages/EditShipment/helpers/ShipmentDetailsForm/checkDimensions.ts
|
|
15
17
|
- toga2-supply/src/components/ui/Tables/BasicTable/BasicTable.tsx
|
|
16
18
|
- toga2-supply/src/components/ui/Tables/types.ts
|
|
17
19
|
- toga2-supply/src/components/ui/GoogleMapsLink.tsx
|
|
@@ -616,6 +618,24 @@ the call 403s and returns no label.
|
|
|
616
618
|
programmatic `setValue` for a user-meaningful prefill must pass `{ shouldDirty: true }` or the form
|
|
617
619
|
still reads "clean" (also affects the mint dirty-border above). File:
|
|
618
620
|
`EditShipment/view/modals/ReturnShippingModal.tsx`.
|
|
621
|
+
- **⚠ A submit handler must branch on a validation helper's RETURN value, NOT on the same-tick
|
|
622
|
+
`errors` snapshot after `setError`.** Same RHF-formState-lag family as the `isDirty` gotcha above:
|
|
623
|
+
the destructured `errors` object is one render **behind** `setError`/`clearErrors`, so a helper that
|
|
624
|
+
sets field errors and a caller that then reads `Object.keys(errors)` on the **same tick** see a
|
|
625
|
+
stale (empty) `errors` — the FIRST submit sailed past validation straight to the API even with
|
|
626
|
+
invalid fields. **Two rules for any toga2-supply form doing manual RHF validation on submit:**
|
|
627
|
+
(1) the helper must **RETURN a fresh boolean/result** and the caller must branch on that return
|
|
628
|
+
value, never on the same-tick `errors` snapshot; (2) the helper must **`clearErrors` on the
|
|
629
|
+
now-valid path**, not only `setError` on the invalid path. *Concrete failure:* `checkDimensions`
|
|
630
|
+
had branches for every partial L/W/H combination and for all-absent but **none for all-present**,
|
|
631
|
+
so once a partial submit flagged a dimension, completing all three never cleared it and submit
|
|
632
|
+
stayed blocked in RHF state **permanently**. Fix: `validateFormOnSubmit.ts` and `checkDimensions.ts`
|
|
633
|
+
now return a boolean (`hasErrors`) and clear errors on the valid state; `EditShipmentForm.tsx`
|
|
634
|
+
branches on the returned result. (This validation now also runs in **edit mode** — detail/address
|
|
635
|
+
fields were previously skipped on the edit save path.) Files:
|
|
636
|
+
`EditShipment/helpers/ShipmentDetailsForm/validateFormOnSubmit.ts`,
|
|
637
|
+
`EditShipment/helpers/ShipmentDetailsForm/checkDimensions.ts`,
|
|
638
|
+
`EditShipment/view/components/forms/EditShipmentForm.tsx`.
|
|
619
639
|
- **⚠ api2 V2 field SELECTORS are dot-paths of REAL DB column names — a wrong name silently returns
|
|
620
640
|
nothing.** V2 responses select fields by dot-path (e.g.
|
|
621
641
|
`"itemFulfillmentItems.salesOrderItem.item.skuNumber"`). The real `Items` columns are **`skuNumber`
|
|
@@ -798,6 +818,13 @@ for Compass and is not yet in prod.
|
|
|
798
818
|
the form via `getValueFromPath`'s unguarded `.split`). Remaining Figma tweaks (Dimensions in./cm
|
|
799
819
|
dropdown + gaps, Item Count right-align, return-label row gaps, shipment-card indicator top gap) were
|
|
800
820
|
cosmetic — no doc change. (mhammontree)
|
|
821
|
+
- 2026-07-27 — TRUE-79191 (CodeRabbit review pass): fixed the Edit Shipment form's **first-submit
|
|
822
|
+
validation bypass** — `validateFormOnSubmit`/`checkDimensions` now RETURN a boolean and the submit
|
|
823
|
+
handler branches on that instead of the stale same-tick `errors` snapshot; `checkDimensions` now
|
|
824
|
+
clears errors on the all-present dimensions path (previously had no all-present branch, so a partial
|
|
825
|
+
submit could block submit permanently). Edit mode now runs the same detail/address validation
|
|
826
|
+
(previously skipped) and `updateShipment` returns step-identifying failures. Recorded as a reusable
|
|
827
|
+
RHF-validation gotcha. (mhammontree)
|
|
801
828
|
- 2026-07-14 — TRUE-79191 (commit `724d17c1a`): fixed **Signature Type** not saving/rehydrating —
|
|
802
829
|
documented the reusable **whole-object react-select** convention (`{uuid,name}`; map on `.uuid`,
|
|
803
830
|
rehydrate the object) as a gotcha; the string comparison `data.signatureType === "Required"`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: session
|
|
3
3
|
slug: true-79191-fulfill-ship
|
|
4
|
-
title: TRUE-79191 Fulfill & Ship —
|
|
4
|
+
title: TRUE-79191 Fulfill & Ship — Units of Measure shipped + verified, CodeRabbit review cleared, PRs up
|
|
5
5
|
author: mhammontree
|
|
6
6
|
repos: [dbchanges2, _underscore, api2, toga2-supply]
|
|
7
7
|
framework: "2.0"
|
|
@@ -14,61 +14,58 @@ updated: 2026-07-27
|
|
|
14
14
|
# Session: true-79191-fulfill-ship
|
|
15
15
|
**Date:** 2026-07-27
|
|
16
16
|
**Project/Repo:** toga2-supply (2.0) + _underscore / api2 / dbchanges2
|
|
17
|
-
**Task:**
|
|
17
|
+
**Task:** Ship package Units-of-Measure full-stack for Fulfill & Ship, verify save/retrieve, clear the CodeRabbit review, and get PRs up for deploy.
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
## What WORKED
|
|
22
|
-
|
|
23
|
-
- **
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **End-to-end save/retrieve VERIFIED in DB:** new tracking number **9676** (SO 7221433 / NetSuite, created 2026-07-27 12:06) has `lengthMeasureId=1` (inch) / `weightMeasureId=2` (pound) — populated by the **frontend create payload** (proves real persistence: column defaults NULL, and the 07-22 backfill predates this row).
|
|
32
|
-
- **Local-env fixes** (see failures section for why these were NOT our code): `pcre.jit=0` in php.ini; `Items.isFulfillable` column added to all 11 local client DBs.
|
|
33
|
-
- Deployment doc `C:\WWW\TRUE-79191_deployment_order.md` updated with all 4 UoM migrations + notes.
|
|
22
|
+
- **Package UoM full-stack — DONE, verified end-to-end.** `Measures.measureType` (ENUM LENGTH/WEIGHT) + `conversionFactorToBase`; seeded Inch/Pound (base, factor 1); `TrackingNumbers.lengthMeasureId`/`weightMeasureId` (+ hard FKs); backfill; Core RecordFields 2436-2438; Client ACL grants. `_underscore` Measure/TrackingNumber model fields. api2 = no code (metadata-driven). toga2-supply: two RHF selects fed by `GET /v2/measures` split by `measureType`; FK written as nested relation `{uuid}` (mirrors shippingCarrier).
|
|
23
|
+
- **Verified in DB:** new tracking number 9676 (SO 7221433, created 2026-07-27) persisted `lengthMeasureId=1`/`weightMeasureId=2` from the frontend save (new row, post-backfill, columns default NULL → proves real save). Reopen rehydrates correctly.
|
|
24
|
+
- **Empty-dropdowns bug FIXED:** `GET /v2/measures` omitted `measureType` because the field had no `AclFieldPermissions` grant — the V2 engine builds the GET output field list from AclFieldPermissions, so ungranted = omitted (READ, not just write). Granted `measureType` read by mirroring sibling `slug` per-client (dbchanges2 22c). Applied to all local clients; commit `ceeb95d`.
|
|
25
|
+
- **CodeRabbit review cleared — 3 batches, all committed, tsc clean each time:**
|
|
26
|
+
- Batch 1 (`d1eba64af`, 10 findings): BasicTable stopPropagation; ShipmentItemsTable pure updater; EditShipmentForm editContext guard + edit-mode validation; updateShipment null-safe derefs + step-identifying failures; ReturnShippingModal spans→buttons; SelectReturnAddressModal radio semantics + radiogroup; dedup field id; stale-comment removals.
|
|
27
|
+
- Batch 2 (`ba611989a`): `validateFormOnSubmit`/`checkDimensions` now RETURN a fresh boolean; caller branches on it (not the stale RHF `errors` snapshot) so the FIRST submit is blocked on invalid fields.
|
|
28
|
+
- Batch 3 (`e0942cb4f`): `checkDimensions` now clears errors when all L/W/H present (previously no all-present branch → a flagged dimension never cleared → permanent submit block).
|
|
29
|
+
- **Local env unblocked earlier:** `pcre.jit=0` (JIT/Sentry bootstrap 500-every-route); `Items.isFulfillable` column added to all local client DBs (model pulled ahead of local schema).
|
|
30
|
+
- **Deployment order doc updated** (`C:\WWW\TRUE-79191_deployment_order.md`) with the 4 UoM migrations + notes. **PRs are up.**
|
|
34
31
|
|
|
35
32
|
## What did NOT work — DO NOT RETRY THESE
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
-
|
|
39
|
-
- **
|
|
40
|
-
- `
|
|
33
|
+
- **Assuming read-only fields need no ACL grant** — WRONG. V2 builds GET output from `AclFieldPermissions`; a field with no grant row for the caller's role is silently omitted from the response (not just blocked on write). measureType needed a read grant. See `_underscore/features/acl-permission-chain.md`.
|
|
34
|
+
- **Mirroring `needsReturnLabel` for measure-field write grants** — its grants aren't present in every client (Client_True had none) → measure fields ungranted there → EV-9. Mirror **`shippingMethodId`** (stable/universal).
|
|
35
|
+
- **Branching on the RHF `errors` snapshot right after `setError`** — it lags one render, so the first submit slips through. Validation helpers must RETURN a fresh result and the caller must branch on that. Also the helper must `clearErrors` on the valid path or stale errors block submit forever.
|
|
36
|
+
- **Chasing the sales-orders 500 as feature code** — it was `pcre.jit` (bootstrap) then `Items.isFulfillable` missing column (local DB behind on migrations). Not our code.
|
|
37
|
+
- **Re-running `Client/2026-07-22b` after go-live** — one-time backfill; a re-run coerces later NULL rows to Inch/Pound.
|
|
41
38
|
|
|
42
39
|
## Not tried yet (candidates for next session)
|
|
43
|
-
- **Deploy** TRUE-79191 (deployment
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
40
|
+
- **Deploy** TRUE-79191 (DB → backend → frontend per the deployment doc). Before prod DB step: verify `MAX(Core.RecordFields.id)=2435` (else bump the 2436-2438 ids in `Core/2026-07-22a`); `composer install` api2 (FPDF) + prod carrier config; flag the unrelated `isFulfillable` migration `id=2434` collision to its owner.
|
|
41
|
+
- Monitor CodeRabbit for further findings on the updated diff.
|
|
42
|
+
- Seed cm/kg into a client (metric, per-client) to exercise the multi-option dropdown.
|
|
43
|
+
- Full local DB migration catch-up / reset from beta (drift scan: 16 genuine missing columns in unrelated tables; none block fulfill/ship).
|
|
44
|
+
- Weight symbol on Pending Shipments cards is static `"lbs."` (TODO — dynamic from weightMeasure.symbol).
|
|
45
|
+
- The submit caller still keeps `|| actualErrors.length > 0` (RHF snapshot) as a secondary guard covering create-mode serial errors from `formatShipmentData` (which doesn't return a hasErrors signal). If CodeRabbit flags it, give `formatShipmentData` a return value and drop the snapshot OR.
|
|
48
46
|
|
|
49
47
|
## Current file state
|
|
50
48
|
| File | Status | Notes |
|
|
51
49
|
|------|--------|-------|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
| api2 | no changes | metadata-driven
|
|
56
|
-
| C:\WWW\TRUE-79191_deployment_order.md | updated (external) | UoM migrations + notes
|
|
57
|
-
| Local
|
|
50
|
+
| toga2-supply | committed + PR up | commits: e91f7029d (UoM UI), d1eba64af (CR batch 1), ba611989a (CR batch 2), e0942cb4f (CR batch 3). .env/.env.development/package-lock intentionally uncommitted |
|
|
51
|
+
| dbchanges2 | committed + PR up | UoM 4 files incl. 22c measureType read grant (ceeb95d) |
|
|
52
|
+
| _underscore | committed + PR up | Measure/TrackingNumber UoM model fields (77fae34c) |
|
|
53
|
+
| api2 | no changes | metadata-driven |
|
|
54
|
+
| C:\WWW\TRUE-79191_deployment_order.md | updated (external) | UoM migrations + notes |
|
|
55
|
+
| Local DBs | migrated (local only) | all clients: UoM + isFulfillable; Core_2 RecordFields 2436-2438 + measureType; php.ini pcre.jit=0 |
|
|
58
56
|
|
|
59
57
|
## Decisions made
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
- **isFulfillable: add column only locally**, skip RecordField (its migration hardcodes `id=2434`, colliding with returnAddressId `2026-07-10a` also 2434 — flag to that feature's owner).
|
|
58
|
+
- Columns `lengthMeasureId`/`weightMeasureId` (volume dropped); reuse Measures + `measureType` enum, zero new tables; base Inch/Pound; hard FK constraints.
|
|
59
|
+
- Mirror `shippingMethodId` for write grants, `slug` for measureType read grant (per-client role adaptation).
|
|
60
|
+
- FIELD_CHAR for measureType (matches signatureType).
|
|
61
|
+
- RHF validation: helpers RETURN a fresh boolean; caller branches on it; helpers clear on the valid path.
|
|
62
|
+
- pcre.jit=0 and isFulfillable column are LOCAL env fixes only (not shipped).
|
|
66
63
|
|
|
67
64
|
## Blockers
|
|
68
|
-
None
|
|
65
|
+
None. Ready to deploy. Verify prod `MAX(Core.RecordFields.id)=2435` before running `Core/2026-07-22a`.
|
|
69
66
|
|
|
70
67
|
## Exact next step
|
|
71
|
-
> Deploy TRUE-79191 per `C:\WWW\TRUE-79191_deployment_order.md` (
|
|
68
|
+
> Deploy TRUE-79191 per `C:\WWW\TRUE-79191_deployment_order.md` (DB → backend → frontend), after confirming prod `MAX(Core.RecordFields.id)=2435`, running api2 `composer install`, and applying prod carrier config. Keep monitoring CodeRabbit on the PRs and address any new findings the same way (verify → minimal fix → tsc → commit).
|
|
72
69
|
|
|
73
70
|
---
|
|
74
71
|
_Saved by /session-save on 2026-07-27_
|
package/package.json
CHANGED