diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Uns/UnsMutationResult.cs b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Uns/UnsMutationResult.cs
index ff5be32b..0a8a9699 100644
--- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Uns/UnsMutationResult.cs
+++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Uns/UnsMutationResult.cs
@@ -8,4 +8,6 @@ namespace ZB.MOM.WW.OtOpcUa.AdminUI.Uns;
///
/// Whether the mutation was applied.
/// The operator-facing failure message, or null on success.
-public readonly record struct UnsMutationResult(bool Ok, string? Error);
+/// On a successful create, the new entity's system id (e.g. the generated
+/// EQ-… equipment id) so the caller can navigate to it; null for updates/deletes/failures.
+public readonly record struct UnsMutationResult(bool Ok, string? Error, string? CreatedId = null);
diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Uns/UnsTreeService.cs b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Uns/UnsTreeService.cs
index 8632ba13..dd21f0b3 100644
--- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Uns/UnsTreeService.cs
+++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Uns/UnsTreeService.cs
@@ -539,7 +539,7 @@ public sealed class UnsTreeService(IDbContextFactory dbF
Enabled = input.Enabled,
});
await db.SaveChangesAsync(ct);
- return new UnsMutationResult(true, null);
+ return new UnsMutationResult(true, null, equipmentId);
}
///
diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/Uns/UnsTreeServiceEquipmentTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/Uns/UnsTreeServiceEquipmentTests.cs
index b5831e0a..2c4ec37d 100644
--- a/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/Uns/UnsTreeServiceEquipmentTests.cs
+++ b/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/Uns/UnsTreeServiceEquipmentTests.cs
@@ -348,6 +348,24 @@ public sealed class UnsTreeServiceEquipmentTests
verify.Equipment.Single(e => e.EquipmentId == equipmentId).DriverInstanceId.ShouldBe("DRV-1");
}
+ /// CreateEquipmentAsync returns the generated EQ- id in CreatedId so callers can navigate to the new page.
+ [Fact]
+ public async Task CreateEquipment_returns_generated_id_in_CreatedId()
+ {
+ var dbName = $"uns-eq-createdid-{Guid.NewGuid():N}";
+ UnsTreeTestDb.SeedNamed(dbName);
+ var service = new UnsTreeService(UnsTreeTestDb.Factory(dbName));
+
+ var input = new EquipmentInput("machine-2", "machine_002", "LINE-1",
+ null, null, null, null, null, null, null, null, null, null, null, null, true);
+
+ var result = await service.CreateEquipmentAsync(input);
+
+ result.Ok.ShouldBeTrue();
+ result.CreatedId.ShouldNotBeNull();
+ result.CreatedId!.ShouldStartWith("EQ-");
+ }
+
// ----- DeleteEquipment -----
/// Deleting equipment removes the row.