Commit graph

58 commits

Author SHA1 Message Date
John Mizerek
0578d7ed88 Switch quickTasks and scheduledTasks API refs from .cfm to .php
Portal and quick-tasks page now point to PHP API endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 15:57:32 -07:00
John Mizerek
98163f3842 Switch all API endpoint references from .cfm to .php
PHP API is now deployed on both dev and biz servers with PHP-FPM.
Admin endpoints (quickTasks, scheduledTasks) remain .cfm as they
haven't been ported yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 15:21:45 -07:00
John Mizerek
bc52a0242f Fix saveOrderTypes: add X-Business-ID header for auth
Application.cfm requires request.BusinessID from session or header.
The fetch was only sending it in the POST body which the auth layer
doesn't read.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:28:17 -07:00
John Mizerek
b57cef8838 Guard saveOrderTypes against missing businessId
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:11:54 -07:00
John Mizerek
30e192e738 Fix saveOrderTypes: wrong method name and onchange firing during load
- showToast → toast (correct method name) across all settings methods
- Clear onchange before setting .checked to prevent save during load

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:07:44 -07:00
John Mizerek
87eb5fa1f0 Fix takeaway/pickup toggle not saving in Firefox
Wire onchange listener via JS instead of inline attribute,
matching the hiring toggle pattern. The zero-sized hidden
checkbox wasn't firing inline onchange reliably.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:07:54 -07:00
John Mizerek
6cdbff129f Add takeaway/pickup order support
- getOrCreateCart: only require ServicePointID for dine-in (OrderTypeID=1)
- get.cfm + items.cfm: return OrderTypes from Businesses table
- saveOrderTypes.cfm: new endpoint to save business order type config
- KDS: add PICKUP/DELIVERY badges on order cards
- Portal: add Order Types toggle card in settings (Dine-In always on, Takeaway toggle)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:45:06 -07:00
John Mizerek
771f70f2f3 Add BrandColorLight to portal settings page
Updated the portal settings brand color picker to show both dark
and light colors. Light swatch shown alongside dark swatch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 15:09:30 -08:00
John Mizerek
d1910a7d34 Add staff role system: Staff keeps cash, Manager/Admin collect for restaurant
- Create tt_StaffRoles lookup table (Staff, Manager, Admin)
- Add RoleID column to Employees table (default: Staff)
- Wire portal role dropdown to addTeamMember API
- Return RoleName in team list and RoleID to Android
- Skip worker payout ledger and cash_debit for Manager/Admin roles
  on cash task completion (they collect on behalf of the restaurant)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:19:22 -08:00
John Mizerek
4c0479db5c Add Open Tabs feature: tab APIs, presence tracking, shared tabs, cron, portal settings
- New api/tabs/ directory with 13 endpoints: open, close, cancel, get, getActive,
  addOrder, increaseAuth, addMember, removeMember, getPresence, approveOrder,
  rejectOrder, pendingOrders
- New api/presence/heartbeat.cfm for beacon-based user presence tracking
- New cron/expireTabs.cfm for idle tab expiry and presence cleanup
- Modified submit.cfm for tab-aware order submission (skip payment, update running total)
- Modified getOrCreateCart.cfm to auto-detect active tab and set TabID on new carts
- Modified webhook.cfm to handle tab capture events (metadata type=tab_close)
- Modified businesses/get.cfm and updateTabs.cfm with new tab config columns
- Updated portal tab settings UI with auth amounts, max members, approval toggle
- Added tab and presence endpoints to Application.cfm public allowlist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 20:56:07 -08:00
John Mizerek
194eb4d205 Fix beacon Minor 0 not displaying in service points page
b.Minor is 0 for the first beacon which is falsy in JS.
Changed to null check so Minor: 0 displays correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-24 12:47:20 -08:00
John Mizerek
57ef40f737 Add click handler for refresh button in portal
The refresh button in the top bar had no click handler attached.
Now it reloads the current page data when clicked.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-23 14:13:47 -08:00
John Mizerek
b360284e56 Beacon delete fix, price extraction, tax rate lookup, add modifiers form 2026-02-14 19:17:48 -08:00
John Mizerek
0d04ae8463 Resolve merge conflict in myBusinesses.cfm - keep ActiveTaskCount 2026-02-11 22:33:44 -08:00
John Mizerek
3d59a2e5cd Fix service point delete using wrong ID field
The API returns ServicePointID but portal.js was using sp.ID which was undefined.
Changed all sp.ID references to sp.ServicePointID.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:32:43 -08:00
John Mizerek
2023e1b5d9 Setup wizard and tasks updates
- Setup wizard save improvements
- Call server task updates
- Task creation changes
- Portal JS updates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 15:18:01 -08:00
John Mizerek
31a89018f5 Launch prep: fix menu builder, payment flow, comment out pre-launch features
- Fix menu builder dropdown showing empty names (return MenuName instead of Name)
- Add default menu selection (setDefault action, DefaultMenuID in getForBuilder)
- Fix createPaymentIntent column names for dev schema (ID, StripeAccountID, etc.)
- Fix menu-builder favicon and remove redundant business label
- Comment out Tabs/Running Checks feature for launch (HTML + JS)
- Comment out Service Point Marketing/Grants feature for launch (HTML + JS)
- Add testMarkPaid.cfm for testing orders without Stripe webhooks
- Task API updates for worker payout ledger integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:18:33 -08:00
John Mizerek
d7632c5d35 Menu builder and portal updates
- Menu builder UI improvements
- Portal CSS and JS updates
- Station assignment updates
- Add business tabs update endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:08:54 -08:00
John
16a3b7c9a3 Replace queryExecute with queryTimed across all endpoints for perf tracking
Converts 200+ endpoint files to use queryTimed() wrapper which tracks
DB query count and execution time. Restores perf dashboard files that
were accidentally moved to _scripts/. Includes portal UI updates.
2026-02-02 00:28:37 -08:00
John Mizerek
f52d14bb7e Add Service Point Sharing infrastructure
Grant-based system allowing businesses to share service points with
other businesses. Includes grant CRUD API, time/eligibility/economics
policies, enforcement at cart creation and order submit, Stripe payment
routing for owner fees, and portal UI for managing grants.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:34:03 -08:00
John Mizerek
87e38649c4 Use business name initial for user avatar instead of first name
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:47:02 -08:00
John Mizerek
7b19979118 Show user's first initial in profile avatar instead of hardcoded U
Save FirstName to localStorage on login (both OTP and password paths).
Portal reads it back and displays the first letter in the user avatar.
Falls back to 'U' if no name is stored. Cleared on logout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 09:38:36 -08:00
John Mizerek
d6478da03f Fix brand color display and header upload collision
- 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>
2026-02-01 09:10:45 -08:00
John Mizerek
77fb8b9780 Add user dropdown menu with Settings and Logout options
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>
2026-02-01 08:18:36 -08:00
John Mizerek
0258531c3d Remove debug alerts from portal.js
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 08:15:22 -08:00
John Mizerek
6ba3f3dffd Add debug alerts to diagnose mobile settings load issue
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 08:12:28 -08:00
John Mizerek
2562c51c27 Normalize API response keys to uppercase for consistent access
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>
2026-02-01 08:08:03 -08:00
John Mizerek
abbe1d60a6 Add temporary debug alerts for mobile header/color issue
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 08:02:45 -08:00
John Mizerek
80b4c0da52 Fix header image and brand color swatch on mobile
- 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>
2026-02-01 07:59:21 -08:00
John Mizerek
69c51b90cb Fix header preview box and brand color swatch for mobile
- 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>
2026-02-01 07:50:25 -08:00
John Mizerek
db5cd90875 Switch header preview from CSS background-image to <img> tag
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>
2026-02-01 07:48:47 -08:00
John Mizerek
d86ca5a894 Fix header image display on mobile and brand color preview
- 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>
2026-02-01 07:45:46 -08:00
John Mizerek
c5e9d1b0ff Fix settings page element ID mismatches
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>
2026-01-31 20:44:26 -08:00
John Mizerek
469cc06a29 Fix brand color save: use BusinessBrandColor column, allow # to be optional
- 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>
2026-01-31 14:27:44 -08:00
John Mizerek
c5a332b04e Fix portal login: use normalized DB column names, fix business dropdown
- 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>
2026-01-31 14:15:37 -08:00
John Mizerek
1210249f54 Normalize database column and table names across entire codebase
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>
2026-01-30 15:39:12 -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
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
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
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
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
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
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
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
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