Commit graph

123 commits

Author SHA1 Message Date
John Mizerek
ffedc26150 Add subcategories stat row to menu summary card in setup wizard
Shows subcategory count as a separate indented row beneath categories
when subcategories are present.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:37:27 -08:00
John Mizerek
3c0311c1d5 Fix header image preview aspect ratio in setup wizard
Changed from fixed 120px height to aspect-ratio 3:1 to match the
recommended 1200x400 dimensions, preventing heavy cropping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:36:00 -08:00
John Mizerek
495b03c76d Add subcategory detection to wizard URL analyzer and display
- analyzeMenuUrl.cfm: Detect subcategories from Toast subgroups and
  Claude API responses, preserve hierarchy with parentCategoryName
- setup-wizard.html: Display subcategories indented under parents
  throughout wizard flow (categories step, items review, summary, preview)
- menu-builder.html: Show subcategories nested in outline modal view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:08:59 -08:00
John Mizerek
3ccc82c9f2 Add subcategory support (2 levels deep)
- saveCategory.cfm: Accept ParentCategoryID, enforce max 2-level nesting
- items.cfm: Include ParentCategoryID on virtual category rows for Android
- getForBuilder.cfm: Return ParentCategoryID in builder API response
- saveFromBuilder.cfm: Persist ParentCategoryID on save, track JS-to-DB id mapping
- saveWizard.cfm: Two-pass category creation (parents first, then subcategories)
- menu-builder.html: Parent category dropdown in properties, visual nesting in canvas,
  add subcategory button, renderItemCard() extracted for reuse

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:29:40 -08:00
John Mizerek
d1910a7d34 Add staff role system: Staff keeps cash, Manager/Admin collect for restaurant
- Create tt_StaffRoles lookup table (Staff, Manager, Admin)
- Add RoleID column to Employees table (default: Staff)
- Wire portal role dropdown to addTeamMember API
- Return RoleName in team list and RoleID to Android
- Skip worker payout ledger and cash_debit for Manager/Admin roles
  on cash task completion (they collect on behalf of the restaurant)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:19:22 -08:00
John Mizerek
4c0479db5c Add Open Tabs feature: tab APIs, presence tracking, shared tabs, cron, portal settings
- New api/tabs/ directory with 13 endpoints: open, close, cancel, get, getActive,
  addOrder, increaseAuth, addMember, removeMember, getPresence, approveOrder,
  rejectOrder, pendingOrders
- New api/presence/heartbeat.cfm for beacon-based user presence tracking
- New cron/expireTabs.cfm for idle tab expiry and presence cleanup
- Modified submit.cfm for tab-aware order submission (skip payment, update running total)
- Modified getOrCreateCart.cfm to auto-detect active tab and set TabID on new carts
- Modified webhook.cfm to handle tab capture events (metadata type=tab_close)
- Modified businesses/get.cfm and updateTabs.cfm with new tab config columns
- Updated portal tab settings UI with auth amounts, max members, approval toggle
- Added tab and presence endpoints to Application.cfm public allowlist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 20:56:07 -08:00
John Mizerek
0e603b6cc9 Fix refresh button: add inline onclick and center icon
The addEventListener wasn't firing (likely cached JS). Added inline
onclick as reliable fallback and flexbox centering for the SVG icon.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-24 12:51:02 -08:00
John Mizerek
194eb4d205 Fix beacon Minor 0 not displaying in service points page
b.Minor is 0 for the first beacon which is falsy in JS.
Changed to null check so Minor: 0 displays correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-24 12:47:20 -08:00
John Mizerek
57ef40f737 Add click handler for refresh button in portal
The refresh button in the top bar had no click handler attached.
Now it reloads the current page data when clicked.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-23 14:13:47 -08:00
John Mizerek
e8705287cc Fix JS syntax error: remove escaped backticks in addModifierOption
The escaped backticks (\`) were causing "invalid escape sequence" error,
breaking the entire script and making the Upload Files button non-functional.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-20 16:34:31 -08:00
John Mizerek
b360284e56 Beacon delete fix, price extraction, tax rate lookup, add modifiers form 2026-02-14 19:17:48 -08:00
John Mizerek
76f089d1b9 Auto-populate tax rate from ZIP code using API Ninjas
When business info step loads with a ZIP code, automatically looks up
the combined sales tax rate and pre-fills the field. User can still
edit if needed. Field gets light green background to indicate auto-fill.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 11:52:56 -08:00
John Mizerek
fb21b0c58d Add debug logging to showItemsStep and confirmItems 2026-02-13 09:41:35 -08:00
John Mizerek
682cb41ff1 Fix: Handle items with unmatched categories in showItemsStep
Items were being grouped only by known categories. If the category
array was empty or didn't include an item's category, those items
never got checkboxes rendered, causing confirmItems() to filter
them all out.

Now collects unassigned items and groups them by their category
name (or 'Menu' as fallback).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 09:38:53 -08:00
John Mizerek
157749060e Add debug logging and fix protocol-relative URL check
Log sample imageUrls to console to debug why upload step is shown.
Also handle protocol-relative URLs (//domain.com/...).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 09:02:32 -08:00
John Mizerek
91c34d120f Skip image upload step when items have remote image URLs
Items from Toast menus have CDN URLs (https://img.cdn4dd.com/...) which
saveWizard.cfm will download automatically. No need to prompt user
to upload images when remote URLs are already present.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 09:01:32 -08:00
John Mizerek
5cde8ce4fa ZIP upload: add file sanitization, direct file read, and temp cleanup
- uploadSavedPage.cfm: sanitize extracted files (whitelist safe extensions,
  delete symlinks) to protect against malicious content from infected sites
- analyzeMenuUrl.cfm: detect local temp URLs and read directly from disk,
  bypassing Playwright for faster processing of saved pages
- saveWizard.cfm: delete temp folder immediately after wizard completes
  instead of waiting for 1-hour auto-cleanup
- setup-wizard.html: track temp folder ID and pass to saveWizard for cleanup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:02:41 -08:00
John Mizerek
3df4659830 Add debug logging for ZIP upload response
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 07:11:43 -08:00
John Mizerek
8aeca335fd Add ZIP upload for saved webpage import
For Cloudflare-protected sites, users can now:
1. Save the page from their browser (Webpage, Complete)
2. ZIP the HTML and assets folder
3. Upload the ZIP in the wizard
4. Server extracts to temp folder, Playwright scans local copy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 07:02:51 -08:00
John Mizerek
40c91c82cf Fix add new business link to point to setup-wizard.html
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 21:12:02 -08:00
John Mizerek
f8afbb57e9 Add bulk item image upload: accept all sizes, pick best, upload after save 2026-02-12 20:56:27 -08:00
John Mizerek
04f65e3495 Fix image matching to use Toast item ID from filename, not alt text 2026-02-12 20:51:37 -08:00
John Mizerek
f882e84704 Add image type breakdown to setup wizard summary 2026-02-12 20:44:42 -08:00
John Mizerek
1a7c342ac9 Remove manual image upload step - use automatic matching 2026-02-12 20:36:43 -08:00
John Mizerek
112f343ecf Fix wizard: header preview uses cover, add image matching step after HTML import 2026-02-12 20:31:29 -08:00
John Mizerek
813628cecb Add HTML file upload option for menu import
- Backend now accepts either url or html content in request body
- Frontend adds HTML file upload option below URL input
- Useful when websites block the crawler (403 errors)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 17:13:32 -08:00
John Mizerek
f6518932db Add URL-based menu import to setup wizard 2026-02-12 16:43:37 -08:00
John Mizerek
800d1f1246 Add brand color extraction and auto-header detection to setup wizard 2026-02-12 14:20:35 -08:00
John Mizerek
0d04ae8463 Resolve merge conflict in myBusinesses.cfm - keep ActiveTaskCount 2026-02-11 22:33:44 -08:00
John Mizerek
48bdbb362e Remove task categories from portal, fix HUD color logic
- Remove Task Categories section from Task Admin page (deprecated)
- Simplify HUD getCategoryColor() to use TaskTypeColor directly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 19:04:25 -08:00
John Mizerek
a318b8668f Fix cart/tax issues and add menu item thumbnails
- uploadItemPhoto: Add EXIF orientation fix, generate thumb/medium/full sizes
- getActiveCart: Disable old cart lookup (always returns no cart)
- getOrCreateCart: Always create fresh cart instead of reusing old ones
- getCart: Add IsDeleted filter, calculate subtotal/tax/total server-side
- getDetail: Remove default 8.25% tax rate (business must configure)
- menu-builder: Add lightbox for full-size images, use thumbnail URLs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 14:22:54 -08:00
John Mizerek
946c2ebdf0 Add modal-based photo upload for better mobile support
- Show a modal with file input and preview
- Uses alert() instead of toast for error messages (more visible on mobile)
- Preview shows selected image before upload
- Submit button with loading state
- Keeps old uploadPhoto function for compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 13:08:24 -08:00
John Mizerek
cab561a20e Fix photo upload on mobile - prevent page reload issue
- Use persistent file input instead of dynamically created one
- Store pending upload info in sessionStorage for mobile camera flow
- Use simpler accept="image/*" for better mobile compatibility
- Handle case where page context is lost after camera returns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 13:06:47 -08:00
John Mizerek
9fc984bea3 Fix photo upload on mobile devices
- Add HEIC/HEIF support for iPhone camera photos
- Make frontend file type validation more permissive for mobile browsers
- Add 'capture' attribute to prefer rear camera on mobile
- Include actual file extension in error messages for debugging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 12:56:50 -08:00
John Mizerek
3d59a2e5cd Fix service point delete using wrong ID field
The API returns ServicePointID but portal.js was using sp.ID which was undefined.
Changed all sp.ID references to sp.ServicePointID.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:32:43 -08:00
John Mizerek
2023e1b5d9 Setup wizard and tasks updates
- Setup wizard save improvements
- Call server task updates
- Task creation changes
- Portal JS updates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 15:18:01 -08:00
John Mizerek
930394b421 Fix signup to redirect to login for business selection
Instead of auto-selecting first business, redirect to login.html
which shows the business selection dropdown for users with multiple businesses.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 14:16:43 -08:00
John Mizerek
87ff082279 Fix header preview background to white
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 20:15:20 -08:00
John Mizerek
31a89018f5 Launch prep: fix menu builder, payment flow, comment out pre-launch features
- Fix menu builder dropdown showing empty names (return MenuName instead of Name)
- Add default menu selection (setDefault action, DefaultMenuID in getForBuilder)
- Fix createPaymentIntent column names for dev schema (ID, StripeAccountID, etc.)
- Fix menu-builder favicon and remove redundant business label
- Comment out Tabs/Running Checks feature for launch (HTML + JS)
- Comment out Service Point Marketing/Grants feature for launch (HTML + JS)
- Add testMarkPaid.cfm for testing orders without Stripe webhooks
- Task API updates for worker payout ledger integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:18:33 -08:00
John Mizerek
d7632c5d35 Menu builder and portal updates
- Menu builder UI improvements
- Portal CSS and JS updates
- Station assignment updates
- Add business tabs update endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:08:54 -08:00
John
16a3b7c9a3 Replace queryExecute with queryTimed across all endpoints for perf tracking
Converts 200+ endpoint files to use queryTimed() wrapper which tracks
DB query count and execution time. Restores perf dashboard files that
were accidentally moved to _scripts/. Includes portal UI updates.
2026-02-02 00:28:37 -08:00
John Mizerek
f52d14bb7e Add Service Point Sharing infrastructure
Grant-based system allowing businesses to share service points with
other businesses. Includes grant CRUD API, time/eligibility/economics
policies, enforcement at cart creation and order submit, Stripe payment
routing for owner fees, and portal UI for managing grants.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:34:03 -08:00
John Mizerek
4dfd0db833 Make menu-builder sidebar consistent with portal index
Move business card to top, remove logout button and sidebar-footer,
add missing Task Admin nav item.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:48:42 -08:00
John Mizerek
87e38649c4 Use business name initial for user avatar instead of first name
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:47:02 -08:00
John Mizerek
7b19979118 Show user's first initial in profile avatar instead of hardcoded U
Save FirstName to localStorage on login (both OTP and password paths).
Portal reads it back and displays the first letter in the user avatar.
Falls back to 'U' if no name is stored. Cleared on logout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:38:36 -08:00
John Mizerek
05a52c6159 Move business card to top of sidebar, remove empty footer
Business info card now sits between the Payfrit logo and the nav links.
Sidebar footer removed entirely.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:29:02 -08:00
John Mizerek
e4afa61f13 Remove Switch/Add Business from sidebar footer
These actions are now only in the user dropdown menu in the top-right.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:28:16 -08:00
John Mizerek
fcfaa5b869 Move Switch/Add Business to user dropdown, remove sidebar logout
User icon dropdown now has: Settings, Switch Business, Add New Business,
Logout. Removed redundant logout from sidebar footer.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:27:16 -08:00
John Mizerek
d6478da03f Fix brand color display and header upload collision
- Brand color: add # prefix when loading from DB (stored without #,
  CSS needs it for backgroundColor)
- Header upload: delete destination file before rename to prevent
  collision when re-uploading same extension
- Header preview: prepend BASE_PATH to image URL for local dev

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:10:45 -08:00
John Mizerek
db90d9911a Add OTP email login to business portal
Replace default password login with email-based OTP flow. User enters
email, receives 6-digit code, enters it to log in. Password login
retained as fallback via link. On dev, magic OTP code is shown directly
for easy testing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:03:40 -08:00