Commit graph

133 commits

Author SHA1 Message Date
John Mizerek
ec6bfdd9c9 Fix menu save: javaCast null breaks variable access in Lucee 7
javaCast('null','') makes the variable truly undefined, causing
'variable doesn't exist' errors when referenced in query params.
Use empty string + len() check instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:33:21 -08:00
John Mizerek
2fc30b8568 Fix add-menu wizard: skip hours validation, show menu name, hide irrelevant sections
- Pass menuName in redirect URL from menu-builder
- Show menu name in wizard header and final review
- Skip hours validation in both JS and backend for add-menu mode
- Hide menu name, hours, and community meal fields in final step
- Add id to community meal card for toggling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:19:55 -08:00
John Mizerek
02a19f52be Add menu wizard flow: redirect to setup wizard after creating a new menu
When a new menu is created in Manage Menus, the user is now redirected
to the setup wizard with businessId and menuId params. The wizard skips
business info/header steps and goes straight to photo upload + category
extraction. Backend uses the provided menuId instead of creating a new
menu. Also removes temp debug from menus.cfm.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:08:31 -08:00
John Mizerek
65cf855ade Add menu/menus.cfm to public paths so menu save works
The endpoint was missing from the public paths whitelist in
Application.cfm, causing all requests to fail with not_logged_in.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:57:51 -08:00
John Mizerek
df64f161f3 Add debug tagcontext to menu save error response (temporary)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:56:00 -08:00
John Mizerek
6b4e5cc369 Add cfsqltype hints for nullable time params in menu save
Fixes save failure when MenuStartTime/MenuEndTime are null -
Lucee couldn't determine the SQL type without explicit hints.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:53:34 -08:00
John Mizerek
38b13b5bd9 Fix blank Manage Menus modal by setting title/body before showing
showMenuManager() was passing arguments to showModal() which accepts
none, so the modal content was silently discarded. Now follows the
same pattern as all other modal callers in the file.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:39:23 -08:00
John Mizerek
c6a45f7024 Fix CFML hash escaping in brand color migration script
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:17:46 -08:00
John Mizerek
b75eb8530a Fix header image spec: 1200x400 not 1220x400
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:16:42 -08:00
John Mizerek
7bba0fb511 Add one-time script to strip # from existing brand colors
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:11:01 -08:00
John Mizerek
cc96d891b2 Store brand color without # prefix, normalize on output
saveBrandColor.cfm no longer prepends # before storing. API responses
(get.cfm, items.cfm, getForBuilder.cfm) prepend # if missing so
consumers always get a CSS-ready value.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:58:58 -08:00
John Mizerek
8f9da2fbf0 Add Manage Menus toolbar button, photo upload, and various improvements
- Move menu manager button to toolbar next to Save Menu for visibility
- Implement server-side photo upload for menu items
- Strip base64 data URLs from save payload to reduce size
- Add scheduled tasks, quick tasks, ratings, and task categories APIs
- Add vertical support and brand color features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:43:41 -08:00
John Mizerek
0d3c381ed6 Add about.cfm API endpoint for mobile app About screennAdds server-side content for About Payfrit screen allowing content updates without releasing new app versions.nCo-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> 2026-01-28 00:38:58 -08:00
John Mizerek
400df7624f Simplify address API - delivery addresses only
- Remove TypeID/Label from list response
- Hardcode TypeID=2 (delivery) in add endpoint
- Filter to personal addresses only (BusinessID=0 or NULL)
- Just IsDefault flag, no home/work labels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 00:12:18 -08:00
John Mizerek
6d5620d513 Filter out business addresses from user address list 2026-01-28 00:02:25 -08:00
John Mizerek
cadc66e46a Add address types endpoint, fix dev mode SMS skip
- Add /addresses/types.cfm - returns address types list
- Update /addresses/list.cfm - include TypeID in response
- Update /addresses/add.cfm - accept TypeID instead of hardcoded '2'
- Fix loginOTP.cfm and sendOTP.cfm to skip Twilio SMS on dev server

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 00:00:01 -08:00
John Mizerek
477cf6b8b5 Auto-login single-business users, add switch/add business links
- Skip business selection for users with only one business
- Add Switch Business and Add New Business links in portal sidebar
- Handle returning users switching businesses (token + no business)
2026-01-27 21:49:08 -08:00
John Mizerek
80aa65d7fa Fix populateBusinessSelect - remove continueBtn references
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:38:52 -08:00
John Mizerek
6f0229247f Fix login - remove orphaned businessForm event listener
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:38:08 -08:00
John Mizerek
51e979a679 Remove URL params - use localStorage for auth
- HUD reads businessId from localStorage instead of ?b= param
- Portal opens HUD/quick-tasks without URL params
- Business select auto-proceeds on selection (no button needed)
- Quick tasks reads from payfrit_portal_business localStorage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:32:47 -08:00
John Mizerek
f96d8f4fe3 Update HUD default business to 47
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:27:45 -08:00
John Mizerek
49ef916f34 Remove demo mode from HUD, fix task creation timezone
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:25:05 -08:00
John Mizerek
d4cc4b4a6c Fix service bell task creation for Android app
- Update create.cfm to handle TaskTypeID for service bell tasks
- Update hud.js to prefer TaskTypeColor/TaskTypeName for task display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 20:52:59 -08:00
John Mizerek
c5ebb24b39 Fix completeProfile.cfm syntax error
Use mail() service inside cfscript instead of cfmail tag

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:33:40 -08:00
John Mizerek
3ceedaa818 Show magic OTP 123456 on dev signup page
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:32:23 -08:00
John Mizerek
a16e8668a8 Add auth redirect to portal index
Redirects unauthenticated users to signup.html

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 13:26:30 -08:00
John Mizerek
16f63bebe5 Fix seedData.cfm: remove UserEmail column reference
Users table doesn't have email column.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:44:53 -08:00
John Mizerek
3a683751b8 Allow public access to /api/dev/ endpoints
Dev endpoints have their own isDevEnvironment check inside.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:41:26 -08:00
John Mizerek
05cf73446f Add dev environment configuration and tools
- api/config/environment.cfm: Central config for dev vs prod settings
  - Verbose errors, debug logging, magic OTP bypass
  - Rate limiting toggle, email catch-all, token expiry settings
- api/dev/: Development-only endpoints
  - seedData.cfm: Create/reset test users
  - timeTravel.cfm: Manipulate timestamps for testing
  - index.cfm: Dev tools index

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:39:28 -08:00
John Mizerek
8e3bb681e7 Add OTP-based signup page for website onboarding
- New portal/signup.html with phone → OTP → profile flow
- Handle both new users (signup) and existing users (login)
- Auto-detect user type and use appropriate API endpoints
- Show DEV_OTP on page for local testing
- Updated sendOTP.cfm to gracefully handle missing Twilio

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 11:49:44 -08:00
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