Fix order status polling and delivery fee logic

API Changes:
- checkStatusUpdate.cfm: Fixed to use OrderStatusID != 7 instead of non-existent OrderIsDeleted column
- Application.cfm: Added checkStatusUpdate.cfm to public API allowlist
- getOrCreateCart.cfm: Fixed delivery fee to only apply for OrderTypeID = 2 (delivery)

Order Type Logic:
- 1 = Dine-in (no delivery fee)
- 2 = Delivery (delivery fee applied)
- 3 = Takeaway (no delivery fee)
- 4 = Ship-to (no delivery fee)

Status Translation:
- Uses OrderStatusID != 7 to filter deleted orders (tt_OrderStatuses table)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2025-12-31 21:38:26 -08:00
parent ecea71c533
commit ea72b120e8
3 changed files with 12 additions and 3 deletions

View file

@ -63,6 +63,8 @@ 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/beacons/list_all.cfm", request._api_path)) request._api_isPublic = true;
if (findNoCase("/api/beacons/getBusinessFromBeacon.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;
@ -70,6 +72,7 @@ if (len(request._api_path)) {
if (findNoCase("/api/orders/submit.cfm", request._api_path)) request._api_isPublic = true;
if (findNoCase("/api/orders/listForKDS.cfm", request._api_path)) request._api_isPublic = true;
if (findNoCase("/api/orders/updateStatus.cfm", request._api_path)) request._api_isPublic = true;
if (findNoCase("/api/orders/checkStatusUpdate.cfm", request._api_path)) request._api_isPublic = true;
}
// Carry session values into request (if present)

View file

@ -36,7 +36,7 @@
OrderUserID
FROM Orders
WHERE OrderID = <cfqueryparam value="#OrderID#" cfsqltype="cf_sql_integer">
AND OrderIsDeleted = <cfqueryparam value="0" cfsqltype="cf_sql_bit">
AND OrderStatusID != <cfqueryparam value="7" cfsqltype="cf_sql_integer">
</cfquery>
<cfif qOrder.recordCount EQ 0>

View file

@ -183,6 +183,11 @@
<cfset nowDt = now()>
<cfset newUUID = createUUID()>
<!--- Calculate delivery fee: only for delivery orders (OrderTypeID = 2)
OrderTypeID: 1=dine-in, 2=delivery, 3=takeaway, 4=ship-to (assumed)
Only delivery (2) should have delivery fee --->
<cfset deliveryFee = (OrderTypeID EQ 2) ? qBiz.BusinessDeliveryFlatFee : 0>
<!--- Generate new OrderID (table is not auto-inc in SSOT) --->
<cfset qNext = queryExecute(
"SELECT IFNULL(MAX(OrderID),0) + 1 AS NextID FROM Orders",
@ -215,7 +220,7 @@
?,
?,
?,
1,
?,
?,
0,
NULL,
@ -233,7 +238,8 @@
{ value = OrderUserID, cfsqltype = "cf_sql_integer" },
{ value = BusinessID, cfsqltype = "cf_sql_integer" },
{ value = qBiz.BusinessDeliveryMultiplier, cfsqltype = "cf_sql_decimal" },
{ value = qBiz.BusinessDeliveryFlatFee, cfsqltype = "cf_sql_decimal" },
{ value = OrderTypeID, cfsqltype = "cf_sql_integer" },
{ value = deliveryFee, cfsqltype = "cf_sql_decimal" },
{ value = nowDt, cfsqltype = "cf_sql_timestamp" },
{ value = nowDt, cfsqltype = "cf_sql_timestamp" },
{ value = OrderServicePointID, cfsqltype = "cf_sql_integer" }