Commit graph

40 commits

Author SHA1 Message Date
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
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
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
ef92c86fcc Add team member search/add with phone or email support 2026-01-18 13:27:02 -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
f51ef7bab2 Fix KDS button to use index.html 2026-01-18 13:10:03 -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
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
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
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
8d5c0cc6ac Add menu setup wizard with Claude Vision integration
- 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>
2026-01-14 16:02:21 -08:00
John Mizerek
f40d5c1f93 Fix modifier move: use Shift key and dataTransfer data instead of effectAllowed 2026-01-14 12:57:34 -08:00
John Mizerek
ff6e4f2a36 Fix missing closing brace in item drag handler 2026-01-14 12:52:46 -08:00
John Mizerek
b6c1569add Fix syntax error in item card onclick handler 2026-01-14 12:39:30 -08:00
John Mizerek
85510a7647 Fix template loading state stuck on 'Loading templates...' 2026-01-14 12:27:40 -08:00
John Mizerek
fb329727d2 Add drag-and-drop for modifiers at all levels
- Modifiers can be dragged and dropped to reorder within same parent
- Modifiers can be dropped on other modifiers (same or different parent)
- Modifiers can be dropped on items to add as top-level modifier
- Default action is COPY (drag creates a copy)
- Hold Ctrl+Alt while dragging to MOVE instead of copy
- Deep cloning preserves nested options with new IDs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:15:44 -08:00
John Mizerek
12b47c3e41 Add accordion behavior to menu builder for all levels
- Categories: Only one category expanded at a time
- Items: Click item to expand/collapse modifiers
- Modifiers: Click modifier with sub-options to expand/collapse nested options
- Clicking a new parent auto-collapses siblings at that level

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 11:40:52 -08:00
John Mizerek
0a10380639 Add template modifier support and fix KDS breadcrumbs
- 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>
2026-01-12 18:45:06 -08:00
John Mizerek
ccb27f679f Show EmployeeStatusID status instead of IsActive flag
- Display Pending/Invited/Active/Suspended from EmployeeStatusID
- Add CSS for pending and suspended status badges
- Update getStatusClass to handle employee status codes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 18:01:30 -08:00
John Mizerek
0b17d35b31 Add active/inactive status badge CSS styles
- Green background for active employees
- Red background for inactive employees

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 17:59:56 -08:00
John Mizerek
e586a62a95 Add phone column to team table, add duplicate cleanup script
- 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>
2026-01-11 17:32:07 -08:00
John Mizerek
b9f5eb834f Add hiring toggle functionality to portal Team page
- 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>
2026-01-11 17:13:59 -08:00
John Mizerek
8de677ad9e Add debug logging to team loading 2026-01-11 17:08:58 -08:00
John Mizerek
4fdb7fca94 Implement team loading in portal
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 17:06:37 -08:00
John Mizerek
e757a4140b Add drink modifiers, unified schema improvements, and portal fixes
Menu System:
- Unified schema with Categories table integration
- Virtual category headers with proper parent ID remapping
- Filter out legacy category headers when using new schema
- Add drink modifier endpoints for Fountain Soda (Size/Flavor)

Admin Tools:
- addDrinkModifiers.cfm - Add size/flavor modifiers to drinks
- copyDrinksToBigDeans.cfm - Copy drink items between businesses
- debugDrinkStructure.cfm - Debug drink item hierarchy

Portal:
- Station assignment improvements with better drag-drop
- Enhanced debug task viewer

API Fixes:
- Application.cfm updated with new admin endpoint allowlist
- setLineItem.cfm formatting cleanup
- listMine.cfm task query fixes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 20:30:58 -08:00
John Mizerek
634148f727 Add Categories table support, KDS station selection, and portal fixes
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>
2026-01-07 15:31:45 -08:00
John Mizerek
ec81af5cdd Add business info, order details, beacon management, and admin tools
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>
2026-01-07 11:45:21 -08:00
John Mizerek
d225133c68 Add menu builder required selection UI and fix portal issues
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>
2026-01-05 01:56:12 -08:00
John Mizerek
51a80b537d Add local dev support and fix menu builder API
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>
2026-01-04 22:47:12 -08:00
John Mizerek
1f4d06edba Add Payfrit Works (WDS) support and task completion flow
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>
2026-01-03 14:52:04 -08:00
John Mizerek
0765dc1e27 Add business portal, Stripe Connect, beacon APIs, and task system
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>
2026-01-01 23:38:26 -08:00