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>
63 lines
1.7 KiB
Text
63 lines
1.7 KiB
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
|
|
<cfparam name="url.orderid" default="0">
|
|
|
|
<cfset orderId = val(url.orderid)>
|
|
|
|
<cfif orderId LTE 0>
|
|
<cfcontent type="application/json; charset=utf-8">
|
|
<cfoutput>{"OK": false, "ERROR": "Please provide orderid in URL: ?orderid=300"}</cfoutput>
|
|
<cfabort>
|
|
</cfif>
|
|
|
|
<cftry>
|
|
<cfset qLineItems = queryExecute("
|
|
SELECT
|
|
oli.ID,
|
|
oli.ParentOrderLineItemID,
|
|
oli.ItemID,
|
|
oli.Price,
|
|
oli.Quantity,
|
|
oli.Remark,
|
|
oli.IsDeleted,
|
|
i.Name,
|
|
i.ParentItemID
|
|
FROM OrderLineItems oli
|
|
INNER JOIN Items i ON i.ID = oli.ItemID
|
|
WHERE oli.OrderID = ?
|
|
ORDER BY oli.ID
|
|
", [ { value = orderId, cfsqltype = "cf_sql_integer" } ], { datasource = "payfrit" })>
|
|
|
|
<cfset lineItems = []>
|
|
<cfloop query="qLineItems">
|
|
<cfset arrayAppend(lineItems, {
|
|
"OrderLineItemID": qLineItems.OrderLineItemID,
|
|
"ParentOrderLineItemID": qLineItems.ParentOrderLineItemID,
|
|
"ItemID": qLineItems.ID,
|
|
"Price": qLineItems.Price,
|
|
"Quantity": qLineItems.Quantity,
|
|
"Remark": qLineItems.Remark,
|
|
"IsDeleted": qLineItems.IsDeleted,
|
|
"Name": qLineItems.Name,
|
|
"ParentItemID": qLineItems.ParentItemID
|
|
})>
|
|
</cfloop>
|
|
|
|
<cfcontent type="application/json; charset=utf-8">
|
|
<cfoutput>#serializeJSON({
|
|
"OK": true,
|
|
"OrderID": orderId,
|
|
"TotalLineItems": arrayLen(lineItems),
|
|
"LineItems": lineItems
|
|
})#</cfoutput>
|
|
|
|
<cfcatch>
|
|
<cfcontent type="application/json; charset=utf-8">
|
|
<cfoutput>#serializeJSON({
|
|
"OK": false,
|
|
"ERROR": "db_error",
|
|
"MESSAGE": cfcatch.message
|
|
})#</cfoutput>
|
|
</cfcatch>
|
|
</cftry>
|