- Changed hideModal() to closeModal() in color picker
- Simplified queryExecute parameter handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
- 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>
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>
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>
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>
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>
- 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>
- 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>
- 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>
- 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>
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>
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>
- New setup-wizard.html: conversational wizard for uploading menu images
- analyzeMenuImages.cfm: sends images to Claude API, returns structured menu data
- saveWizard.cfm: saves extracted menu to database (categories, items, modifiers)
- Added Setup Wizard button to portal Menu page
- Added .gitignore for config files with secrets
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Updated listForKDS.cfm to include OrderTypeName in response
- Added getLocationLabel/getLocationValue helpers in kds.js
- Takeaway orders now show "Type: Takeaway"
- Delivery orders now show "Type: Delivery"
- Dine-in orders continue to show "Table: [name]"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Auto-expire stale chats older than 20 minutes in createChat.cfm
- Add expireStaleChats.cfm for scheduled cleanup
- Add abandonOrder.cfm for Start Fresh functionality
- Add closeAllChats action to debugTasks.cfm
- Fix setOrderType NULL value for non-delivery orders
- Add ForceNew parameter to setLineItem for customized items
- Add public endpoint allowlist entries for new endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
createPaymentIntent.cfm now fetches the order's delivery fee
and includes it in the total amount charged to the customer.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
loadCartPayload now includes ItemName, ItemParentName, and
ItemIsCheckedByDefault so the cart displays proper breadcrumbs
immediately after adding items.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
getCart.cfm now returns ItemName, ItemParentName, and
ItemIsCheckedByDefault for each line item, enabling the
Flutter app to display modifier breadcrumbs like
"Select Drink: Coke" without needing a separate menu lookup.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- setLineItem.cfm: Attach default children from ItemTemplateLinks
(fixes drink choices not being saved for combos)
- listForKDS.cfm: Include ItemParentName for modifier categories
- kds.js: Display modifiers as "Category: Selection" format
- Various other accumulated fixes for menu builder, orders, and admin
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Cast BIT(1) to UNSIGNED INT in SQL and use val() for comparison
to correctly handle MySQL bit fields in ColdFusion/Lucee.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace Role column with Phone column in team table
- Add formatPhone() helper to format phone numbers nicely
- Add cleanupDuplicateEmployees.cfm admin script to remove duplicates
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add setHiring.cfm API endpoint to update BusinessIsHiring
- Add endpoint to Application.cfm allowlist
- Update portal.js to load and sync hiring toggle state
- Wire toggle to call API and show feedback toasts
- Bump portal.js version for cache busting
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add avatar.cfm: GET/POST for user profile photos with multi-extension support
- Add profile.cfm: GET/POST for user profile (name, email, phone)
- Add history.cfm: Order history endpoint with pagination
- Add addresses/list.cfm and add.cfm: Delivery address management
- Add setOrderType.cfm: Set delivery/takeaway type on orders
- Add checkToken.cfm: Debug endpoint for token validation
- Fix headerValue() in Application.cfm to use servlet request object
(Lucee CGI scope doesn't expose custom HTTP headers like X-User-Token)
- Update public allowlist for new endpoints
- Add privacy.html page
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Categories Migration:
- Add ItemCategoryID column to Items table (api/admin/addItemCategoryColumn.cfm)
- Migration script to populate Categories from unified schema (api/admin/migrateToCategories.cfm)
- Updated items.cfm and getForBuilder.cfm to use Categories table with fallback
KDS Station Selection:
- KDS now prompts for station selection on load (Kitchen, Bar, or All Stations)
- Station filter persists in localStorage
- Updated listForKDS.cfm to filter orders by station
- Simplified KDS UI with station badge in header
Portal Improvements:
- Fixed drag-and-drop in station assignment (proper event propagation)
- Fixed Back button links to use BASE_PATH for local development
- Added console logging for debugging station assignment
- Order detail API now calculates Subtotal, Tax, Tip, Total properly
Admin Tools:
- setupBigDeansStations.cfm - Create Kitchen and Bar stations for Big Dean's
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
API Improvements:
- api/businesses/get.cfm: Fetch address from Addresses table, hours from Hours table
- api/tasks/getDetails.cfm: Add CustomerPhone field from UserContactNumber
- api/orders/getDetail.cfm: New endpoint for order details with line items
- api/Application.cfm: Add new admin endpoints to public allowlist
Admin Tools:
- api/admin/beaconStatus.cfm: View all beacon-to-business mappings
- api/admin/updateBeaconMapping.cfm: Change beacon business assignment
- api/admin/setupBigDeansInfo.cfm: Set Big Dean's address and hours
- api/admin/listTables.cfm: List all database tables
- api/admin/describeTable.cfm: Get table structure and sample data
- api/admin/randomizePrices.cfm: Randomize item prices for testing
- Various Big Dean's debug/update scripts
Portal Enhancements:
- Enhanced CSS styling for portal pages
- Improved portal.js functionality
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New endpoint: api/tasks/getDetails.cfm
- Returns task info, customer info, service point, order line items
- Joins Tasks, Orders, Users, ServicePoints, OrderLineItems tables
- Add getDetails.cfm to public endpoints allowlist in Application.cfm
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Menu Builder - Required Selections:
- Added "Selection Rules" section for modifier groups
- Required (Yes/No) dropdown to mark if customer must select an option
- Max Selections input (0 = unlimited) to limit selections
- Visual "Required" badge (red) and "Max X" badge in modifier list
- Updated saveFromBuilder.cfm to persist ItemRequiresChildSelection
and ItemMaxNumSelectionReq to database
Portal Fixes:
- Fixed menu-builder link to include BASE_PATH for local dev
- Fixed stats.cfm to not reference non-existent Categories table
- Menu items count now uses ItemParentItemID > 0 (not ItemCategoryID)
Stripe Configuration:
- Added api/config/stripe.cfm for centralized Stripe key management
- Supports test/live mode switching
- Fee configuration variables (5% customer, 5% business, 2.9% + $0.30 card)
Payment Intent API:
- Updated createPaymentIntent.cfm with proper fee structure
- Customer pays: subtotal + tax + tip + 5% Payfrit fee + card processing
- Platform receives 10% total (5% from customer + 5% from business)
- Saves fee breakdown to order record
Beacon Management:
- Updated switchBeacons.cfm to move beacons between businesses
- Currently configured: Big Dean's (27) -> In-N-Out (17)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Portal local development:
- Add BASE_PATH detection to all portal files (login, portal.js, menu-builder, station-assignment)
- Allows portal to work at /biz.payfrit.com/ path locally
Menu Builder fixes:
- Fix duplicate template options in getForBuilder.cfm query
- Filter template children by business ID with DISTINCT
New APIs:
- api/portal/myBusinesses.cfm - List businesses for logged-in user
- api/stations/list.cfm - List KDS stations
- api/menu/updateStations.cfm - Update item station assignments
- api/setup/reimportBigDeans.cfm - Full Big Dean's menu import script
Admin utilities:
- Various debug and migration scripts for menu/template management
- Beacon switching, category cleanup, modifier template setup
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Task System:
- Tasks auto-created when KDS marks order Ready (status 3)
- Duplicate task prevention via TaskOrderID check
- Task completion now marks associated order as Completed (status 4)
- Fixed isNull() check for TaskCompletedOn (use len() instead)
- Added TaskOrderID to task queries for order linking
Worker APIs:
- api/workers/myBusinesses.cfm with GROUP BY to prevent duplicates
- api/tasks/listMine.cfm for worker's claimed tasks with filters
- api/tasks/complete.cfm updates both task and order status
- api/tasks/accept.cfm for claiming tasks
KDS/Portal:
- KDS only shows orders with status < 4
- Portal dashboard improvements
Admin/Debug:
- Debug endpoints for tasks and businesses
- Test data reset endpoint
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Portal:
- New business portal UI (portal/index.html, portal.css, portal.js)
- Dashboard with real-time stats (orders today, revenue, pending, menu items)
- Business info endpoint (api/businesses/get.cfm)
- Portal stats endpoint (api/portal/stats.cfm)
- Menu page links to existing full-featured menu editor
Stripe Connect:
- Onboarding endpoint (api/stripe/onboard.cfm)
- Status check endpoint (api/stripe/status.cfm)
- Payment intent creation (api/stripe/createPaymentIntent.cfm)
- Webhook handler (api/stripe/webhook.cfm)
Beacon APIs:
- List all beacons (api/beacons/list_all.cfm)
- Get business from beacon (api/beacons/getBusinessFromBeacon.cfm)
Task System:
- List pending tasks (api/tasks/listPending.cfm)
- Accept task (api/tasks/accept.cfm)
Other:
- HUD interface for quick order status display
- KDS debug/test pages
- Updated Application.cfm with public endpoint allowlist
- Order status check improvements
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
API Changes:
- checkStatusUpdate.cfm: Fixed to use OrderStatusID != 7 instead of non-existent OrderIsDeleted column
- Application.cfm: Added checkStatusUpdate.cfm to public API allowlist
- getOrCreateCart.cfm: Fixed delivery fee to only apply for OrderTypeID = 2 (delivery)
Order Type Logic:
- 1 = Dine-in (no delivery fee)
- 2 = Delivery (delivery fee applied)
- 3 = Takeaway (no delivery fee)
- 4 = Ship-to (no delivery fee)
Status Translation:
- Uses OrderStatusID != 7 to filter deleted orders (tt_OrderStatuses table)
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Backend changes:
- New API endpoint: checkStatusUpdate.cfm - polls order status and detects changes
- Updated admin.html: added test section for manually updating order status
- Status flow: 1(submitted) → 2(preparing) → 3(ready) → 4(completed)
- Human-readable status messages for each state
Testing interface:
- Order ID input field
- Status dropdown selector
- Direct integration with existing updateStatus.cfm endpoint
This enables real-time status notifications for customer orders with 30-second polling interval (Option 2 approach, with planned migration to self-hosted push).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>