From 2f35eb69ebc391693c70c0be6638c49948af6da9 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sun, 8 Feb 2026 12:21:30 -0800 Subject: [PATCH] Add beacon sharding support to lookup API The lookup API now handles two formats: 1. Sharding: { "Beacons": [{ "UUID", "Major", "Minor" }] } Resolves via BeaconShards -> Businesses.BeaconMajor -> ServicePoints.BeaconMinor 2. Legacy: { "UUIDs": ["..."] } Resolves via old Beacons table Co-Authored-By: Claude Opus 4.5 --- api/beacons/lookup.cfm | 84 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/api/beacons/lookup.cfm b/api/beacons/lookup.cfm index bff294a..f459859 100644 --- a/api/beacons/lookup.cfm +++ b/api/beacons/lookup.cfm @@ -6,6 +6,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT + biz.ID AS BusinessID, + biz.Name AS BusinessName, + biz.ParentBusinessID, + COALESCE(parent.Name, '') AS ParentBusinessName, + sp.ID AS ServicePointID, + sp.Name AS ServicePointName, + (SELECT COUNT(*) FROM Businesses WHERE ParentBusinessID = biz.ID) AS ChildCount + FROM BeaconShards bs + JOIN Businesses biz ON biz.BeaconShardID = bs.ID AND biz.BeaconMajor = + LEFT JOIN ServicePoints sp ON sp.BusinessID = biz.ID AND sp.BeaconMinor = AND sp.IsActive = 1 + LEFT JOIN Businesses parent ON biz.ParentBusinessID = parent.ID + WHERE bs.UUID = + AND bs.IsActive = 1 + AND biz.IsDemo = 0 + AND biz.IsPrivate = 0 + LIMIT 1 + + + + + + + + #serializeJSON({ + "OK" = true, + "ERROR" = "", + "BEACONS" = beacons + })# + + + + #serializeJSON({ "OK" = true,