From 0bdf9d60b79224b1123d27efbbeab341ee0e0007 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sat, 14 Feb 2026 17:08:33 -0800 Subject: [PATCH] Fix beacon lookup to match by namespace (first 20 chars) instead of full UUID This allows beacons to use any Eddystone-UID configuration where: - Namespace (10 bytes) matches first 20 hex chars of shard UUID - Instance bytes encode Major/Minor for business/service point lookup Co-Authored-By: Claude Opus 4.5 --- api/beacons/lookup.cfm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/beacons/lookup.cfm b/api/beacons/lookup.cfm index 4ae279e..8c9d95e 100644 --- a/api/beacons/lookup.cfm +++ b/api/beacons/lookup.cfm @@ -39,7 +39,10 @@ - + + + + SELECT biz.ID AS BusinessID, @@ -48,12 +51,13 @@ COALESCE(parent.Name, '') AS ParentBusinessName, sp.ID AS ServicePointID, sp.Name AS ServicePointName, + bs.UUID AS ShardUUID, (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 = + WHERE LEFT(REPLACE(bs.UUID, '-', ''), 20) = AND bs.IsActive = 1 AND biz.IsDemo = 0 AND biz.IsPrivate = 0