From 44bc0a3411b24064527c42f5ea43ee81b4fec3f0 Mon Sep 17 00:00:00 2001 From: Tayyab Fayyaz Janjua Date: Mon, 6 Jan 2025 07:56:55 +0100 Subject: [PATCH] fix(connector): delete connector when sdFactory is disabled Ref: 1221 --- .../BusinessLogic/ConnectorsBusinessLogic.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/administration/Administration.Service/BusinessLogic/ConnectorsBusinessLogic.cs b/src/administration/Administration.Service/BusinessLogic/ConnectorsBusinessLogic.cs index ad4daa13ab..5d1fe9e9db 100644 --- a/src/administration/Administration.Service/BusinessLogic/ConnectorsBusinessLogic.cs +++ b/src/administration/Administration.Service/BusinessLogic/ConnectorsBusinessLogic.cs @@ -283,6 +283,10 @@ public async Task DeleteConnectorAsync(Guid connectorId, bool deleteServiceAccou case ConnectorStatusId.PENDING: await DeleteConnectorWithDocuments(connectorId, result.SelfDescriptionDocumentId.Value, result.ConnectorOfferSubscriptions, connectorsRepository); break; + // Connector should be able to deleted if the ClearinghouseConnectDisabled bit is disabled and no SD document was part of connector. + case ConnectorStatusId.ACTIVE when _settings.ClearinghouseConnectDisabled: + await DeleteConnectorWithoutDocuments(connectorId, result.ConnectorOfferSubscriptions, connectorsRepository); + break; case ConnectorStatusId.ACTIVE when result.SelfDescriptionDocumentId != null && result.DocumentStatusId != null: await DeleteConnector(connectorId, result.ConnectorOfferSubscriptions, result.SelfDescriptionDocumentId.Value, result.DocumentStatusId.Value, connectorsRepository); break;