toga-ai 1.0.947 → 1.0.949
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/clients/compass-usa/features/corporate-vs-field-laptop-personas.md +28 -15
- package/knowledge/clients/compass-usa/features/cost-centers.md +11 -1
- package/knowledge/clients/compass-usa/features/persona-model-and-levy-gating.md +8 -1
- package/knowledge/clients/compass-usa/profile.md +2 -0
- package/package.json +1 -1
|
@@ -28,9 +28,9 @@ Nothing is built. This doc records the agreed shape so the next session does not
|
|
|
28
28
|
|
|
29
29
|
## How it works (the agreed design)
|
|
30
30
|
|
|
31
|
-
1. **Corporate persona.** Move the standard laptop bundle(s) out of
|
|
32
|
-
**Corporate** persona, and attach it with a **single `Locations_Personas` row on sector
|
|
33
|
-
(`Locations.id = 52`)**. Effective-persona resolution unions `Users_Personas`, the user's own
|
|
31
|
+
1. **Corporate persona.** Move the standard laptop bundle(s) out of **Non-Levy (persona 40)** into a
|
|
32
|
+
new **Corporate** persona, and attach it with a **single `Locations_Personas` row on sector
|
|
33
|
+
`J00000` (`Locations.id = 52`)**. Effective-persona resolution unions `Users_Personas`, the user's own
|
|
34
34
|
`Locations_Personas`, and their **sector's** (the 5-level walk), so every cost center under
|
|
35
35
|
`J00000` inherits it — including ones Compass adds on a later daily import.
|
|
36
36
|
2. **Field persona.** It **cannot** use `Locations_Personas`: "everyone except sector 52" is not a
|
|
@@ -42,18 +42,27 @@ Nothing is built. This doc records the agreed shape so the next session does not
|
|
|
42
42
|
4. **No `isActive` filter is needed.** No inactive cost center under `J00000` has a single active
|
|
43
43
|
user, so attaching at the sector only ever reaches real people.
|
|
44
44
|
|
|
45
|
-
##
|
|
45
|
+
## Where the laptop bundles live (prod `Client_Compass`, verified 2026-10-05)
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
**
|
|
49
|
-
|
|
50
|
-
was bundle **187** "Compass Standard HP ZBOOK 8 Laptop (Preferred)"; persona 1 also held **188** HP
|
|
51
|
-
Ebook Flip (inactive), **192** HP Pro Mini 400 G9, **195** Developer ZBOOK.
|
|
47
|
+
The standard laptop bundles sit in **persona 40 "Non-Levy"** (number 42) — not in persona 1, which is
|
|
48
|
+
**Base** and carries only the 9 kits Levy also holds. See
|
|
49
|
+
[Persona Refactor](../workflows/persona-refactor-migration.md) for the three-way split.
|
|
52
50
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
| Bundle | Name | Note |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| 187 | Compass Standard HP ZBOOK 8 Laptop (Preferred) | |
|
|
54
|
+
| 188 | Compass Hybrid HP Ebook 8 Flip (Travel) | `isActive = 0` |
|
|
55
|
+
| 192 | HP PRO MINI 400 G9 | |
|
|
56
|
+
| 195 | Compass Developer HP ZBOOK POWER | |
|
|
57
|
+
|
|
58
|
+
**All four are attached to persona 12 "MITS Team" as well**, so the split must move/handle **both**
|
|
59
|
+
personas — doing it on Non-Levy alone leaves MITS Team seeing the old laptop.
|
|
60
|
+
|
|
61
|
+
There is still **no `Locations_Personas` row for location 52**, so nothing inherits at that sector
|
|
62
|
+
today. The table is already used this way for other sectors (e.g. Levy sector 55 → persona 24).
|
|
63
|
+
|
|
64
|
+
**Open question — unanswered by the client:** which of **187 / 192 / 195** count as "the standard
|
|
65
|
+
laptops" that stay corporate-only. Settle that before writing the migration.
|
|
57
66
|
|
|
58
67
|
## Gotchas
|
|
59
68
|
|
|
@@ -73,5 +82,9 @@ plan written against "persona 40 / Non-Levy" must be re-checked against prod fir
|
|
|
73
82
|
## Change history
|
|
74
83
|
- 2026-10-05 — Created. Recorded the agreed corporate/field split (Corporate attached at sector
|
|
75
84
|
`J00000` via one `Locations_Personas` row; Field assigned in `PeopleFile` and skipped under
|
|
76
|
-
`J00000`; the 79-row per-sector alternative rejected) and the
|
|
77
|
-
|
|
85
|
+
`J00000`; the 79-row per-sector alternative rejected) and the prod bundle locations verified the
|
|
86
|
+
same day: laptops 187 / 188 / 192 / 195 live in **Non-Levy (40)** and are also on **MITS Team
|
|
87
|
+
(12)**, and location 52 still has no `Locations_Personas` row. An earlier draft of this doc quoted
|
|
88
|
+
a **2026-09-15** persona read (persona 1 = "All", 23 bundles) as if it were current and called it a
|
|
89
|
+
conflict with the refactor doc — it was simply taken two days before the refactor went live on
|
|
90
|
+
2026-09-17. Removed; the refactor docs are correct. Nothing built. (bala)
|
|
@@ -5,7 +5,7 @@ project: _Underscore
|
|
|
5
5
|
client: compass-usa
|
|
6
6
|
type: client-feature
|
|
7
7
|
status: active
|
|
8
|
-
updated: 2026-
|
|
8
|
+
updated: 2026-10-05
|
|
9
9
|
owners: [bala, ajean]
|
|
10
10
|
files:
|
|
11
11
|
- toga2-commerce/src/pages/Cart/api/CartApi.ts
|
|
@@ -17,6 +17,7 @@ files:
|
|
|
17
17
|
- dbchanges2/Client_Compass/2026-07-06 - RemoveNonNumericCostCenters.sql
|
|
18
18
|
related:
|
|
19
19
|
- ../profile.md
|
|
20
|
+
- ./location-hierarchy-and-sectors.md
|
|
20
21
|
- ../../../2.0/apps/toga2-commerce/features/cart-page-config-architecture.md
|
|
21
22
|
- ../../../1.0/apps/tools/features/compass-user-persona-admin.md
|
|
22
23
|
- ./people-file-user-lifecycle.md
|
|
@@ -60,6 +61,14 @@ Deactivation proven safe against prod data:
|
|
|
60
61
|
- Proven end-to-end in dev-sandbox: after the migration, active non-numeric rows = **0** (all 1,185 codes incl. the 725 number+alphabet combos) while pure-numeric stayed untouched at **440,005** active rows.
|
|
61
62
|
|
|
62
63
|
## Gotchas
|
|
64
|
+
- **⚠ A cost-center number is NOT unique across sectors — never match on the number alone.** Scope
|
|
65
|
+
every match to a sector / hierarchy path. Measured 2026-10-05: 10 of the client's 634 "corporate"
|
|
66
|
+
cost centers also exist under other sectors — `4018` / `45781` / `62937` under B&I Overhead
|
|
67
|
+
(`M00000`), `22772` / `26963` / `28184` / `54188` under Corporate Income (`H00000`), `47258` /
|
|
68
|
+
`62230` under CCL Hospitality (`Y00000`), `31335` under ESFM (`W00000`). Three carry real users
|
|
69
|
+
(`4018` → 10, `31335` → 9, `47258` → 9), so the wrong match hits live people. See
|
|
70
|
+
[Location Hierarchy & Sectors](./location-hierarchy-and-sectors.md) for the walk and the
|
|
71
|
+
dedupe-before-counting recipe.
|
|
63
72
|
- **⚠ `Users.c_erpSystemEntityId` has a DOUBLE meaning — never overwrite it to persist a cost-center change.** In `worker2/Worker/Client/Compass/PeopleFile.php` it is (a) copied straight into `c_hrEmpDirectoryKey` and treated as **unique per employee** (`:544-546`, e.g. `"1001-1003"`), and (b) used as the **primary key for resolving `Users.locationId`** (`:566-571`). Writing a location code into it corrupts employee identity to buy one night of persistence. This is why the [Tools Compass admin](../../../1.0/apps/tools/features/compass-user-persona-admin.md) writes only `Users.locationId` + `Users.c_erpEntityId` and accepts that a cost-center edit is **undone that night** for anyone in the PEOPLE file.
|
|
64
73
|
- **⚠ The `Locations` column names are REVERSED — confirmed by the importer's own comment** (`PeopleFile.php:328-330`): `Locations.c_erpEntityId` holds the **FULL** code (`"1001-1018"`) and `Locations.c_erpSystemEntityId` holds the **SHORT** code (`"1018"`). Never label these by column name in a UI — show the value, not the field name.
|
|
65
74
|
- **⚠ There is no usable index for a cost-center search, so never wire one to a type-ahead.** `Client_Compass` has ~909,700 active `locationTypeId = 1` (Unit) rows carrying only ~36,352 distinct `c_erpSystemEntityId` values (~730 duplicate rows per code); **442,549** of the active rows have a numeric short code. Per the `dbchanges2` schema the only key on `Locations` is `locationTypeId`, which covers nearly the whole table — so there is no index on `c_erpSystemEntityId`, on `isActive`, or any composite. Every cost-center search reads the table then groups. **Recommended follow-up (not done): index `Locations (locationTypeId, isActive, c_erpSystemEntityId)` in BOTH Compass tenants** (dbchanges2).
|
|
@@ -70,6 +79,7 @@ Deactivation proven safe against prod data:
|
|
|
70
79
|
|
|
71
80
|
## Related
|
|
72
81
|
- [Compass USA profile](../profile.md)
|
|
82
|
+
- [Location Hierarchy & Sectors](./location-hierarchy-and-sectors.md)
|
|
73
83
|
- [Cart page config architecture](../../../2.0/apps/toga2-commerce/features/cart-page-config-architecture.md)
|
|
74
84
|
- [Tools Compass user/persona admin](../../../1.0/apps/tools/features/compass-user-persona-admin.md)
|
|
75
85
|
- [PEOPLE-file user lifecycle](./people-file-user-lifecycle.md)
|
|
@@ -6,12 +6,14 @@ project: Worker
|
|
|
6
6
|
client: compass-usa
|
|
7
7
|
type: client-feature
|
|
8
8
|
status: active
|
|
9
|
-
updated: 2026-
|
|
9
|
+
updated: 2026-10-05
|
|
10
10
|
owners: [bala, ajean, mhammontree]
|
|
11
11
|
files:
|
|
12
12
|
- worker2/Worker/Client/Compass/PeopleFile.php
|
|
13
13
|
related:
|
|
14
14
|
- ./people-file-user-lifecycle.md
|
|
15
|
+
- ./corporate-vs-field-laptop-personas.md
|
|
16
|
+
- ./location-hierarchy-and-sectors.md
|
|
15
17
|
- ../../../2.0/apps/_underscore/features/effective-persona-resolution.md
|
|
16
18
|
- ../../../2.0/apps/toga2-commerce/features/storefront-persona-gating-and-home-counts.md
|
|
17
19
|
- ../profile.md
|
|
@@ -182,6 +184,11 @@ Both are **latent, not live, and not yet fixed** — each needs its own ticket.
|
|
|
182
184
|
constants from this file into tickets, docs, or chat transcripts.
|
|
183
185
|
|
|
184
186
|
## Change history
|
|
187
|
+
- 2026-10-05 — Linked the deferred
|
|
188
|
+
[corporate vs field laptop split](./corporate-vs-field-laptop-personas.md) (Corporate attached at
|
|
189
|
+
sector `J00000` via `Locations_Personas`; Field assigned here in `PeopleFile`, mirroring the Levy
|
|
190
|
+
branch) and the new [location hierarchy doc](./location-hierarchy-and-sectors.md) that owns the
|
|
191
|
+
sector walk and the `Locations` dedupe rule. (bala)
|
|
185
192
|
- 2026-09-23 — Recorded the per-tenant persona-id table and two **unfixed** CA gating gaps found while fixing TRUE-82230: persona **35 (VIP) has no tenant check** and would FK-fail on Canada (latent only because the file carries no CA VIP rows), and the persona **30 delete branch strips a real CA persona** from every Canadian user holding it (0 today). Both need their own tickets; both become reachable now that Canada runs again. (mhammontree)
|
|
186
193
|
- 2026-09-17 — **The refactor is live in prod (TRUE-80672) and the persona set changed shape.** It is
|
|
187
194
|
a **three-way** split: Base (1) keeps the 9 kits Levy also held, **Non-Levy is id 40 / number 42**
|
|
@@ -44,6 +44,8 @@ related:
|
|
|
44
44
|
- features/multi-tier-tracking-and-serial-mirroring.md
|
|
45
45
|
- features/order-fulfillment-status-per-line.md
|
|
46
46
|
- features/cost-centers.md
|
|
47
|
+
- features/location-hierarchy-and-sectors.md
|
|
48
|
+
- features/corporate-vs-field-laptop-personas.md
|
|
47
49
|
- features/isfulfillable-data-quality-and-type-rule.md
|
|
48
50
|
- features/item-catalogs-and-duplicate-items.md
|
|
49
51
|
- features/approval-decision-flow.md
|
package/package.json
CHANGED