From 428129a93ea2de95af97c16e7638cf2e700256e1 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sun, 8 Feb 2026 12:34:49 -0800 Subject: [PATCH] Add sharding support to beacon list and assignments APIs For businesses using beacon sharding: - beacons/list.cfm now returns ServicePoints with BeaconMinor as beacons - assignments/list.cfm now shows sharding assignments (SP + Minor) - Both APIs include USES_SHARDING flag and sharding info Co-Authored-By: Claude Opus 4.5 --- api/assignments/list.cfm | 97 +++++++++++++++++++++++++++++----------- api/beacons/list.cfm | 69 +++++++++++++++++++++++++++- 2 files changed, 139 insertions(+), 27 deletions(-) diff --git a/api/assignments/list.cfm b/api/assignments/list.cfm index c3176e9..deda62f 100644 --- a/api/assignments/list.cfm +++ b/api/assignments/list.cfm @@ -15,32 +15,79 @@ if (!structKeyExists(request, "BusinessID") || !isNumeric(request.BusinessID) || } - - SELECT - sp.ID AS ServicePointID, - sp.BeaconID, - sp.BusinessID AS BusinessID, - sp.AssignedByUserID, - b.Name AS BeaconName, - b.UUID, - sp.Name AS ServicePointName - FROM ServicePoints sp - JOIN Beacons b ON b.ID = sp.BeaconID - WHERE sp.BusinessID = - AND sp.BeaconID IS NOT NULL - ORDER BY b.Name, sp.Name + + + SELECT BeaconShardID, BeaconMajor + FROM Businesses + WHERE ID = + LIMIT 1 + - - - -#serializeJSON({ OK=true, ERROR="", COUNT=arrayLen(assignments), ASSIGNMENTS=assignments })# + + + + SELECT UUID FROM BeaconShards WHERE ID = + + + + + SELECT + sp.ID AS ServicePointID, + sp.BeaconMinor, + sp.Name AS ServicePointName + FROM ServicePoints sp + WHERE sp.BusinessID = + AND sp.BeaconMinor IS NOT NULL + AND sp.IsActive = 1 + ORDER BY sp.BeaconMinor, sp.Name + + + + + + + + + + SELECT + sp.ID AS ServicePointID, + sp.BeaconID, + sp.BusinessID AS BusinessID, + sp.AssignedByUserID, + b.Name AS BeaconName, + b.UUID, + sp.Name AS ServicePointName + FROM ServicePoints sp + JOIN Beacons b ON b.ID = sp.BeaconID + WHERE sp.BusinessID = + AND sp.BeaconID IS NOT NULL + ORDER BY b.Name, sp.Name + + + + + + + +#serializeJSON({ OK=true, ERROR="", COUNT=arrayLen(assignments), ASSIGNMENTS=assignments, USES_SHARDING=usesSharding })# diff --git a/api/beacons/list.cfm b/api/beacons/list.cfm index 6b85bad..6df35a2 100644 --- a/api/beacons/list.cfm +++ b/api/beacons/list.cfm @@ -55,6 +55,30 @@ if (structKeyExists(data, "onlyActive")) { } + + + SELECT BeaconShardID, BeaconMajor + FROM Businesses + WHERE ID = + LIMIT 1 + + + + + + + + + SELECT UUID FROM BeaconShards WHERE ID = + + + + + SELECT DISTINCT b.ID, @@ -83,9 +107,50 @@ if (structKeyExists(data, "onlyActive")) { "BusinessID" = q.BusinessID, "Name" = q.Name, "UUID" = q.UUID, - "IsActive" = q.IsActive + "IsActive" = q.IsActive, + "IsSharding" = false })> + + + + SELECT + sp.ID AS ServicePointID, + sp.Name, + sp.BeaconMinor, + sp.IsActive + FROM ServicePoints sp + WHERE sp.BusinessID = + AND sp.BeaconMinor IS NOT NULL + + AND sp.IsActive = 1 + + ORDER BY sp.BeaconMinor, sp.Name + + + + + + + try{logPerf(0);}catch(any e){} -#serializeJSON({ OK=true, ERROR="", BusinessID=bizId, COUNT=arrayLen(beacons), BEACONS=beacons })# +#serializeJSON({ + OK=true, + ERROR="", + BusinessID=bizId, + COUNT=arrayLen(beacons), + BEACONS=beacons, + USES_SHARDING=usesSharding, + SHARDING_INFO=shardingInfo +})#