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>
- 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>
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>
The user icon in the top-right header now opens a dropdown
with Settings and Logout links, making both accessible on mobile
where the sidebar is hidden.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Lucee serializeJSON casing varies by server config (preserveCaseForStructKey).
Normalize all biz object keys to uppercase on the JS side so lookups
work regardless of server config.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Hide wrapper div instead of img (avoids mobile empty-src issues)
- Use img onload handler to show wrapper after image loads
- Use backgroundColor instead of background shorthand for swatch
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Header preview: max-width 1200px, white background, no border-radius on img
- Brand color swatch: change span to div with min-width/min-height and
flex-shrink:0 to prevent collapse on mobile flex layouts
- Remove headerPreviewWrapper brand color tinting (wrapper stays white)
- Fix swatch border from white-alpha to black-alpha for visibility on white cards
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CSS background-image with padding-bottom trick for aspect ratio was not
rendering on mobile. Using an actual <img> element with width:100% is
universally reliable across all browsers and devices.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace fixed 120px height with aspect-ratio padding (33.3%) so image
scales properly on narrow mobile screens
- Use background-size: cover instead of contain for better fill
- Add wrapper div that shows brand color behind the header image
- Update saveBrandColor to also update the header wrapper background
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- tasks/accept.cfm: WHERE TaskID → WHERE ID
- tasks/completeChat.cfm: WHERE TaskID → WHERE ID
- tasks/expireStaleChats.cfm: WHERE TaskID → WHERE ID
- cron/expireStaleChats.cfm: WHERE TaskID → WHERE ID
- chat/closeChat.cfm: WHERE TaskID → WHERE ID
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- uploadHeader.cfm: WHERE BusinessID → WHERE ID (Businesses table PK)
- onboard.cfm: WHERE BusinessID → WHERE ID, BusinessStripeOnboardingStarted → StripeOnboardingStarted
- createPaymentIntent.cfm: WHERE BusinessID → WHERE ID, OrderDeliveryFee → DeliveryFee, WHERE OrderID → WHERE ID
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
settingName -> settingBusinessName, settingLine1 -> settingAddressLine1
to match actual HTML element IDs. The mismatch caused null reference
errors that broke the entire settings page load.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Only quickTasks/ and scheduledTasks/ subdirectories remain tracked
since those are actively used by the portal.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Hours query was still using HoursDayID, HoursOpenTime etc. which
don't exist in payfrit_dev. Now uses DayID, OpenTime, ClosingTime.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated 70 files to match the payfrit_dev schema where columns like
BusinessName→Name, UserFirstName→FirstName, AddressCity→City, etc.
PKs renamed to ID, FKs keep referenced table name (e.g. BusinessID).
SQL aliases preserve original JSON response keys for API compatibility.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated all remaining SQL queries to use correct prefixed column names for
ServicePoints, Users, Businesses, Addresses, tt_States, tt_Days, and Hours
tables across 23 admin/infrastructure API files.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated Users (UserID, UserFirstName, UserLastName, UserEmailAddress, UserContactNumber),
ServicePoints (ServicePointID, ServicePointName, ServicePointTypeID), and Businesses
(BusinessID, BusinessName, BusinessTaxRate, BusinessPhone) column references with proper
prefixed names and AS aliases for API compatibility.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All lookup/reference tables use prefixed column names (tt_StateID, tt_StateAbbreviation,
tt_DayID, tt_DayAbbrev, tt_OrderTypeID, tt_OrderTypeName, ServicePointID, ServicePointName,
UserID, UserFirstName, UserLastName, AddressID, AddressLine1, etc). Updated all affected
queries to use correct column names with aliases to maintain API compatibility.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sweep of 26 API files to use prefixed column names matching the
database schema (e.g. BusinessID not ID, BusinessName not Name,
BusinessDeliveryFlatFee not DeliveryFlatFee, ServicePointName not Name).
Files fixed: auth, beacons, businesses, menu, orders, setup, stripe,
tasks, and workers endpoints.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- saveBrandColor.cfm: BrandColor -> BusinessBrandColor (normalized column name)
- portal.js: Accept hex colors with or without # prefix in validation
- portal.js: Auto-prepend # when typing bare hex in color input
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- loginOTP.cfm/sendOTP.cfm: Use magic OTP code (123456) on dev instead of random
- portal/login.html: Hide login card until auth check completes to prevent flash of login form when redirecting to business selection
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- myBusinesses.cfm: Use BusinessID/BusinessName/BusinessUserID instead of
ID/Name/UserID (post-normalization column names)
- login.html: Fix biz.BusinessName -> biz.Name to match API response key
- login.html: Add friendly error messages for bad_credentials
- portal.js: Fix b.ID -> b.BusinessID in access check
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- setLineItem.cfm: WHERE ID→WHERE OrderID on 3 OrderLineItems queries
that filter by order (FK), not by line item PK
- setLineItem.cfm: qKids.ItemID→qKids.ID, qTemplateKids.ItemID→
qTemplateKids.ID (query only selects ID column from Items)
- abandonOrder.cfm: DELETE FROM OrderLineItems WHERE ID→WHERE OrderID
(was deleting one line item by PK instead of all items for the order)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Users table primary key was renamed from UserID to ID but these
endpoints still referenced the old column name, causing server_error
on login/signup OTP flow.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add queryTimed(), logPerf(), flushPerfBuffer() to environment.cfm
- Auto-create ApiPerfLogs table on first flush
- Hook logPerf into Application.cfm apiAbort for automatic tracking
- Initialize request perf counters in Application.cfm
- Remove local apiAbort() overrides from 7 endpoints
- Instrument 12 high-traffic endpoints with logPerf calls
- Buffer metrics in application scope, batch INSERT every 100 requests
- 30-day auto-cleanup with probabilistic trigger
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update all SQL queries, query result references, and ColdFusion code to match
the renamed database schema. Tables use plural CamelCase, PKs are all `ID`,
column prefixes stripped (e.g. BusinessName→Name, UserFirstName→FirstName).
Key changes:
- Strip table-name prefixes from all column references (Businesses, Users,
Addresses, Hours, Menus, Categories, Items, Stations, Orders,
OrderLineItems, Tasks, TaskCategories, TaskRatings, QuickTaskTemplates,
ScheduledTaskDefinitions, ChatMessages, Beacons, ServicePoints, Employees,
VisitorTrackings, ApiPerfLogs, tt_States, tt_Days, tt_AddressTypes,
tt_OrderTypes, tt_TaskTypes)
- Rename PK references from {TableName}ID to ID in all queries
- Rewrite 7 admin beacon files to use ServicePoints.BeaconID instead of
dropped lt_Beacon_Businesses_ServicePoints link table
- Rewrite beacon assignment files (list, save, delete) for new schema
- Fix FK references incorrectly changed to ID (OrderLineItems.OrderID,
Categories.MenuID, Tasks.CategoryID, ServicePoints.BeaconID)
- Update Addresses: AddressLat→Latitude, AddressLng→Longitude
- Update Users: UserPassword→Password, UserIsEmailVerified→IsEmailVerified,
UserIsActive→IsActive, UserBalance→Balance, etc.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Only include category headers that actually have items assigned
to them, preventing empty categories from showing up in the app.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Always return all active menus in the response so chip selector
always appears. Show all items from all menus by default instead
of filtering by current time, which caused empty results outside
menu hours.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Returns active menus in response so mobile apps can show menu
selector chips. Accepts optional MenuID param to filter items
to a specific menu.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When multiple menus exist, checks current time and day against menu
schedules. If exactly one menu matches, auto-selects it. If times
overlap or none match, shows all categories. User can still manually
select any menu or 'All Menus' from the dropdown.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>