toga-ai 1.0.506 → 1.0.507
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.
- package/knowledge/2.0/apps/toga2-supply/INDEX.md +1 -0
- package/knowledge/2.0/apps/toga2-supply/workflows/client-host-scoping.md +83 -0
- package/knowledge/INDEX.md +1 -1
- package/knowledge/clients/elite/INDEX.md +1 -0
- package/knowledge/clients/elite/features/supply2-scope.md +61 -0
- package/knowledge/clients/elite/profile.md +4 -2
- package/package.json +1 -1
|
@@ -5,3 +5,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
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 |
|
|
8
|
+
| [Onboarding a client to the supply2 frontend (host-scoping)](workflows/client-host-scoping.md) | How a new tenant becomes a "client" in the `toga2-supply` frontend. | toga2-supply/src/stores/useHostNameStore.ts, toga2-supply/src/hooks/useHostName.tsx, toga2-supply/src/hooks/usePageDetails.tsx, toga2-supply/src/hooks/usePageListDetails.tsx, toga2-supply/src/components/layout/SlideMenu/SlideMenu.tsx, toga2-supply/src/utils/handleClientAuthentication.ts, toga2-supply/src/App.tsx, toga2-supply/src/pages/Inventory/viewModel/FIELDS/DUMMYGROUPOPTIONS.ts, toga2-supply/src/pages/Inventory/listing/InventoryPage.tsx, toga2-supply/src/api/toga.ts |
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Onboarding a client to the supply2 frontend (host-scoping)
|
|
3
|
+
framework: "2.0"
|
|
4
|
+
repo: toga2-supply
|
|
5
|
+
project: TOGa Supply
|
|
6
|
+
client: shared
|
|
7
|
+
type: workflow
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-08-04
|
|
10
|
+
owners: [apeterson]
|
|
11
|
+
files:
|
|
12
|
+
- toga2-supply/src/stores/useHostNameStore.ts
|
|
13
|
+
- toga2-supply/src/hooks/useHostName.tsx
|
|
14
|
+
- toga2-supply/src/hooks/usePageDetails.tsx
|
|
15
|
+
- toga2-supply/src/hooks/usePageListDetails.tsx
|
|
16
|
+
- toga2-supply/src/components/layout/SlideMenu/SlideMenu.tsx
|
|
17
|
+
- toga2-supply/src/utils/handleClientAuthentication.ts
|
|
18
|
+
- toga2-supply/src/App.tsx
|
|
19
|
+
- toga2-supply/src/pages/Inventory/viewModel/FIELDS/DUMMYGROUPOPTIONS.ts
|
|
20
|
+
- toga2-supply/src/pages/Inventory/listing/InventoryPage.tsx
|
|
21
|
+
- toga2-supply/src/api/toga.ts
|
|
22
|
+
related:
|
|
23
|
+
- ../architecture.md
|
|
24
|
+
- ../../../clients/elite/features/supply2-scope.md
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Summary
|
|
28
|
+
|
|
29
|
+
How a new tenant becomes a "client" in the `toga2-supply` frontend. There is **no client
|
|
30
|
+
registry, enum, or per-client folder** in this repo. A "client" is simply the **subdomain
|
|
31
|
+
hostname** (`window.location.hostname` → e.g. `ELITE`), read through `useHostNameStore` /
|
|
32
|
+
`useHostName`. Onboarding a client means deciding, per page, what shows and how it behaves —
|
|
33
|
+
via backend ACL/pageMeta (the correct path) or, where necessary, a hardcoded host conditional
|
|
34
|
+
(the escape hatch). This doc is the reusable playbook and records the sharp edges (chiefly the
|
|
35
|
+
NYCHH inventory fragility) that any host-scoping change must not break.
|
|
36
|
+
|
|
37
|
+
## The two gating mechanisms
|
|
38
|
+
|
|
39
|
+
1. **Backend ACL / pageMeta (preferred).** `usePageDetails` / `usePageListDetails` read
|
|
40
|
+
`acl["<slug>"][...]` from the API. Columns, page availability, and permissions are
|
|
41
|
+
data-driven per role/client — no frontend change needed to grant or hide a page.
|
|
42
|
+
2. **Hardcoded `hostName === "X"` conditionals (escape hatch).** Used in `SlideMenu.tsx`
|
|
43
|
+
(nav visibility / deep-links) and `handleClientAuthentication.ts`. This is how NYCHH,
|
|
44
|
+
EndeavorHealth, and BankOfAmerica are wired. Prefer ACL; reach for a host conditional only
|
|
45
|
+
when the behavior cannot be expressed in pageMeta.
|
|
46
|
+
|
|
47
|
+
Routing in `App.tsx` is **centralized and unconditional** — pages are gated by nav + ACL,
|
|
48
|
+
never by the router. Do not add per-client routes.
|
|
49
|
+
|
|
50
|
+
## Onboarding checklist
|
|
51
|
+
|
|
52
|
+
1. Confirm the client's subdomain resolves the tenant (hostname → client → `Client_<slug>` DB).
|
|
53
|
+
2. Grant each in-scope page via backend ACL/pageMeta for the client's roles (slugs like
|
|
54
|
+
`sales-orders`, `sales-orders-listing`, inventory statics, etc.).
|
|
55
|
+
3. Add nav entries in `SlideMenu.tsx` (host-scoped if the page is client-specific).
|
|
56
|
+
4. For any page view-model that maps behavior by host (e.g. Orders `fieldMapping`,
|
|
57
|
+
Inventory group-by statics), add an **explicit entry for the new host** — do not rely on a
|
|
58
|
+
fallback (see gotchas).
|
|
59
|
+
5. Verify no shared global static was reordered or mutated for existing hosts.
|
|
60
|
+
|
|
61
|
+
## Gotchas / guardrails (do not break existing hosts)
|
|
62
|
+
|
|
63
|
+
- **NYCHH inventory is the most fragile surface in supply2.** Its nav deep-links hardcode the
|
|
64
|
+
group uuid `94f1e621-6eb4-bece-7f67-302ed49bce88` ("Items By Customer POs", `isDefault`).
|
|
65
|
+
That option's branch sets `additionalData {slug:"customerId", uuid:"1"}`, which triggers an
|
|
66
|
+
**NYCHH-only** `_total ne 0` filter in `api/toga.ts` (`slug=="customerId" &&
|
|
67
|
+
hostName[0]=="NYCHH"`). Nothing here may change when host-scoping shared inventory statics.
|
|
68
|
+
- **Group-by options are a global static** (`DUMMYGROUPOPTIONS.ts`) with no host branching
|
|
69
|
+
today. When you host-scope it, **return a fully separate array per host** — do NOT filter a
|
|
70
|
+
combined array. Invariant: **exactly one `isDefault` per host's visible array.**
|
|
71
|
+
- **Selection is uuid-driven and non-null-asserted.** Selection resolves from the URL param
|
|
72
|
+
`<tableSlug>:group=<uuid>` with fallback `groupOptions.find(o=>o.isDefault) || groupOptions[0]`;
|
|
73
|
+
`InventoryPage.tsx` non-null-asserts the uuid find and **throws** if the uuid is missing for a
|
|
74
|
+
host. Every host must have a valid default.
|
|
75
|
+
- **Shared localStorage is order-dependent and persists across host switches** in one browser
|
|
76
|
+
(`"urlKeys"` in `PrimaryTable.tsx`, and `"selectedGrouping"`). A new client's group option
|
|
77
|
+
must use a **distinct `urlKeys.key`** and must **never reorder** existing ones.
|
|
78
|
+
- **View-model host maps must not depend on a fallback.** Orders' `useOrdersPageViewModel.ts`
|
|
79
|
+
uses `fieldMapping[hostName] || fieldMapping.compass`, but the fallback key is a nonexistent
|
|
80
|
+
lowercase `compass`, so an unrecognized host **throws**. Always add an explicit host entry.
|
|
81
|
+
|
|
82
|
+
## Change history
|
|
83
|
+
- 2026-08-04 — Documented the supply2 client host-scoping onboarding pattern, the ACL-vs-hardcoded gating split, and the NYCHH inventory fragility guardrails (planning session for the Elite client) (apeterson)
|
package/knowledge/INDEX.md
CHANGED
|
@@ -22,7 +22,7 @@ _Auto-generated by `knowledge.js index`. Do not hand-edit._
|
|
|
22
22
|
- **worker2** (Worker) — 38 doc(s) → [2.0/apps/worker2/INDEX.md](2.0/apps/worker2/INDEX.md)
|
|
23
23
|
- **api2** (API) — 21 doc(s) → [2.0/apps/api2/INDEX.md](2.0/apps/api2/INDEX.md)
|
|
24
24
|
- **dbchanges2** (Database Changes) _(framework core)_ — 5 doc(s) → [2.0/apps/dbchanges2/INDEX.md](2.0/apps/dbchanges2/INDEX.md)
|
|
25
|
-
- **toga2-supply** (TOGa Supply) —
|
|
25
|
+
- **toga2-supply** (TOGa Supply) — 5 doc(s) → [2.0/apps/toga2-supply/INDEX.md](2.0/apps/toga2-supply/INDEX.md)
|
|
26
26
|
- **saml** (SAML SSO Gateway) — 3 doc(s) → [2.0/apps/saml/INDEX.md](2.0/apps/saml/INDEX.md)
|
|
27
27
|
- **toga2-view** (TOGa View Frontend) — 7 doc(s) → [2.0/apps/toga2-view/INDEX.md](2.0/apps/toga2-view/INDEX.md)
|
|
28
28
|
- **toga2-hub** (TOGa Hub) — 2 doc(s) → [2.0/apps/toga2-hub/INDEX.md](2.0/apps/toga2-hub/INDEX.md)
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
| Doc | Framework | Summary | Files |
|
|
4
4
|
|-----|-----------|---------|-------|
|
|
5
|
+
| [Elite — supply2 frontend scope (planned)](features/supply2-scope.md) | 2.0 | **Planned** scope for onboarding Elite to the `toga2-supply` frontend (host `ELITE`). | toga2-supply/ELITE-CLIENT-TASK-NOTES.md, toga2-supply/src/pages/Inventory/viewModel/FIELDS/DUMMYGROUPOPTIONS.ts, toga2-supply/src/pages/Inventory/viewModel/FIELDS/INVENTORYPAGEFIELDS.ts, toga2-supply/src/pages/Inventory/listing/InventoryPage.tsx, toga2-supply/src/pages/Orders/OrdersPage.tsx, toga2-supply/src/pages/Orders/viewModel/useOrdersPageViewModel.ts, toga2-supply/src/pages/Orders/view/OrderView/viewModel/useOrderDetailsViewModel.ts, toga2-supply/src/components/ui/Tables/PrimaryTable/helperFunctions/renderModalContent.tsx, toga2-supply/src/components/layout/SlideMenu/SlideMenu.tsx |
|
|
5
6
|
| [Elite](profile.md) | 2.0 | Elite is a managed-services client that uses **Freshservice** as their helpdesk platform. | worker2/Worker/Elite.php, library/app/api/toga2.php |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Elite — supply2 frontend scope (planned)
|
|
3
|
+
framework: "2.0"
|
|
4
|
+
repo: toga2-supply
|
|
5
|
+
project: TOGa Supply
|
|
6
|
+
client: elite
|
|
7
|
+
type: client-feature
|
|
8
|
+
status: draft
|
|
9
|
+
updated: 2026-08-04
|
|
10
|
+
owners: [apeterson]
|
|
11
|
+
files:
|
|
12
|
+
- toga2-supply/ELITE-CLIENT-TASK-NOTES.md
|
|
13
|
+
- toga2-supply/src/pages/Inventory/viewModel/FIELDS/DUMMYGROUPOPTIONS.ts
|
|
14
|
+
- toga2-supply/src/pages/Inventory/viewModel/FIELDS/INVENTORYPAGEFIELDS.ts
|
|
15
|
+
- toga2-supply/src/pages/Inventory/listing/InventoryPage.tsx
|
|
16
|
+
- toga2-supply/src/pages/Orders/OrdersPage.tsx
|
|
17
|
+
- toga2-supply/src/pages/Orders/viewModel/useOrdersPageViewModel.ts
|
|
18
|
+
- toga2-supply/src/pages/Orders/view/OrderView/viewModel/useOrderDetailsViewModel.ts
|
|
19
|
+
- toga2-supply/src/components/ui/Tables/PrimaryTable/helperFunctions/renderModalContent.tsx
|
|
20
|
+
- toga2-supply/src/components/layout/SlideMenu/SlideMenu.tsx
|
|
21
|
+
related:
|
|
22
|
+
- ../../2.0/apps/toga2-supply/workflows/client-host-scoping.md
|
|
23
|
+
- ../profile.md
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Summary
|
|
27
|
+
|
|
28
|
+
**Planned** scope for onboarding Elite to the `toga2-supply` frontend (host `ELITE`). This is
|
|
29
|
+
a scoping/handoff plan — **no code was written**; the source-of-truth plan is
|
|
30
|
+
`toga2-supply/ELITE-CLIENT-TASK-NOTES.md` at the repo root. Elite's supply2 surface is two
|
|
31
|
+
pages: **Sales Orders** (table + details modal, **no approvals**) and **Inventory** (a single
|
|
32
|
+
"Units By Items" group-by view, nested expand, no modal). Follow the shared
|
|
33
|
+
[host-scoping onboarding playbook](../../2.0/apps/toga2-supply/workflows/client-host-scoping.md)
|
|
34
|
+
and its guardrails when implementing.
|
|
35
|
+
|
|
36
|
+
## Part 1 — Inventory
|
|
37
|
+
|
|
38
|
+
- One host-scoped group-by view only: **"Units By Items"**, no group-by modal.
|
|
39
|
+
- Elite introduces the **first host-scoping** of the global `DUMMYGROUPOPTIONS.ts` static —
|
|
40
|
+
return a **separate array** for `ELITE` (do not filter the shared array); exactly one
|
|
41
|
+
`isDefault`; use a **distinct `urlKeys.key`**; never reorder NYCHH's existing options.
|
|
42
|
+
- Lock to the single view via `INVENTORYPAGEFIELDS.ts` `isGroupByModalVisible: false`
|
|
43
|
+
(host-scoped).
|
|
44
|
+
- No modal is already the default (`InventoryPage.tsx` `hasModalTable=false`,
|
|
45
|
+
`rowsHaveModalOnClick=false`). **Nested rows non-clickable is automatic** when
|
|
46
|
+
`isNestedTable: true` (the `onRowClick` no-op in `PrimaryTableContent.tsx`).
|
|
47
|
+
|
|
48
|
+
## Part 2 — Sales Orders
|
|
49
|
+
|
|
50
|
+
- Table columns are backend pageMeta-driven for slug `sales-orders`; ACL fetched under slug
|
|
51
|
+
`sales-orders-listing`.
|
|
52
|
+
- **Details modal needs no code:** `renderModalContent.tsx` DEFAULT routes unknown hosts to
|
|
53
|
+
`OrderDetailsModal` only (no `ApprovalsModal`); `useOrderDetailsViewModel.ts` falls back to
|
|
54
|
+
`DEFAULTFIELDS.json`.
|
|
55
|
+
- **Required FE change:** add an explicit `ELITE` entry to `useOrdersPageViewModel.ts`
|
|
56
|
+
`fieldMapping`. The fallback `fieldMapping[hostName] || fieldMapping.compass` references a
|
|
57
|
+
nonexistent lowercase `compass` key, so an unrecognized host **throws**. Elite's FIELDS must
|
|
58
|
+
set `approvalsButton.isEnabled=false` and omit `approvalActionOptions` to exclude approvals.
|
|
59
|
+
|
|
60
|
+
## Change history
|
|
61
|
+
- 2026-08-04 — Captured the planned Elite supply2 scope (Inventory single-view + Sales Orders without approvals) from the ELITE-CLIENT-TASK-NOTES.md scoping session; no code written yet (apeterson)
|
|
@@ -4,18 +4,20 @@ framework: "2.0"
|
|
|
4
4
|
apps:
|
|
5
5
|
- worker2
|
|
6
6
|
- library
|
|
7
|
+
- toga2-supply
|
|
7
8
|
project: Worker
|
|
8
9
|
client: elite
|
|
9
10
|
type: profile
|
|
10
11
|
status: active
|
|
11
|
-
updated: 2026-
|
|
12
|
-
owners: [snaredla]
|
|
12
|
+
updated: 2026-08-04
|
|
13
|
+
owners: [snaredla, apeterson]
|
|
13
14
|
files:
|
|
14
15
|
- worker2/Worker/Elite.php
|
|
15
16
|
- library/app/api/toga2.php
|
|
16
17
|
related:
|
|
17
18
|
- 2.0/apps/worker2/features/elite-freshservice-sync.md
|
|
18
19
|
- 1.0/apps/library/features/elite-freshservice-sync.md
|
|
20
|
+
- features/supply2-scope.md
|
|
19
21
|
---
|
|
20
22
|
|
|
21
23
|
## Summary
|
package/package.json
CHANGED