diff --git a/TransactionProcessor.Mobile.BusinessLogic/UIServices/INavigationService.cs b/TransactionProcessor.Mobile.BusinessLogic/UIServices/INavigationService.cs index d07ae4c08..acfe12075 100644 --- a/TransactionProcessor.Mobile.BusinessLogic/UIServices/INavigationService.cs +++ b/TransactionProcessor.Mobile.BusinessLogic/UIServices/INavigationService.cs @@ -62,6 +62,8 @@ Task GoToBillPaymentPayBillPage(ProductDetails productDetails, Task GoToMyAccountContacts(); Task GoToMyAccountDetails(); + Task GoToTransactionsPage(); + Task GoToReportsSalesAnalysis(); Task GoToReportsBalanceAnalysis(); diff --git a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/HomePageViewModel.cs b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/HomePageViewModel.cs index 9cc4b25c3..53f122250 100644 --- a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/HomePageViewModel.cs +++ b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/HomePageViewModel.cs @@ -1,18 +1,96 @@ -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; +using CommunityToolkit.Mvvm.Input; +using TransactionProcessor.Mobile.BusinessLogic.Common; +using TransactionProcessor.Mobile.BusinessLogic.Models; using TransactionProcessor.Mobile.BusinessLogic.Services; using TransactionProcessor.Mobile.BusinessLogic.UIServices; namespace TransactionProcessor.Mobile.BusinessLogic.ViewModels; -[ExcludeFromCodeCoverage] -public class HomePageViewModel : ExtendedBaseViewModel +public partial class HomePageViewModel : ExtendedBaseViewModel { + #region Fields + + private String merchantName; + private String availableBalance; + + #endregion + + #region Constructors + public HomePageViewModel(IApplicationCache applicationCache, IDialogService dialogService, IDeviceService deviceService, INavigationService navigationService, - INavigationParameterService navigationParameterService) :base(applicationCache,dialogService, navigationService, deviceService,navigationParameterService) + INavigationParameterService navigationParameterService) + : base(applicationCache, dialogService, navigationService, deviceService, navigationParameterService) + { + this.Title = "Home"; + } + + #endregion + + #region Properties + + public String MerchantName + { + get => this.merchantName; + set => this.SetProperty(ref this.merchantName, value); + } + + public String AvailableBalance { - + get => this.availableBalance; + set => this.SetProperty(ref this.availableBalance, value); } -} \ No newline at end of file + + #endregion + + #region Methods + + public override async Task Initialise(CancellationToken cancellationToken) + { + await base.Initialise(cancellationToken); + + MerchantDetailsModel merchantDetails = this.ApplicationCache.GetMerchantDetails(); + if (merchantDetails != null) + { + this.MerchantName = merchantDetails.MerchantName; + this.AvailableBalance = merchantDetails.AvailableBalance.ToString("C2"); + } + else + { + this.MerchantName = String.Empty; + this.AvailableBalance = "-"; + } + } + + [RelayCommand] + public async Task MobileTopup() + { + CorrelationIdProvider.NewId(); + await this.NavigationService.GoToMobileTopupSelectOperatorPage(); + } + + [RelayCommand] + public async Task BillPayment() + { + CorrelationIdProvider.NewId(); + await this.NavigationService.GoToBillPaymentSelectOperatorPage(); + } + + [RelayCommand] + public async Task Voucher() + { + CorrelationIdProvider.NewId(); + await this.NavigationService.GoToVoucherSelectOperatorPage(); + } + + [RelayCommand] + public async Task AllTransactions() + { + await this.NavigationService.GoToTransactionsPage(); + } + + #endregion +} diff --git a/TransactionProcessor.Mobile/Pages/AppHome/HomePage.xaml b/TransactionProcessor.Mobile/Pages/AppHome/HomePage.xaml index ad32197be..01f907e18 100644 --- a/TransactionProcessor.Mobile/Pages/AppHome/HomePage.xaml +++ b/TransactionProcessor.Mobile/Pages/AppHome/HomePage.xaml @@ -4,13 +4,99 @@ x:Class="TransactionProcessor.Mobile.Pages.AppHome.HomePage" xmlns:controls="using:TransactionProcessor.Mobile.Controls" xmlns:common="using:TransactionProcessor.Mobile.Pages.Common" - Shell.NavBarIsVisible="False"> - - - - + - - \ No newline at end of file + + + diff --git a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml index e16b0e28a..07114e21f 100644 --- a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml +++ b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml @@ -4,42 +4,82 @@ x:Class="TransactionProcessor.Mobile.Pages.MyAccount.MyAccountAddressesPage" xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls" Shell.NavBarIsVisible="False"> - - - - - - - + + + + + + + + + + + + - \ No newline at end of file + diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentFailedPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentFailedPage.xaml index ded937e65..04c901b5f 100644 --- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentFailedPage.xaml +++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentFailedPage.xaml @@ -6,29 +6,42 @@ xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" Shell.NavBarIsVisible="False" x:Name="BillPaymentFailed"> - - - - - + + - + + + - \ No newline at end of file + diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetAccountPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetAccountPage.xaml index d26a874d1..7dfc60a19 100644 --- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetAccountPage.xaml +++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetAccountPage.xaml @@ -6,33 +6,53 @@ xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" Shell.NavBarIsVisible="False" x:Name="BillPaymentGetAccount"> - - - - - - - - - - - - + + + + + - - + + + + + + + + + - \ No newline at end of file + diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupFailedPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupFailedPage.xaml index 1b84bf956..56caed5d8 100644 --- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupFailedPage.xaml +++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupFailedPage.xaml @@ -6,28 +6,43 @@ x:Class="TransactionProcessor.Mobile.Pages.Transactions.MobileTopup.MobileTopupFailedPage" Shell.NavBarIsVisible="False" x:Name="MobileTopupFailed"> - - - - - + + - + + + - \ No newline at end of file + diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml index 66c2d24cb..9a0772a1d 100644 --- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml +++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml @@ -6,62 +6,92 @@ xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" Shell.NavBarIsVisible="False" x:Name="MobileTopPerformTopup"> - - - - - - - - - - + + - - - - - + + + - \ No newline at end of file + diff --git a/TransactionProcessor.Mobile/Pages/Transactions/TransactionsPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/TransactionsPage.xaml index bb0e3a449..4f27e5043 100644 --- a/TransactionProcessor.Mobile/Pages/Transactions/TransactionsPage.xaml +++ b/TransactionProcessor.Mobile/Pages/Transactions/TransactionsPage.xaml @@ -7,51 +7,95 @@ xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" Shell.NavBarIsVisible="False" x:Name="Transactions"> - - - - - - - - - - - - - - - + + + + + + + + + + + + - \ No newline at end of file + diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueSuccessPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueSuccessPage.xaml index 564eb27e5..fb041d8d9 100644 --- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueSuccessPage.xaml +++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueSuccessPage.xaml @@ -6,29 +6,52 @@ x:Class="TransactionProcessor.Mobile.Pages.Transactions.Voucher.VoucherIssueSuccessPage" Shell.NavBarIsVisible="False" x:Name="VoucherIssueSuccess"> - - - - - + + - + + + - \ No newline at end of file + diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml index 7101bac40..f6651ffdf 100644 --- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml +++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml @@ -6,76 +6,108 @@ xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" Shell.NavBarIsVisible="False" x:Name="VoucherPerformIssue"> - - - - - - - - - - + + - - - - - + + +