Commit graph

103 commits

Author SHA1 Message Date
John Mizerek
ed3f9192d5 Add Task Admin feature to portal
- Add Quick Task Templates: admin creates task shortcuts, tap to create tasks instantly
- Add Scheduled Tasks: admin defines recurring tasks with cron expressions
- New API endpoints: /api/admin/quickTasks/* and /api/admin/scheduledTasks/*
- New database tables: QuickTaskTemplates, ScheduledTaskDefinitions
- Portal UI: Task Admin page with shortcut buttons and scheduled task management

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 01:51:41 -08:00
John Mizerek
43a8d18541 Update callServer task endpoint
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 01:40:41 -08:00
John Mizerek
405914c586 Fix subtotal/itemCount null handling in history API
Use val() instead of ?: for SUM results that may be empty strings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:59:33 -08:00
John Mizerek
e9eb708de1 Fix null value handling in setOrderType API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:41:31 -08:00
John Mizerek
d783f91075 Fix null value handling in setLineItem API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:40:32 -08:00
John Mizerek
186c3fcf68 Fix null value handling in getActiveCart API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:39:25 -08:00
John Mizerek
6727f42194 Fix null/empty value handling in order APIs
Wrap numeric fields with val() to prevent "can't cast empty string to number"
errors when database values are null or empty strings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:30:13 -08:00
John Mizerek
5f3f5a7345 Enable address endpoints and switch Stripe to live mode
- Add address list/add/delete/setDefault to public endpoint allowlist
- Switch Stripe from test to live mode for production payments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:26:14 -08:00
John Mizerek
c2ae037e71 App Store Version 2: Multi-menu support, beacon lookup, category scheduling
Features:
- Multi-menu support with time-based availability
- Menu hours validation against business operating hours
- Setup wizard now creates Menu records and links categories
- New menus.cfm API for menu CRUD operations
- Category schedule filtering (day/time based visibility)
- Beacon UUID lookup API for customer app
- Parent/child business relationships for franchises
- Category listing API for menu builder

Portal improvements:
- Menu builder theming to match admin UI
- Brand color picker fix
- Header image preview improvements

API fixes:
- Filter demo/hidden businesses from restaurant list
- Improved error handling throughout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 19:51:44 -08:00
John Mizerek
72f5b7eb12 Filter out demo and hidden businesses from restaurant list
Businesses with BusinessIsDemo=1 or BusinessIsHidden=1 will not appear
in the nearby restaurants list. Hidden businesses will be searchable
in a future update.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 12:14:45 -08:00
John Mizerek
3b7225e57f Fix brand color picker - use showModal instead of openModal
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 12:02:13 -08:00
John Mizerek
046f57b302 Fix header preview to show full image with contain sizing
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 12:00:36 -08:00
John Mizerek
4c40e9a2e9 Fix portal header image by using uppercase Lucee JSON keys
Lucee's serializeJSON converts all struct keys to UPPERCASE.
Updated loadBusinessInfo to check for uppercase key variants.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 11:59:17 -08:00
John Mizerek
74b09beedf Theme menu builder to match portal admin UI and fix header image display
- Added portal sidebar navigation to menu builder
- Updated color scheme to use portal CSS variables (gray-* instead of custom vars)
- Fixed header image preview to use HeaderImageURL from API response
- Fixed upload handler to use correct extension from response
- Added sidebar toggle and logout functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 11:54:05 -08:00
John Mizerek
a2a686ae76 Pass business ID to HUD when opening from portal
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 20:41:33 -08:00
John Mizerek
3df846a31b Fix HUD business name - get from listPending API
The previous approach called getBusiness which requires auth.
Now listPending returns BUSINESS_NAME and HUD uses that.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 20:33:09 -08:00
John Mizerek
30570c3772 Add business name to HUD header, fix portal HUD link
- HUD now displays "Payfrit Tasks - <BusinessName>" by fetching from getBusiness API
- Fixed portal Task HUD button to link to /hud/index.html instead of /hud/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 20:23:52 -08:00
John Mizerek
0dc64b7868 Beacon save: auto-create service point and lt_ link, app is authoritative
- When saving a beacon, automatically create service point with same name
- Create lt_Beacon_Businesses_ServicePoints link record
- If UUID already exists, update instead of creating duplicate
- App is authoritative: reassigns beacon/servicepoint/lt_ to current business

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 14:42:38 -08:00
John Mizerek
31e71068d1 Add note about redundant BusinessID in employee table
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 14:07:58 -08:00
John Mizerek
736b19d0cf Add employee reassignment script for consolidating to VeGainz
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 14:00:29 -08:00
John Mizerek
dc50d82eee Add service points reassign script 2026-01-18 13:56:26 -08:00
John Mizerek
977fd7dffa KDS: Show restaurant name in header, remove Loading text 2026-01-18 13:54:37 -08:00
John Mizerek
849cea6404 Add expo/pickup tasks for takeaway and delivery orders when kitchen finishes 2026-01-18 13:44:55 -08:00
John Mizerek
13554c1b02 Fix user search to support name, email, and phone 2026-01-18 13:29:25 -08:00
John Mizerek
ef92c86fcc Add team member search/add with phone or email support 2026-01-18 13:27:02 -08:00
John Mizerek
108a90531e KDS: Fix station selection logic, add debug logging 2026-01-18 13:22:27 -08:00
John Mizerek
4e4f3cf465 Remove all bid URL params - use localStorage exclusively for business selection 2026-01-18 13:18:10 -08:00
John Mizerek
96e598c6af KDS: Read businessId from shared portal localStorage instead of URL params 2026-01-18 13:15:08 -08:00
John Mizerek
f51ef7bab2 Fix KDS button to use index.html 2026-01-18 13:10:03 -08:00
John Mizerek
6ead6ddbb7 Add reassign_all to public paths 2026-01-18 13:08:14 -08:00
John Mizerek
867e1c8a78 Add temp beacon reassign script 2026-01-18 13:07:27 -08:00
John Mizerek
85f64c2add Fix brand color save - escape hash symbol in CFML
Use chr(35) instead of # literal to avoid CFML variable interpolation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 12:33:18 -08:00
John Mizerek
0038c481ab Fix brand color modal cancel button and simplify API query
- Changed hideModal() to closeModal() in color picker
- Simplified queryExecute parameter handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 12:26:36 -08:00
John Mizerek
a089b89e17 Remove image resize from header upload - accept as-is
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 12:21:36 -08:00
John Mizerek
b2b54e123f Fix header upload path to use expandPath
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 12:16:48 -08:00
John Mizerek
d4e0ae1162 Add branding features: header upload and brand color picker
- Add uploadHeader.cfm API for 1200px header images
- Add saveBrandColor.cfm API for hex color storage
- Add Branding section to menu builder sidebar
- Fix header upload path and permissions
- Various beacon and service point API improvements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 12:14:24 -08:00
John Mizerek
d73c4d60d3 Fix CFML iteration bugs and improve wizard functionality
- Fix for...in loops on query results in getForBuilder.cfm (only iterated once)
- Remove illegal var keyword from loop variables in saveWizard.cfm
- Only create food running tasks for dine-in orders (skip takeaway/delivery)
- Add image preview modal for modifier source images in wizard
- Add data clearing utilities (clearAllData, clearOrders)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:40:37 -08:00
John Mizerek
3384f128e1 Fix task acceptance incorrectly marking orders as delivered
When accepting a task, the order status was being set to 4 (Delivery in progress),
which caused the order to disappear from KDS and broke auto-complete functionality.

The correct flow is:
- Order at status 3 (Ready) → Worker accepts task → Order stays at 3
- Worker completes task → Order moves to status 5 (Delivered)

Removed the order status update from accept.cfm so orders remain visible in KDS
until the delivery task is actually completed.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-16 09:55:45 -08:00
John Mizerek
ef6efa0762 Filter default modifiers from KDS display
Only show customized modifiers on the Kitchen Display System,
hiding default/unaltered selections to reduce clutter.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-16 00:29:53 -08:00
John Mizerek
fe383f40d0 Fix wizard flow and add detailed modifier view
Major Changes:
1. Fixed infinite loop in wizard flow - uncertain modifiers step now correctly advances to final review instead of looping back to items
2. Moved uncertain modifier assignment to AFTER items review (makes more sense for user to see items first)
3. Added detailed modifier visualization on uncertain modifiers step showing:
   - Source image indicator (which image the modifier was extracted from)
   - Full list of all options with prices
   - Required/optional status
   - Option count summary

Technical Details:
- Backend: Added sourceImageIndex tracking in analyzeMenuImages.cfm to record which image each modifier came from
- Frontend: Enhanced uncertain modifiers step with inline detailed view showing complete modifier structure
- Flow correction: showUncertainModifiersStep() now calls showFinalStep() instead of showItemsStep() to prevent loop
- Improved error handling in API calls with detailed error messages from Claude API

Flow Changes:
- Old: Upload → Business → Categories → Modifiers → Uncertain Modifiers → Items → [LOOP]
- New: Upload → Business → Categories → Modifiers → Items → Uncertain Modifiers → Final Review

Model Configuration:
- Using claude-sonnet-4-20250514 for menu image analysis
- Added better error reporting to surface API issues (auth, credits, etc.)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 16:53:09 -08:00
John Mizerek
8999805ec6 Add detailed modifier view with source tracking
Backend (analyzeMenuImages.cfm):
- Track which image each modifier was found on via sourceImageIndex
- Changed loop to use index to capture image number

Frontend (setup-wizard.html):
- Show detailed modifier information in expandable cards
- Display source image number for each modifier
- Show appliesTo status (category/uncertain) with badges
- Display all modifier options with prices in detail view
- Click modifier header to expand/collapse full option list
- Added comprehensive CSS for new modifier display:
  * Expandable card design with hover effects
  * Color-coded badges for source image, category assignment
  * Detailed option list with prices
  * Visual distinction for uncertain modifiers

Users can now:
- See which image each modifier came from
- View complete option list before confirming
- Understand how each modifier will be applied
- Make informed decisions about which modifiers to keep

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 16:02:03 -08:00
John Mizerek
0f36874435 Move uncertain modifier assignment step after items review
Changed wizard flow so uncertain modifiers are presented AFTER user
has reviewed all items, not before. This makes more sense because:
- User can see what items exist before deciding modifier assignments
- User understands their menu structure before making decisions
- More informed decisions about which categories need which modifiers

New flow:
1. Business info
2. Categories
3. Modifiers (select which to keep)
4. Items (review and select)
5. Uncertain modifiers (assign to categories) <- moved here
6. Final review and save

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 15:31:09 -08:00
John Mizerek
9e195b79e0 Add conversational modifier assignment for uncertain modifiers
Backend (analyzeMenuImages.cfm):
- Updated AI prompts to classify modifiers by confidence level
- Added appliesTo field: 'category', 'item', or 'uncertain'
- Added categoryName field for category-level modifiers
- Auto-assign category-level modifiers to items in that category
- Only assign item-level modifiers when clearly in item description
- Mark uncertain modifiers for user confirmation

Frontend (setup-wizard.html):
- Added showUncertainModifiersStep() between modifier and item steps
- Shows conversational prompts for each uncertain modifier
- Users can select which categories each modifier applies to
- Users can skip modifiers that don't apply automatically
- Applies user selections to items before proceeding
- Added CSS styling for category selection checkboxes

Flow:
1. AI extracts modifiers with confidence classification
2. Category-level modifiers auto-assigned to items
3. Uncertain modifiers presented one-by-one for user decision
4. User confirms or skips each uncertain modifier
5. Assignments applied to items before save

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 15:29:15 -08:00
John Mizerek
0d2634e6c4 Update AI prompts to intelligently assign modifiers to items
- Instructs Claude to look for modifiers in specific menu locations:
  category headers, item descriptions, asterisk notes, headers/footers
- Assigns modifiers to items when confident about relationships
- Only links obvious modifier-to-item connections
- Leaves uncertain relationships unlinked for manual assignment

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 15:25:23 -08:00
John Mizerek
a4fb7e7503 Show all templates in menu builder regardless of links
- Changed template query to find ALL templates for business (ItemCategoryID=0, ItemParentItemID=0)
- Previously only showed templates that were in ItemTemplateLinks
- Now shows all templates so they can be viewed and manually assigned to items
- Template children query also updated to include children of all templates

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 15:17:08 -08:00
John Mizerek
d34d88e46a Fix wizard: remove CategoryID column ref, add analysis time message
- Fixed Items table INSERT to remove CategoryID column (only exists in Categories table)
- Templates now correctly use ItemCategoryID=0 instead of incorrect CategoryID
- Added user message that analysis may take several minutes
- Updated localStorage with new businessId after save to keep user logged in
- Redirect to visual menu builder with new businessId in URL

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 15:08:53 -08:00
John Mizerek
261bab2bb6 Improve address deduplication and delete matching duplicates
- list.cfm: Use GROUP BY to show unique addresses only, removed
  BusinessID filter, simplified aggregation for better MySQL compat
- delete.cfm: Delete ALL addresses matching the same address content
  (Line1, Line2, City, State, ZIP) to keep data clean when user
  deletes a deduplicated address

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 23:11:28 -08:00
John Mizerek
b069290862 Improve menu image analysis - fix JSON error handling
Replaced inline string concatenation with proper struct serialization
for error messages in Claude API calls to avoid JSON escaping issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 23:08:35 -08:00
John Mizerek
307c443f56 Add addresses debug endpoint 2026-01-14 22:28:16 -08:00
John Mizerek
f98eaa4ba1 Fix null date handling in order history API
Safely handle null/empty OrderAddedOn and OrderLastEditedOn fields
that were causing server errors when formatting dates.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 21:36:18 -08:00