From 4dcf4e4385ca532aa6e81a62d43a122808aa239f Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Mon, 29 Dec 2025 11:14:21 -0800 Subject: [PATCH] Add cart endpoints and enhance menu API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cart management improvements: - Added cart endpoints to public API allowlist (getOrCreateCart, setLineItem, getCart, submit) - Fixed setLineItem null parameter handling for remarks - Standardized API responses to use uppercase keys (ORDER, ORDERLINEITEMS) - Updated getCart to match response format consistency - Added CategoryName to menu items endpoint These changes enable the mobile app to browse menu with categories and manage cart operations without authentication. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- api/Application.cfm | 4 ++++ api/menu/items.cfm | 2 ++ api/orders/getCart.cfm | 4 ++-- api/orders/setLineItem.cfm | 8 ++++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/api/Application.cfm b/api/Application.cfm index e0511cd..93b41e0 100644 --- a/api/Application.cfm +++ b/api/Application.cfm @@ -64,6 +64,10 @@ if (len(request._api_path)) { if (findNoCase("/api/businesses/list.cfm", request._api_path)) request._api_isPublic = true; if (findNoCase("/api/servicepoints/list.cfm", request._api_path)) request._api_isPublic = true; if (findNoCase("/api/menu/items.cfm", request._api_path)) request._api_isPublic = true; + if (findNoCase("/api/orders/getOrCreateCart.cfm", request._api_path)) request._api_isPublic = true; + if (findNoCase("/api/orders/getCart.cfm", request._api_path)) request._api_isPublic = true; + if (findNoCase("/api/orders/setLineItem.cfm", request._api_path)) request._api_isPublic = true; + if (findNoCase("/api/orders/submit.cfm", request._api_path)) request._api_isPublic = true; } // Carry session values into request (if present) diff --git a/api/menu/items.cfm b/api/menu/items.cfm index 3865f1d..87248ee 100644 --- a/api/menu/items.cfm +++ b/api/menu/items.cfm @@ -42,6 +42,7 @@ SELECT i.ItemID, i.ItemCategoryID, + c.CategoryName, i.ItemName, i.ItemDescription, i.ItemParentItemID, @@ -67,6 +68,7 @@ diff --git a/api/orders/setLineItem.cfm b/api/orders/setLineItem.cfm index 0c6d332..6bbf7bd 100644 --- a/api/orders/setLineItem.cfm +++ b/api/orders/setLineItem.cfm @@ -164,7 +164,7 @@ - - + @@ -308,7 +308,7 @@ [ { value = Quantity, cfsqltype = "cf_sql_integer" }, { value = qItem.ItemPrice, cfsqltype = "cf_sql_decimal" }, - { value = (len(trim(Remark)) EQ 0 ? javacast("null","") : Remark), cfsqltype = "cf_sql_varchar", null = (len(trim(Remark)) EQ 0) }, + { value = Remark, cfsqltype = "cf_sql_varchar", null = (len(trim(Remark)) EQ 0) }, { value = qExisting.OrderLineItemID, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" } @@ -365,7 +365,7 @@ { value = ItemID, cfsqltype = "cf_sql_integer" }, { value = qItem.ItemPrice, cfsqltype = "cf_sql_decimal" }, { value = (ParentLineItemID EQ 0 ? Quantity : 1), cfsqltype = "cf_sql_integer" }, - { value = (len(trim(Remark)) EQ 0 ? javacast("null","") : Remark), cfsqltype = "cf_sql_varchar", null = (len(trim(Remark)) EQ 0) }, + { value = Remark, cfsqltype = "cf_sql_varchar", null = (len(trim(Remark)) EQ 0) }, { value = now(), cfsqltype = "cf_sql_timestamp" } ], { datasource = "payfrit" }