diff --git a/api/beacon-sharding/allocate_business_namespace.cfm b/api/beacon-sharding/allocate_business_namespace.cfm index 86d6bdb..296fa5e 100644 --- a/api/beacon-sharding/allocate_business_namespace.cfm +++ b/api/beacon-sharding/allocate_business_namespace.cfm @@ -117,9 +117,9 @@ if (bizId LTE 0) { - + - SELECT COALESCE(MAX(BeaconMajor), 0) AS MaxMajor + SELECT COALESCE(MAX(BeaconMajor), -1) AS MaxMajor FROM Businesses WHERE BeaconShardID = diff --git a/api/beacon-sharding/allocate_servicepoint_minor.cfm b/api/beacon-sharding/allocate_servicepoint_minor.cfm index a3820ad..9cb33df 100644 --- a/api/beacon-sharding/allocate_servicepoint_minor.cfm +++ b/api/beacon-sharding/allocate_servicepoint_minor.cfm @@ -111,9 +111,9 @@ if (spId LTE 0) { - + - SELECT COALESCE(MAX(BeaconMinor), 0) AS MaxMinor + SELECT COALESCE(MAX(BeaconMinor), -1) AS MaxMinor FROM ServicePoints WHERE BusinessID = diff --git a/api/beacon-sharding/register_beacon_hardware.cfm b/api/beacon-sharding/register_beacon_hardware.cfm index 7ac0f5f..7958318 100644 --- a/api/beacon-sharding/register_beacon_hardware.cfm +++ b/api/beacon-sharding/register_beacon_hardware.cfm @@ -165,7 +165,14 @@ firmwareVersion = normStr(structKeyExists(data, "FirmwareVersion") ? data.Firmwa - + + + + UPDATE ServicePoints + SET BeaconMinor = + WHERE ID = + + - + diff --git a/api/servicepoints/save.cfm b/api/servicepoints/save.cfm index e23fdc1..2a59a8d 100644 --- a/api/servicepoints/save.cfm +++ b/api/servicepoints/save.cfm @@ -89,7 +89,17 @@ if (structKeyExists(data, "IsActive")) { - + + + + SELECT COALESCE(MAX(BeaconMinor), -1) AS MaxMinor + FROM ServicePoints + WHERE BusinessID = + + + + + INSERT INTO ServicePoints ( BusinessID, @@ -97,16 +107,16 @@ if (structKeyExists(data, "IsActive")) { Code, TypeID, IsActive, - SortOrder - , BeaconMinor + SortOrder, + BeaconMinor ) VALUES ( , , , , , - - , + , + ) @@ -136,12 +146,12 @@ if (structKeyExists(data, "IsActive")) { #serializeJSON({ OK=true, ERROR="", SERVICEPOINT=servicePoint })#