Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ public async Task<Result<List<ContractOperatorModel>>> Handle(MerchantQueries.Ge
}

products = getProductsResult.Data;
}

if (request.ProductType.HasValue)
{
products = products.Where(p => p.ProductType == request.ProductType).ToList();
}
if (request.ProductType.HasValue)
{
products = products.Where(p => p.ProductType == request.ProductType).ToList();
}

List<ContractOperatorModel> operators = products.GroupBy(c => new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ private record Contract(Guid ContractId, Guid OperatorId, string OperatorIdentfi
private readonly Contract Hospital1Contract = new(Guid.Parse("21DA6AC5-70E6-478E-A5E9-74C9B27F5725"), Guid.Parse("2CA5F4C7-34EC-425B-BB53-7EEDF48D9967"), "Hospital 1 Contract", "Hospital 1 Contract");
private readonly Contract SafaricomContract = new(Guid.Parse("D57DAC9B-4039-4120-B5A8-F7FDF1D3A3C2"), Guid.Parse("2CA5F4C7-34EC-425B-BB53-7EEDF48D9967"), "Safaricom", "Safaricom");
private readonly Contract PataPawaPostPayContract = new(Guid.Parse("0615E7F6-2749-4507-8588-E019E8110C95"), Guid.Parse("C485F21B-EF17-448D-8B8C-E217A07C1863"), "PataPawaPostPay", "PataPawaPostPay");
private readonly Contract PataPawaPrePayContract = new(Guid.Parse("7AAFFE8D-4EA2-485F-8600-D4D29A0043F0"), Guid.Parse("C485F21B-EF17-448D-8B8C-E217A07C1863"), "PataPawaPrePay", "PataPawaPrePay");
private readonly Contract PataPawaPrePayContract = new(Guid.Parse("7AAFFE8D-4EA2-485F-8600-D4D29A0043F0"), Guid.Parse("DD5F1E0D-797C-4A00-ADD8-CA328A8543C3"), "PataPawaPrePay", "PataPawaPrePay");

private static ContractProductModel CreateContractProductModel(Contract contract, string productDisplayText, Guid productId, ProductType productType, decimal? value = null) {
ContractProductModel product = new() {
Expand Down
75 changes: 41 additions & 34 deletions TransactionProcessor.Mobile/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,40 +153,47 @@
#endif
MainPage = new AppShell();

Routing.RegisterRoute("login", typeof(LoginPage));
Routing.RegisterRoute("home", typeof(HomePage));

Routing.RegisterRoute(nameof(MobileTopupSelectOperatorPage), typeof(MobileTopupSelectOperatorPage));
Routing.RegisterRoute(nameof(MobileTopupSelectProductPage), typeof(MobileTopupSelectProductPage));
Routing.RegisterRoute(nameof(MobileTopupPerformTopupPage), typeof(MobileTopupPerformTopupPage));
Routing.RegisterRoute(nameof(MobileTopupSuccessPage), typeof(MobileTopupSuccessPage));
Routing.RegisterRoute(nameof(MobileTopupFailedPage), typeof(MobileTopupFailedPage));

Routing.RegisterRoute(nameof(VoucherSelectOperatorPage), typeof(VoucherSelectOperatorPage));
Routing.RegisterRoute(nameof(VoucherSelectProductPage), typeof(VoucherSelectProductPage));
Routing.RegisterRoute(nameof(VoucherPerformIssuePage), typeof(VoucherPerformIssuePage));
Routing.RegisterRoute(nameof(VoucherIssueSuccessPage), typeof(VoucherIssueSuccessPage));
Routing.RegisterRoute(nameof(VoucherIssueFailedPage), typeof(VoucherIssueFailedPage));

Routing.RegisterRoute(nameof(BillPaymentSelectOperatorPage), typeof(BillPaymentSelectOperatorPage));
Routing.RegisterRoute(nameof(BillPaymentSelectProductPage), typeof(BillPaymentSelectProductPage));
Routing.RegisterRoute(nameof(BillPaymentGetAccountPage), typeof(BillPaymentGetAccountPage));
Routing.RegisterRoute(nameof(BillPaymentGetMeterPage), typeof(BillPaymentGetMeterPage));
Routing.RegisterRoute(nameof(BillPaymentPayBillPage), typeof(BillPaymentPayBillPage));
Routing.RegisterRoute(nameof(BillPaymentSuccessPage), typeof(BillPaymentSuccessPage));
Routing.RegisterRoute(nameof(BillPaymentFailedPage), typeof(BillPaymentFailedPage));

Routing.RegisterRoute(nameof(AdminPage), typeof(AdminPage));
Routing.RegisterRoute(nameof(LoginPage), typeof(LoginPage));

Routing.RegisterRoute(nameof(ViewLogsPage), typeof(ViewLogsPage));

Routing.RegisterRoute(nameof(ReportsBalanceAnalysisPage), typeof(ReportsBalanceAnalysisPage));
Routing.RegisterRoute(nameof(ReportsSalesAnalysisPage), typeof(ReportsSalesAnalysisPage));

Routing.RegisterRoute(nameof(MyAccountAddressesPage), typeof(MyAccountAddressesPage));
Routing.RegisterRoute(nameof(MyAccountContactPage), typeof(MyAccountContactPage));
Routing.RegisterRoute(nameof(MyAccountDetailsPage), typeof(MyAccountDetailsPage));
//RegisterRouteOnce("login", typeof(LoginPage));

Check notice on line 156 in TransactionProcessor.Mobile/App.xaml.cs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

TransactionProcessor.Mobile/App.xaml.cs#L156

Remove this commented out code.
//RegisterRouteOnce("home", typeof(HomePage));

RegisterRouteOnce(nameof(MobileTopupSelectOperatorPage), typeof(MobileTopupSelectOperatorPage));
RegisterRouteOnce(nameof(MobileTopupSelectProductPage), typeof(MobileTopupSelectProductPage));
RegisterRouteOnce(nameof(MobileTopupPerformTopupPage), typeof(MobileTopupPerformTopupPage));
RegisterRouteOnce(nameof(MobileTopupSuccessPage), typeof(MobileTopupSuccessPage));
RegisterRouteOnce(nameof(MobileTopupFailedPage), typeof(MobileTopupFailedPage));

RegisterRouteOnce(nameof(VoucherSelectOperatorPage), typeof(VoucherSelectOperatorPage));
RegisterRouteOnce(nameof(VoucherSelectProductPage), typeof(VoucherSelectProductPage));
RegisterRouteOnce(nameof(VoucherPerformIssuePage), typeof(VoucherPerformIssuePage));
RegisterRouteOnce(nameof(VoucherIssueSuccessPage), typeof(VoucherIssueSuccessPage));
RegisterRouteOnce(nameof(VoucherIssueFailedPage), typeof(VoucherIssueFailedPage));

RegisterRouteOnce(nameof(BillPaymentSelectOperatorPage), typeof(BillPaymentSelectOperatorPage));
RegisterRouteOnce(nameof(BillPaymentSelectProductPage), typeof(BillPaymentSelectProductPage));
RegisterRouteOnce(nameof(BillPaymentGetAccountPage), typeof(BillPaymentGetAccountPage));
RegisterRouteOnce(nameof(BillPaymentGetMeterPage), typeof(BillPaymentGetMeterPage));
RegisterRouteOnce(nameof(BillPaymentPayBillPage), typeof(BillPaymentPayBillPage));
RegisterRouteOnce(nameof(BillPaymentSuccessPage), typeof(BillPaymentSuccessPage));
RegisterRouteOnce(nameof(BillPaymentFailedPage), typeof(BillPaymentFailedPage));
RegisterRouteOnce(nameof(AdminPage), typeof(AdminPage));
//RegisterRouteOnce(nameof(LoginPage), typeof(LoginPage));

Check notice on line 179 in TransactionProcessor.Mobile/App.xaml.cs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

TransactionProcessor.Mobile/App.xaml.cs#L179

Remove this commented out code.

RegisterRouteOnce(nameof(ViewLogsPage), typeof(ViewLogsPage));

RegisterRouteOnce(nameof(ReportsBalanceAnalysisPage), typeof(ReportsBalanceAnalysisPage));
RegisterRouteOnce(nameof(ReportsSalesAnalysisPage), typeof(ReportsSalesAnalysisPage));

RegisterRouteOnce(nameof(MyAccountAddressesPage), typeof(MyAccountAddressesPage));
RegisterRouteOnce(nameof(MyAccountContactPage), typeof(MyAccountContactPage));
RegisterRouteOnce(nameof(MyAccountDetailsPage), typeof(MyAccountDetailsPage));
}

static readonly HashSet<string> s_registeredRoutes = new();

static void RegisterRouteOnce(string route, Type pageType)
{
if (s_registeredRoutes.Add(route))
Routing.RegisterRoute(route, pageType);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public async Task GoBack() {
}

public async Task GoToHome() {
Application.Current.MainPage = new AppShell();
await NavigateTo("///main/home");
}

Expand Down Expand Up @@ -166,7 +165,7 @@ public async Task GoToBillPaymentPayBillPage(ProductDetails productDetails,

public async Task GoToLoginPage() {
Application.Current.MainPage = new AppShell();
await NavigateTo("///loginpage");
await NavigateTo("///login");
}

public async Task GoToViewLogsPage() {
Expand Down
Loading