Feature cancelled — modifier wording handles the use case instead.
Removes IsInvertedGroup from SELECTs, JSON responses, RemovedDefaults
computation, and KDS/portal display logic. DB column left in place.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Works app can now display inverted modifier groups with "NO" prefix
for removed defaults, matching KDS behavior.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Staff cash goes to worker payout ledger, admin/manager cash deletes
pending payout and reverses withholding. Add RoleID to myBusinesses
response. Various order and webhook improvements.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Balance from cash change now silently reduces the amount owed on the
next order. For cash: deducted immediately in submitCash, reduces cash
the worker needs to collect (or skips cash task entirely if fully
covered). For card: reduces the Stripe PaymentIntent amount, deducted
in webhook on successful payment. Receipt shows "Balance applied" line.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
submitCash.cfm: Calculate platform fee from subtotal * PayfritFee,
store in Orders.PlatformFee and Payments.PaymentPayfritsCut on submission.
complete.cfm: Replace bogus 2.25% cash transaction fee with the real
platform fee (customer fee + business fee = 2 × PayfritFee × subtotal).
Credit full Payfrit revenue to User 0. Record business fee in
PaymentPayfritNetworkFees.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Staff cash_debit goes to the worker (they keep the cash).
Admin/Manager cash_debit goes to the business owner (restaurant has it).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
Changed tt_TaskTypeID to ID in task type CRUD operations to match
the migrated dev database schema.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The tt_TaskTypes table uses 'ID' not 'tt_TaskTypeID'.
This was causing "Failed to load services" in the portal.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Cancel Task now leaves order untouched (customer can pay another way)
- Standardized SMS text to "Your Payfrit code is:" across all endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When worker passes CancelOrder: true to complete.cfm:
- Skips all cash validation and financial processing
- Sets order status to 6 (cancelled)
- Completes the task normally
- Returns OrderCancelled: true in response
For when customer changes their mind about paying with cash.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixed complete.cfm, getDetails.cfm, listMine.cfm, listPending.cfm to pull
PayfritFee from Businesses table with 0.05 fallback if not set.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Matches the lookup.cfm approach:
- UUID from BeaconShards
- Major from Businesses.BeaconMajor
- Minor from ServicePoints.BeaconMinor
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Looks up actual ShardUUID, Major, Minor from BeaconHardware
instead of deriving from Business/ServicePoint tables.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- UUID from BeaconShards via Business.BeaconShardID
- Major from Business.BeaconMajor
- Minor = ServicePointID
Replaces old beacon lookup via ServicePoints.BeaconID
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a cash task is completed, the order now goes to status 1 (submitted)
instead of directly to status 5 (complete). This allows the normal kitchen
flow to proceed: kitchen sees order → prepares → marks status 3 → delivery
task is auto-created.
Also sets PaymentStatus, PaymentCompletedOn, and SubmittedOn to match the
Stripe webhook behavior for paid orders.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Skip cash validation and processing for tasks with no linked order.
These are likely test tasks that were created before order linking.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Returns order total in cents as integer for Flutter Works app
to display exact cash amount due for cash payment tasks.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- createChat: Look up business-specific Chat task type instead of hardcoded ID 2
- listPending: Filter by CompletedOn IS NULL to exclude completed tasks
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When both OrderID and UserID are 0, dont join to User 0 (Payfrit Network).
Instead return no customer info, letting the app show Guest.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
COALESCE treats 0 as valid, so Order.UserID=0 was matching User 0
(Payfrit Network) instead of falling back to Task.UserID.
Use NULLIF to convert 0 to NULL before the fallback.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
For order-based tasks, the customer comes from Order.UserID.
For standalone tasks without an order, fall back to Task.UserID.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Store UserID when creating service bell tasks
- Return CustomerID and CustomerName in listPending and listMine
- Join Users table to fetch customer first/last name
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use COALESCE(t.ServicePointID, o.ServicePointID) in JOIN
- Add ServicePointID to JSON response
- Fixes service bell tasks showing table name
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ServicePointID to INSERT statement for service bell tasks
- Fix tt_TaskTypes query to use ID instead of tt_TaskTypeID
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add beacon-sharding API endpoints for scalable iBeacon addressing
(64 shard UUIDs × 65k businesses = ~4.2M capacity)
- Fix callServer.cfm to save UserID when creating Call Server tasks
- Fix getDetails.cfm to return customer info from Task.UserID when
Order.UserID is null (for tasks without orders)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
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.
- 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>
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>
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>
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>
- 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>
- 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>