toga-ai 1.0.160 → 1.0.162
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/1.0/apps/library/INDEX.md +1 -0
- package/knowledge/1.0/apps/library/features/diagnostic-dialog-view-recommended-services.md +49 -0
- package/knowledge/1.0/apps/toga/INDEX.md +4 -0
- package/knowledge/INDEX.md +2 -1
- package/knowledge/clients/office-depot/INDEX.md +1 -0
- package/knowledge/clients/office-depot/features/togarefresh2026-linkbuilder-routing.md +49 -0
- package/knowledge/clients/tow-foundation/INDEX.md +1 -1
- package/knowledge/clients/tow-foundation/features/receipt-processing.md +36 -7
- package/knowledge/registry.json +13 -2
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
| Doc | Summary | Files |
|
|
4
4
|
|-----|---------|-------|
|
|
5
5
|
| [Library (1.0 Framework) Architecture](architecture.md) | `library` is the shared library repository for **all 1.0 (legacy) applications** — the `App_` framework. | library/_.php, library/app/, library/browser/ |
|
|
6
|
+
| [Diagnostic Dialog — View Recommended Services Routing](features/diagnostic-dialog-view-recommended-services.md) | `App_Model_Toga_Diagnostic::initializeDiagnosticDialog()` renders the device modal used across all TOGa service request views. | library/app/model/toga/diagnostic.php |
|
|
6
7
|
| [Elite Freshservice Sync (library)](features/elite-freshservice-sync.md) | `App_Api_Toga2` in `library/app/api/toga2.php` orchestrates bidirectional sync between TOGA 2 and TOGaDesk. | library/app/api/toga2.php |
|
|
7
8
|
| [Branded HTML Email Templates (App_Email_Template)](features/email-templates.md) | `App_Email_Template` (`app/email/template.php`) is the base class for branded HTML emails in the 1.0 (`App_`) framework. | library/app/email/template.php, library/app/email/agilant.php |
|
|
8
9
|
| [NetSuite SuiteQL/REST API Reference](features/netsuite-suiteql-api-reference.md) | General working reference for the Agilant NetSuite integration: how to authenticate, how SuiteQL behaves, and the confirmed schema of the tables/columns/codes w | library/app/api/netsuite/rest.php, library/ssl/netsuite_ec_key.pem |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Diagnostic Dialog — View Recommended Services Routing
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: library
|
|
5
|
+
project: Library
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-23
|
|
10
|
+
owners: [snaredla]
|
|
11
|
+
files:
|
|
12
|
+
- library/app/model/toga/diagnostic.php
|
|
13
|
+
related:
|
|
14
|
+
- ../../../clients/office-depot/features/togarefresh2026-linkbuilder-routing.md
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Summary
|
|
18
|
+
`App_Model_Toga_Diagnostic::initializeDiagnosticDialog()` renders the device modal
|
|
19
|
+
used across all TOGa service request views. It includes a "View Recommended Services"
|
|
20
|
+
button whose URL depends on whether the store is a TOGaRefresh 2026 store and whether
|
|
21
|
+
the diagnostic passed or failed.
|
|
22
|
+
|
|
23
|
+
## How it works
|
|
24
|
+
1. Checks `$_SESSION['isTogaRefresh2023']` or `$_SESSION['isTogaRefresh2026']` to
|
|
25
|
+
determine if this is a refresh store.
|
|
26
|
+
2. For refresh stores, casts `$serviceRequestId` to `(int)` then queries `Diagnostics`
|
|
27
|
+
for the latest `pass` value for the service request.
|
|
28
|
+
3. Routes:
|
|
29
|
+
- **Diagnostic pass** (`pass >= 1`) → `?content=togarefresh2026_servicerequests_techsupport&serviceRequestId=...`
|
|
30
|
+
- **Diagnostic fail / no diagnostic** (`pass < 1`) → `?content=togarefresh2026_servicerequests_serviceselection&jobJacketId=1&showServices=195,101899&serviceRequestId=...`
|
|
31
|
+
4. For non-refresh stores, falls back to `App_Model_ServiceRequest::linkBuilder()`.
|
|
32
|
+
|
|
33
|
+
## Data model
|
|
34
|
+
- Table: `Diagnostics` (db_toga)
|
|
35
|
+
- Field read: `pass` (TINYINT boolean — 1 = passed, 0 = failed)
|
|
36
|
+
- Query: latest record by `id DESC LIMIT 1` for the given `serviceRequestId`
|
|
37
|
+
|
|
38
|
+
## Gotchas / known issues
|
|
39
|
+
- `$serviceRequestId` is cast to `(int)` before SQL interpolation — do not remove this cast (SQL injection prevention).
|
|
40
|
+
- If no diagnostic record exists, `$diagnosticPass` defaults to `0` (fail path) — shows service selection with `showServices=195,101899`.
|
|
41
|
+
- The same pass/fail routing logic exists in `toga/app/togarefresh2026/servicerequests/view.php` (lines 2358–2381) — keep both in sync.
|
|
42
|
+
- `isTogaRefresh2023` is kept alongside `isTogaRefresh2026` for backward compatibility — do not remove it.
|
|
43
|
+
- `$_SESSION['isTogaRefresh2026']` is set in `toga/_/app/frameworkindex.php` and `toga/app/home/action.php` at login time.
|
|
44
|
+
|
|
45
|
+
## Related docs
|
|
46
|
+
- `clients/office-depot/features/togarefresh2026-linkbuilder-routing.md`
|
|
47
|
+
|
|
48
|
+
## Change history
|
|
49
|
+
- 2026-06-23 — Initial doc. Diagnostic modal now routes pass→techsupport, fail→serviceselection with showServices=195,101899. (snaredla)
|
package/knowledge/INDEX.md
CHANGED
|
@@ -4,13 +4,14 @@ _Auto-generated by `knowledge.js index`. Do not hand-edit._
|
|
|
4
4
|
|
|
5
5
|
## 1.0 framework
|
|
6
6
|
|
|
7
|
-
- **library** (Library) _(framework core)_ —
|
|
7
|
+
- **library** (Library) _(framework core)_ — 7 doc(s) → [1.0/apps/library/INDEX.md](1.0/apps/library/INDEX.md)
|
|
8
8
|
- **worker** (Worker) — 10 doc(s) → [1.0/apps/worker/INDEX.md](1.0/apps/worker/INDEX.md)
|
|
9
9
|
- **togadesk** (TOGa Desk) — 7 doc(s) → [1.0/apps/togadesk/INDEX.md](1.0/apps/togadesk/INDEX.md)
|
|
10
10
|
- **togaview** (TOGa View) — 6 doc(s) → [1.0/apps/togaview/INDEX.md](1.0/apps/togaview/INDEX.md)
|
|
11
11
|
- **webhook** (Webhook) — 1 doc(s) → [1.0/apps/webhook/INDEX.md](1.0/apps/webhook/INDEX.md)
|
|
12
12
|
- **walmarttechservices** (Walmart Tech Services) — 1 doc(s) → [1.0/apps/walmarttechservices/INDEX.md](1.0/apps/walmarttechservices/INDEX.md)
|
|
13
13
|
- **test** (Test) — 11 doc(s) → [1.0/apps/test/INDEX.md](1.0/apps/test/INDEX.md)
|
|
14
|
+
- **toga** (TOGa) — 1 doc(s) → [1.0/apps/toga/INDEX.md](1.0/apps/toga/INDEX.md)
|
|
14
15
|
|
|
15
16
|
## 2.0 framework
|
|
16
17
|
|
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
| Doc | Framework | Summary | Files |
|
|
4
4
|
|-----|-----------|---------|-------|
|
|
5
5
|
| [ODP Tech Support Agent (Office Depot variant)](features/odp-tech-support.md) | 2.0 | ODP-specific customization of the shared TOGa Voice agent. | voice-to-voice/clients/odp/agent.py, voice-to-voice/clients/odp/agents/tech_support.py, voice-to-voice/clients/odp/prompts.py, voice-to-voice/clients/odp/config.yaml, voice-to-voice/clients/odp/.env.example |
|
|
6
|
+
| [TOGaRefresh 2026 — linkBuilderRefresh URL Routing (ODP)](features/togarefresh2026-linkbuilder-routing.md) | 1.0 | In the TOGaRefresh 2026 UI, any button that navigates to the service builder must use `App_Model_ServiceRequest::linkBuilderRefresh()` (→ `togarefresh2026_servi | toga/app/togarefresh2026/servicerequests/review.php, toga/app/togarefresh2026/customers/view.php, library/app/model/toga/diagnostic.php |
|
|
6
7
|
| [Office Depot](profile.md) | 2.0 | Office Depot is the first deployed tenant of the **TOGa Voice** (`voice-to-voice`) platform. | |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: TOGaRefresh 2026 — linkBuilderRefresh URL Routing (ODP)
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: toga
|
|
5
|
+
project: TOGa
|
|
6
|
+
client: office-depot
|
|
7
|
+
type: client-feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-23
|
|
10
|
+
owners: [snaredla]
|
|
11
|
+
files:
|
|
12
|
+
- toga/app/togarefresh2026/servicerequests/review.php
|
|
13
|
+
- toga/app/togarefresh2026/customers/view.php
|
|
14
|
+
- library/app/model/toga/diagnostic.php
|
|
15
|
+
related:
|
|
16
|
+
- ../profile.md
|
|
17
|
+
- ../../../1.0/apps/library/features/diagnostic-dialog-view-recommended-services.md
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Summary
|
|
21
|
+
In the TOGaRefresh 2026 UI, any button that navigates to the service builder must use
|
|
22
|
+
`App_Model_ServiceRequest::linkBuilderRefresh()` (→ `togarefresh2026_servicerequests_serviceselection`)
|
|
23
|
+
instead of the legacy `linkBuilder()` (→ `servicerequests_builder`).
|
|
24
|
+
|
|
25
|
+
## Key files / entry points
|
|
26
|
+
- `App_Model_ServiceRequest::BUILDER` = `'servicerequests_builder'` (legacy)
|
|
27
|
+
- `App_Model_ServiceRequest::BUILDERREFRESH` = `'togarefresh2026_servicerequests_serviceselection&jobJacketId=1'`
|
|
28
|
+
- Both constants defined in `library/app/model/servicerequest.php` lines 11–12.
|
|
29
|
+
|
|
30
|
+
## How it works
|
|
31
|
+
Files updated to use `linkBuilderRefresh`:
|
|
32
|
+
|
|
33
|
+
| File | Location | Context |
|
|
34
|
+
|------|----------|---------|
|
|
35
|
+
| `togarefresh2026/servicerequests/review.php` | line 217 | Quote submission POST URL for non-EXISTING job jackets |
|
|
36
|
+
| `togarefresh2026/customers/view.php` | line 64 | "Create Work Order For This Customer" button |
|
|
37
|
+
| `library/app/model/toga/diagnostic.php` | `initializeDiagnosticDialog()` | Device modal button — routes by diagnostic pass/fail (see library doc) |
|
|
38
|
+
|
|
39
|
+
## Gotchas / known issues
|
|
40
|
+
- The old `servicerequests/view.php` (legacy non-refresh view) intentionally keeps `linkBuilder()` — 2026 stores do not route through it.
|
|
41
|
+
- Do not change `App_Model_ServiceRequest::BUILDER` — legacy stores still depend on it.
|
|
42
|
+
- The diagnostic modal routing is pass/fail conditional — see `1.0/apps/library/features/diagnostic-dialog-view-recommended-services.md` for full details.
|
|
43
|
+
- `toga` app repo was not in registry.json before this session — it has been added (framework 1.0, role app, dependsOn library).
|
|
44
|
+
|
|
45
|
+
## Related docs
|
|
46
|
+
- `1.0/apps/library/features/diagnostic-dialog-view-recommended-services.md`
|
|
47
|
+
|
|
48
|
+
## Change history
|
|
49
|
+
- 2026-06-23 — Initial doc. All 2026 builder buttons now use linkBuilderRefresh; diagnostic modal uses pass/fail routing. toga added to registry.json. (snaredla)
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
| Doc | Framework | Summary | Files |
|
|
4
4
|
|-----|-----------|---------|-------|
|
|
5
|
-
| [Credit Card Receipt Processing](features/receipt-processing.md) | 2.0 | Automated processing of credit card receipts uploaded to SharePoint. | worker2/Worker/Client/TowFoundation.php, worker2/Worker/Client/TowFoundation/ProcessReceipts.php, worker2/Worker/Client/TowFoundation/TowFoundationVendors.php |
|
|
5
|
+
| [Credit Card Receipt Processing](features/receipt-processing.md) | 2.0 | Automated processing of credit card receipts uploaded to SharePoint. | worker2/Worker/Client/TowFoundation.php, worker2/Worker/Client/TowFoundation/ProcessReceipts.php, worker2/Worker/Client/TowFoundation/TowFoundationVendors.php, worker2/Worker/Client/TowFoundation/TowFoundationCategories.php |
|
|
6
6
|
| [Tow Foundation](profile.md) | 2.0 | Tow Foundation is a nonprofit client. | |
|
|
@@ -5,12 +5,13 @@ project: Worker
|
|
|
5
5
|
client: tow-foundation
|
|
6
6
|
type: client-feature
|
|
7
7
|
status: active
|
|
8
|
-
updated: 2026-06-
|
|
8
|
+
updated: 2026-06-23
|
|
9
9
|
owners: ["rgirish"]
|
|
10
10
|
files:
|
|
11
11
|
- worker2/Worker/Client/TowFoundation.php
|
|
12
12
|
- worker2/Worker/Client/TowFoundation/ProcessReceipts.php
|
|
13
13
|
- worker2/Worker/Client/TowFoundation/TowFoundationVendors.php
|
|
14
|
+
- worker2/Worker/Client/TowFoundation/TowFoundationCategories.php
|
|
14
15
|
related:
|
|
15
16
|
- clients/tow-foundation/profile.md
|
|
16
17
|
---
|
|
@@ -86,7 +87,7 @@ Amex billing cycle runs 3rd-to-3rd. `computeRefNo()` returns the cycle-end date
|
|
|
86
87
|
`TowFoundationVendors.php` holds 2,994 vendor names exported verbatim from Tow Foundation's
|
|
87
88
|
QuickBooks vendor list (June 2026). `matchQbVendor()` runs three passes against this list:
|
|
88
89
|
1. Exact match (case-insensitive)
|
|
89
|
-
2. Substring match — QB name contains extracted name or vice versa
|
|
90
|
+
2. Substring match — QB name contains extracted name or vice versa; minimum 3 chars. For needles shorter than 4 chars, a **whole-word boundary check** is used (regex `(?<![a-z])<needle>(?![a-z])`) to prevent short acronyms like `"UPS"` from matching inside `"USPS"`. Picks shortest QB name on multiple hits.
|
|
90
91
|
3. `similar_text()` similarity ≥ 80% — picks highest scorer
|
|
91
92
|
|
|
92
93
|
Returns the exact QB vendor string or `''` if no confident match. The AI only extracts
|
|
@@ -95,11 +96,35 @@ Returns the exact QB vendor string or `''` if no confident match. The AI only ex
|
|
|
95
96
|
To update the vendor list: re-export from QuickBooks → run the extraction script →
|
|
96
97
|
replace `TowFoundationVendors.php`. The matching logic is in `matchQbVendor()` and needs no changes.
|
|
97
98
|
|
|
98
|
-
### AI category values
|
|
99
|
-
The AI is prompted to return **specific expense types
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
### AI category values and QB mapping
|
|
100
|
+
The AI is prompted to return **specific expense types**. These are then mapped to the exact
|
|
101
|
+
QB account string via `mapCategory()`, which loads `TowFoundationCategories.php` and does
|
|
102
|
+
a case-insensitive lookup. Unmapped values are passed through as-is and logged as warnings.
|
|
103
|
+
|
|
104
|
+
| AI category value | QB account string |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `Dining` | `6640 Dining & Entertainment` |
|
|
107
|
+
| `Entertainment` | `6640 Dining & Entertainment` |
|
|
108
|
+
| `Travel` | `6609 Travel, conferences, meetings` |
|
|
109
|
+
| `Transportation` | `6610 Travel expense` |
|
|
110
|
+
| `Accommodation` / `Lodging` | `6620 Lodging` |
|
|
111
|
+
| `Office Supplies` | `6751 Office supplies` |
|
|
112
|
+
| `Professional Services` | `6400 Professional Fees & Consultants` |
|
|
113
|
+
| `Subscriptions` | `67271 Subscriptions` |
|
|
114
|
+
| `Technology` | `6710 Technology Systems Expense` |
|
|
115
|
+
| `Software` | `6714 Software License Expense` |
|
|
116
|
+
| `Printing` | `6722 Printing expense` |
|
|
117
|
+
| `Postage` | `6721 Postage` |
|
|
118
|
+
| `Membership` | `6730 Membership Dues` |
|
|
119
|
+
| `Insurance` | `6740 Insurance` |
|
|
120
|
+
| `Telephone` | `6755 Telephone & internet expense` |
|
|
121
|
+
| `Photography` | `67241 Photography` |
|
|
122
|
+
| `Board` | `6650 Board Expenses and Board Development` |
|
|
123
|
+
| `Professional Development` | `6735 Staff Professional Development` |
|
|
124
|
+
|
|
125
|
+
To update the mapping: edit `TowFoundationCategories.php` — keys are case-insensitive,
|
|
126
|
+
values must be the exact QB account string. The AI prompt in `extractReceiptData()` lists
|
|
127
|
+
the valid category names; keep them in sync with the map keys.
|
|
103
128
|
|
|
104
129
|
### Per-person constants
|
|
105
130
|
`CLASS_MAP` and `PAYMENT_ACCOUNT_MAP` in `ProcessReceipts.php` map each cardholder's name
|
|
@@ -158,9 +183,13 @@ Fatal errors send only to `NOTIFY_EMAIL_DEV` (no CC/BCC).
|
|
|
158
183
|
- **`billingCycle` filter is suffix-match, not exact** — always pass just the date portion (`"06-03-2026"`), not the full folder name. Passing the full name (`"Amex ending in 06-03-2026"`) also works but would miss Mastercard folders.
|
|
159
184
|
- **Ole Mole not in QB vendor list** — as of June 2026 this vendor is not in Tow Foundation's QuickBooks, so `qb_vendor` will be blank for Ole Mole charges until they add it to QB and the vendor list is refreshed.
|
|
160
185
|
- **Duplicate detection is within-run only** — if the same receipt was processed in a prior run and archived, it won't be caught. The dedup only covers receipts present in the current run's `$pendingRenames`.
|
|
186
|
+
- **Unmapped AI categories pass through** — if the AI returns a category string not in `TowFoundationCategories.php`, `mapCategory()` logs a warning and writes the raw AI string to the Excel. Check error logs after a run if the Category column looks odd; add the new value to the map file to fix it.
|
|
187
|
+
- **Short vendor acronyms (< 4 chars) require whole-word match** — the substring pass uses a word-boundary regex for needles under 4 chars to avoid false positives (e.g. `"UPS"` inside `"USPS"`). If a short vendor name is not matching, check that the QB vendor list entry starts or ends with the acronym as a whole word.
|
|
188
|
+
- **Archive restore script** — a one-shot CLI script `/tmp/tow_restore_archives.php` was written 2026-06-23 to move archived files back to their billing-cycle folders for reprocessing. It is not committed; re-create from the session transcript if needed. It uses the production credentials from `Config/production.ini`.
|
|
161
189
|
|
|
162
190
|
## Change history
|
|
163
191
|
|
|
192
|
+
- 2026-06-23 — `TowFoundationCategories.php` added: AI category values now mapped to exact QB account strings via `mapCategory()`; `"Transportation"` → `"6610 Travel expense"` etc. (19 mappings). QB vendor substring match minimum lowered from 4 to 3 chars with whole-word boundary guard for short needles — fixes `"CVS"` → `"CVS Pharmacy"`, `"MTA"` → `"MTA Metro card"`, prevents `"UPS"` → `"USPS"` false positive. (rgirish)
|
|
164
193
|
- 2026-06-18 — QB vendor matching via local fuzzy match against `TowFoundationVendors.php` (2,994 vendors); AI category prompt updated to return specific types (Dining, Travel, etc.); duplicate receipt detection added (person+date+vendor+amount dedup); `billingCycle` filter parameter added (suffix-match — card-type agnostic); person folder ` CC receipts` suffix stripped so CLASS_MAP/PAYMENT_ACCOUNT_MAP resolve correctly (rgirish)
|
|
165
194
|
- 2026-06-12 — QB Excel upload moved to root-level `3. QB Excel/`; Archive/exception folders flattened (no person subfolder); unsupported mime types (`application/octet-stream`) now throw ReceiptProcessingException instead of being silently skipped (rgirish)
|
|
166
195
|
- 2026-06-11 — Added CC (Magdalena), BCC (devteam@togatech.com), per-cardholder Archive subfolders, Excel upload to "3. QB Excel" SharePoint folder, two-pass rename with alphabetical duplicate suffix, rename format changed to `YYYY.MM.DD Full Name_Vendor_Amount` (rgirish)
|
package/knowledge/registry.json
CHANGED
|
@@ -158,6 +158,17 @@
|
|
|
158
158
|
"project": "TOGa Commerce",
|
|
159
159
|
"framework": "2.0",
|
|
160
160
|
"role": "app",
|
|
161
|
-
"dependsOn": [
|
|
161
|
+
"dependsOn": [
|
|
162
|
+
"api2"
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"repo": "toga",
|
|
167
|
+
"project": "TOGa",
|
|
168
|
+
"framework": "1.0",
|
|
169
|
+
"role": "app",
|
|
170
|
+
"dependsOn": [
|
|
171
|
+
"library"
|
|
172
|
+
]
|
|
162
173
|
}
|
|
163
|
-
]
|
|
174
|
+
]
|
package/package.json
CHANGED