Add Johns Beverages debug endpoint

This commit is contained in:
John Pinkyfloyd 2026-02-09 14:28:56 -08:00
parent b8cf2ce150
commit 133f57f689

42
api/debug/johns.cfm Normal file
View file

@ -0,0 +1,42 @@
<cfsetting showdebugoutput="false">
<cfsetting enablecfoutputonly="true">
<cfcontent type="application/json; charset=utf-8" reset="true">
<cfquery name="qBiz" datasource="payfrit">
SELECT ID, Name, BeaconShardID, BeaconMajor
FROM Businesses
WHERE Name LIKE '%john%beverages%' OR Name LIKE '%john\'s beverages%'
</cfquery>
<cfif qBiz.recordCount EQ 0>
<cfoutput>#serializeJSON({ "OK": false, "ERROR": "No business found" })#</cfoutput>
<cfabort>
</cfif>
<cfquery name="qSP" datasource="payfrit">
SELECT ID, Name, BeaconMinor, IsActive
FROM ServicePoints
WHERE BusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#qBiz.ID#">
ORDER BY SortOrder, Name
</cfquery>
<cfset spList = []>
<cfloop query="qSP">
<cfset arrayAppend(spList, {
"ID": qSP.ID,
"Name": qSP.Name,
"BeaconMinor": isNull(qSP.BeaconMinor) ? "NULL" : val(qSP.BeaconMinor),
"IsActive": qSP.IsActive
})>
</cfloop>
<cfoutput>#serializeJSON({
"OK": true,
"Business": {
"ID": qBiz.ID,
"Name": qBiz.Name,
"BeaconShardID": val(qBiz.BeaconShardID),
"BeaconMajor": val(qBiz.BeaconMajor)
},
"ServicePoints": spList
})#</cfoutput>