Commit graph

550 commits

Author SHA1 Message Date
John Mizerek
8be3a3d802 Fix DoorDash image extraction: MenuPageItem uses imageUrl not imgUrl
StorePageCarouselItem uses imgUrl, but MenuPageItem uses imageUrl.
This gives ~540 item images instead of 26.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 12:32:01 -07:00
John Mizerek
a830a0820a Fix DoorDash parser: use find() loops instead of listToArray
listToArray treats delimiter as individual chars, not a string.
Rewritten to use position-based find() traversal for proper
multi-character delimiter splitting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 12:23:21 -07:00
John Mizerek
33040c9cd3 Rewrite DoorDash fast-path: use MenuPageItemList for full menu
- Extract items from MenuPageItemList (171 items) instead of StorePageCarouselItem (54)
- Categories already mapped to items via MenuPageItemList sections
- Cross-reference images from carousel entries by item name
- No need for Claude category assignment - data already structured

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 12:02:04 -07:00
John Mizerek
67e2079550 Add DoorDash/order.online fast-path parser
Extract menu data directly from embedded JSON in DoorDash HTML:
- Categories from MenuBookCategory entries
- Items with names, descriptions, prices, and image URLs from StorePageCarouselItem
- Business info from page title and StoreHeaderAddress
- Uses Claude to assign items to categories
- Upgrades image URLs to 600px for better quality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:44:24 -07:00
John Mizerek
dd2a508680 Add playwright scripts to git
Previously only lived on servers at /opt/playwright/. Now tracked in repo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:22:34 -07:00
John Mizerek
f58d567fb4 Fix DoorDash image import: scroll page in Playwright to trigger lazy-loaded images
- Update render.js on dev server to scroll page before capturing images
- Increase Playwright wait from 4s to 5s and timeout from 90s to 120s
- Upsize DoorDash CDN thumbnails from 150px to 600px when downloading

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 11:20:10 -07:00
John Mizerek
9a28091601 Handle struct types in item category and modifiers during merge
Claude sometimes returns category or modifiers as objects instead
of strings. Added isSimpleValue checks to prevent cast errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 21:04:34 -07:00
John Mizerek
d8a308a03e Increase Claude API timeout from 120s to 300s for image analysis
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:58:15 -07:00
John Mizerek
93a2738ae1 Increase max_tokens from 8192 to 16384 for menu image analysis
Claude response was being truncated mid-JSON for larger menus,
causing parse errors. The Lazy Daisy menu needed >8192 tokens.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:46:54 -07:00
John Mizerek
c6c189b0fa Save raw Claude response to file and dump char codes for debugging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:41:27 -07:00
John Mizerek
607c62051e Show JSON content around failure position for debugging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:38:36 -07:00
John Mizerek
7d23cb5487 Fix JSON parsing in analyzeMenuImages for PDF menu imports
The PDF upload goes to analyzeMenuImages.cfm (not analyzeMenuUrl.cfm).
Added control character cleaning, smart quote replacement, and Jackson
fallback parser with error handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:45:21 -07:00
John Mizerek
8ac6800d47 Use Jackson parser via file for Claude JSON response
Lucee's deserializeJSON fails on certain Claude outputs and the error
bypasses inner cftry/cfcatch. Parse via Jackson from file instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:37:42 -07:00
John Mizerek
a5c0d55aa8 Fix JSON error handler and save raw Claude response for debugging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:32:50 -07:00
John Mizerek
1ca958d11f Add debug char dump around JSON parse failure position
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:28:26 -07:00
John Mizerek
945ab6a919 Add RequiresServicePoint flag to task types API
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 16:50:02 -07:00
John Mizerek
4240fe76cc Harden JSON parsing for Claude API responses
- Add smart quote/dash replacement for PDF-sourced text
- Add Jackson fallback parser for when Lucee's deserializeJSON fails
- Strengthen prompt to request properly escaped JSON
- Clean control characters more selectively

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:31:03 -07:00
John Mizerek
d288b2b71c Add JSON parse error debug logging in saveWizard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:15:19 -07:00
John Mizerek
fc358b53c7 Strip control characters from JSON body in saveWizard
Lucee's deserializeJSON chokes on control characters in description
fields that JSON.stringify escapes but Lucee can't parse.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 13:11:31 -07:00
John Pinkyfloyd
639d789da1 Add debug info to cart and setLineItem
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 10:30:02 -07:00
John Pinkyfloyd
6af7e22b03 Fix debug array initialization
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 10:20:02 -07:00
John Pinkyfloyd
120930db4c Add debug logging for deselect flow
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 10:11:54 -07:00
John Pinkyfloyd
65f236268c Fix attachDefaultChildren to recurse through modifier groups
Default-checked items nested inside modifier groups were not being found
because the function only looked one level deep. Now it recurses through
all child items to find defaults at any depth.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 10:04:14 -07:00
John Pinkyfloyd
0451c604e6 Fix CFML scoping error - remove var keyword outside function
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 10:00:18 -07:00
John Pinkyfloyd
50307efa8d Fix cart item lookup to use orderLineItemId directly
- Add IsDeleted=0 filter to existing item search query
- Add support for OrderLineItemID parameter for direct item targeting
- Fixes duplicate items being created on quantity increment
- Fixes item deletion not working due to finding wrong/deleted records

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 09:25:20 -07:00
John Pinkyfloyd
fc9bbd78be Only keep Quantity=0 for modifiers, not root items 2026-03-09 09:13:55 -07:00
John Pinkyfloyd
029279658d Keep default-checked items with Quantity=0 when deselected
For inverted display: when user deselects a default-checked item, keep it
in cart with Quantity=0 instead of deleting. Cart displays "NO X" for these.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-09 09:11:15 -07:00
John Pinkyfloyd
6ffc77fcaf Revert inverted deselect logic - back to simple delete 2026-03-09 07:34:39 -07:00
John Pinkyfloyd
5e01bcd989 Add error handling to inverted group check 2026-03-08 23:10:48 -07:00
John Pinkyfloyd
503754e248 Keep deselected inverted defaults in cart with Quantity=0
For inverted groups, when user deselects a default item, keep it in cart
with Quantity=0 instead of deleting. This allows cart to display "NO X".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 23:05:44 -07:00
John Pinkyfloyd
f57d249fee Add ParentIsInvertedGroup to cart line items
Child items need to know if their parent group is inverted for proper
display logic (showing "NO X" instead of listing selected items).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 23:00:49 -07:00
John Pinkyfloyd
bae4293055 Add IsInvertedGroup to cart line items API response
Required for inverted modifier display (showing "NO X" for removed defaults
instead of listing all selected items).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 22:58:54 -07:00
John Pinkyfloyd
446addd66d Fix inverted modifier not removing from cart
When deselecting a modifier (IsSelected=false), Quantity was incorrectly
set to 1 instead of 0, preventing the removal logic from working.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-08 21:24:56 -07:00
John Mizerek
588e6ef26d Add IsInvertedGroup + RemovedDefaults to task detail API
Works app can now display inverted modifier groups with "NO" prefix
for removed defaults, matching KDS behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:11:06 -07:00
John Mizerek
57d31c0428 Fix unescaped # in Uber Eats HTML entity unescaping
CFML was failing to compile analyzeMenuUrl.cfm because &#39; contains
a # character that Lucee interprets as variable expression start.
Escaped all 4 occurrences to &##39;.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:46:33 -07:00
John Mizerek
717d60d6e6 Add IsInvertedGroup support for modifier groups
When enabled on a modifier group, KDS and cart only show removed
defaults (e.g., "NO Mustard") instead of listing all selected items.
Useful for groups where all options are checked by default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:14:19 -07:00
John Mizerek
49d724f9b2 Add Uber Eats menu import and fix header image upload step
- Parse JSON-LD structured menu data from saved Uber Eats pages
  (categories, items, prices, descriptions, business info)
- Show save-and-upload instructions when user pastes Uber Eats URL
- Always show header image upload step (was skipped for URL imports)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:59:40 -07:00
John Mizerek
06adc1211e Fix receipt showing processing fee for cash orders
Cash orders have no card processing fee. Now checks PaymentPaidInCash
to determine payment type and skips the Stripe fee calculation + display
for cash orders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:24:23 -07:00
John Mizerek
6346ffdb02 Add markStationDone.cfm to public routes for KDS access
KDS doesn't send auth tokens, so markStationDone needs to be a public
route like listForKDS and updateStatus already are.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:04:34 -07:00
John Mizerek
0a252e6569 KDS: show Start Preparing for new orders in station view
Previously station-filtered view skipped the acknowledge step and went
straight to "Mark Station Done" for new orders. Now new orders show
"Start Preparing" first, then "Mark Station Done" once preparing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:00:43 -07:00
John Mizerek
6cdbff129f Add takeaway/pickup order support
- getOrCreateCart: only require ServicePointID for dine-in (OrderTypeID=1)
- get.cfm + items.cfm: return OrderTypes from Businesses table
- saveOrderTypes.cfm: new endpoint to save business order type config
- KDS: add PICKUP/DELIVERY badges on order cards
- Portal: add Order Types toggle card in settings (Dine-In always on, Takeaway toggle)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:45:06 -07:00
John Mizerek
b0fa48ab64 Pass WooCommerce business info (name, address, phone) to wizard
The WooCommerce fast path was returning empty business info. Now the
Playwright script extracts it from the page and the CFML passes it through.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:18:17 -08:00
John Mizerek
41cf2820f6 Save modifier type, maxSelections, and default-checked state from WooCommerce
- checkbox groups get MaxNumSelectionReq=0 (unlimited), radio/select get 1
- Pre-checked options (e.g. preselected condiments) saved with IsCheckedByDefault=1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:47:32 -08:00
John Mizerek
8fd0ccb8da Include imageUrl on WooCommerce items for wizard image download
The wizard checks item.imageUrl to decide whether to skip the image
upload step and download images from remote URLs instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:47:06 -08:00
John Mizerek
a7138ba958 Fix loginOTP case sensitivity with preserveCaseForStructKey
The beacon app sends "Phone" (uppercase) but loginOTP.cfm checked for
"phone" (lowercase). With preserveCaseForStructKey=true this fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:12:03 -08:00
John Mizerek
8921b55c57 Fix header image preview to show full image with correct aspect ratio
Changed from cover/fixed-height to contain/aspect-ratio 3:1 so the
full 1200x400 header image is visible without cropping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:10:12 -08:00
John Mizerek
fb92748784 Add WooCommerce fast-path with Playwright modifier extraction
Detects WooCommerce sites from Playwright HTML (woocommerce, wc-add-to-cart,
tm-extra-product-options). Runs woo-modifiers.js which navigates all product
pages, extracts items with categories, and scrapes TMEPO/variation modifiers.
Falls through to Claude if extraction fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:24:22 -08:00
John Mizerek
d9262e83c0 Re-enable magic OTP on production for App Store review
The revert from the other session disabled this. 123456 must work
alongside real codes on production for Apple reviewer testing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 17:52:17 -08:00
John Pinkyfloyd
d7c9ae23ef Revert "Enable magic OTP on production for App Store review"
This reverts commit 4109e3dac4.
2026-03-06 16:39:14 -08:00
John Mizerek
b39f8bf1e8 Magic OTP: accept 123456 alongside real codes (for App Store review) 2026-03-06 16:32:39 -08:00