From fdb1d34f13679c7e7d755cb7a6d0e5abac8e0d37 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Fri, 17 Apr 2026 16:26:24 +0100 Subject: [PATCH 1/2] Improve user feedback for reconciliation and log upload Added success and failure toast notifications for reconciliation and log upload actions in AdminPageViewModel and SupportPageViewModel. Navigation now occurs only on success, replacing previous TODOs and enhancing user experience with clear operation outcomes. --- .../ViewModels/Admin/AdminPageViewModel.cs | 13 +++++++++---- .../ViewModels/Support/SupportPageViewModel.cs | 11 +++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Admin/AdminPageViewModel.cs b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Admin/AdminPageViewModel.cs index e6dc6ae1..460ad85f 100644 --- a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Admin/AdminPageViewModel.cs +++ b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Admin/AdminPageViewModel.cs @@ -41,10 +41,15 @@ private async Task Reconciliation() CorrelationIdProvider.NewId(); TransactionCommands.PerformReconciliationCommand command = new TransactionCommands.PerformReconciliationCommand(DateTime.Now, String.Empty, this.ApplicationInfoService.VersionString); - await this.Mediator.Send(command); - - // TODO: Act on the response (display message or something)... - await this.NavigationService.GoToHome(); + Result result = await this.Mediator.Send(command); + + if (result.IsSuccess) { + await this.DialogService.ShowInformationToast("Reconciliation Succeeded"); + await this.NavigationService.GoToHome(); + } + else { + await this.DialogService.ShowWarningToast("Reconciliation Failed"); + } } #endregion diff --git a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Support/SupportPageViewModel.cs b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Support/SupportPageViewModel.cs index 95e95bc1..aee7a714 100644 --- a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Support/SupportPageViewModel.cs +++ b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Support/SupportPageViewModel.cs @@ -71,17 +71,20 @@ private async Task UploadLogs() { SupportCommands.UploadLogsCommand command = new(String.Empty); - await this.Mediator.Send(command, CancellationToken.None); + var result = await this.Mediator.Send(command, CancellationToken.None); - // TODO: Act on the response (display message or something)... - //await this.NavigationService.GoBack(); + if (result.IsSuccess) { + await this.DialogService.ShowInformationToast("Logs have been uploaded successfully."); + await this.NavigationService.GoBack(); + } else { + await this.DialogService.ShowWarningToast("Failed to upload logs."); + } } [RelayCommand] private async Task ViewLogs() { Logger.LogInformation("ViewLogs called"); - // TODO: Act on the response (display message or something)... await this.NavigationService.GoToViewLogsPage(); } From 1625c0f2e5893c1023fb8c44ad04a46abe4e0ec2 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Fri, 17 Apr 2026 17:35:02 +0100 Subject: [PATCH 2/2] fix broken tests --- .../ViewModelTests/Support/SupportPageViewModelTests.cs | 2 ++ .../Transactions/Admin/AdminPageViewModelTests.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Support/SupportPageViewModelTests.cs b/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Support/SupportPageViewModelTests.cs index 6bae3e60..fa8ba7e6 100644 --- a/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Support/SupportPageViewModelTests.cs +++ b/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Support/SupportPageViewModelTests.cs @@ -2,6 +2,7 @@ using MediatR; using Moq; using Shouldly; +using SimpleResults; using TransactionProcessor.Mobile.BusinessLogic.Database; using TransactionProcessor.Mobile.BusinessLogic.Requests; using TransactionProcessor.Mobile.BusinessLogic.Services; @@ -52,6 +53,7 @@ public SupportPageViewModelTests() { [Fact] public void SupportPageViewModel_UploadLogsCommand_Execute_IsExecuted() { + this.Mediator.Setup(m => m.Send(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success()); this.ViewModel.UploadLogsCommand.Execute(null); this.Mediator.Verify(m => m.Send(It.IsAny(),It.IsAny()),Times.Once); diff --git a/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Transactions/Admin/AdminPageViewModelTests.cs b/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Transactions/Admin/AdminPageViewModelTests.cs index 01219b78..096605f2 100644 --- a/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Transactions/Admin/AdminPageViewModelTests.cs +++ b/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Transactions/Admin/AdminPageViewModelTests.cs @@ -1,5 +1,7 @@ using MediatR; using Moq; +using SimpleResults; +using TransactionProcessor.Mobile.BusinessLogic.Requests; using TransactionProcessor.Mobile.BusinessLogic.Services; using TransactionProcessor.Mobile.BusinessLogic.UIServices; using TransactionProcessor.Mobile.BusinessLogic.ViewModels.Admin; @@ -42,6 +44,7 @@ public AdminPageViewModelTests() { [Fact] public void AdminPageViewModel_AdminCommand_Execute_IsExecuted() { + this.Mediator.Setup(m => m.Send(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success()); this.ViewModel.ReconciliationCommand.Execute(null); this.NavigationService.Verify(n => n.GoToHome(), Times.Once); }