fix(deployment): instance delete fully removes the record
Deleting an instance only undeployed it from the site and set the state to NotDeployed, leaving an orphan record that could never be removed — the state-transition matrix rejected delete from NotDeployed. Delete now removes the instance record entirely (deployment history, snapshot, attribute/alarm overrides, and connection bindings go with it), and is permitted from any state.
This commit is contained in:
@@ -73,9 +73,9 @@ public class StateTransitionValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanDelete_WhenNotDeployed_ReturnsFalse()
|
||||
public void CanDelete_WhenNotDeployed_ReturnsTrue()
|
||||
{
|
||||
Assert.False(StateTransitionValidator.CanDelete(InstanceState.NotDeployed));
|
||||
Assert.True(StateTransitionValidator.CanDelete(InstanceState.NotDeployed));
|
||||
}
|
||||
|
||||
// ── ValidateTransition ──
|
||||
@@ -103,10 +103,10 @@ public class StateTransitionValidatorTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ValidateTransition_InvalidDeleteOnNotDeployed_ReturnsError()
|
||||
public void ValidateTransition_ValidDeleteOnNotDeployed_ReturnsNull()
|
||||
{
|
||||
var error = StateTransitionValidator.ValidateTransition(InstanceState.NotDeployed, "delete");
|
||||
Assert.NotNull(error);
|
||||
Assert.Null(error);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user