diff --git a/src/externalsystems/SdFactory.Library/BusinessLogic/SdFactoryBusinessLogic.cs b/src/externalsystems/SdFactory.Library/BusinessLogic/SdFactoryBusinessLogic.cs index 1cf3479903..e9c2dbc75c 100644 --- a/src/externalsystems/SdFactory.Library/BusinessLogic/SdFactoryBusinessLogic.cs +++ b/src/externalsystems/SdFactory.Library/BusinessLogic/SdFactoryBusinessLogic.cs @@ -52,12 +52,16 @@ public Task RegisterConnectorAsync( if (_settings.ClearinghouseConnectDisabled) { return new IApplicationChecklistService.WorkerChecklistProcessStepExecutionResult( - ProcessStepStatusId.DONE, - entry => entry.ApplicationChecklistEntryStatusId = ApplicationChecklistEntryStatusId.DONE, + ProcessStepStatusId.SKIPPED, + entry => + { + entry.ApplicationChecklistEntryStatusId = ApplicationChecklistEntryStatusId.DONE; + entry.Comment = "Self description was skipped due to clearinghouse trigger is disabled"; + }, new[] { ProcessStepTypeId.ACTIVATE_APPLICATION }, null, true, - null + "Self description was skipped due to clearinghouse trigger is disabled" ); } diff --git a/tests/externalsystems/SdFactory.Library.Tests/SdFactoryBusinessLogicTests.cs b/tests/externalsystems/SdFactory.Library.Tests/SdFactoryBusinessLogicTests.cs index 7901edcb0b..369bd18231 100644 --- a/tests/externalsystems/SdFactory.Library.Tests/SdFactoryBusinessLogicTests.cs +++ b/tests/externalsystems/SdFactory.Library.Tests/SdFactoryBusinessLogicTests.cs @@ -146,10 +146,12 @@ public async Task StartSelfDescriptionRegistration_WithValidData_CompanyIsUpdate result.Should().NotBeNull(); result.ModifyChecklistEntry.Should().NotBeNull(); result.ModifyChecklistEntry!.Invoke(entry); + result.ProcessMessage.Should().Be(clearinghouseConnectDisabled ? "Self description was skipped due to clearinghouse trigger is disabled" : null); entry.ApplicationChecklistEntryStatusId.Should().Be(clearinghouseConnectDisabled ? ApplicationChecklistEntryStatusId.DONE : ApplicationChecklistEntryStatusId.IN_PROGRESS); result.ScheduleStepTypeIds.Should().ContainSingle().And.Match(x => clearinghouseConnectDisabled ? x.Single() == ProcessStepTypeId.ACTIVATE_APPLICATION : x.Single() == ProcessStepTypeId.FINISH_SELF_DESCRIPTION_LP); result.SkipStepTypeIds.Should().BeNull(); result.Modified.Should().BeTrue(); + result.StepStatusId.Should().Be(clearinghouseConnectDisabled ? ProcessStepStatusId.SKIPPED : ProcessStepStatusId.DONE); } [Fact]