diff --git a/GMCabsDriverAssistantSolution.sln b/GMCabsDriverAssistantSolution.sln
new file mode 100644
index 0000000..d9cf12e
--- /dev/null
+++ b/GMCabsDriverAssistantSolution.sln
@@ -0,0 +1,27 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31611.283
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GMCabsDriverAssistantSolution", "GMCabsDriverAssistantSolution\GMCabsDriverAssistantSolution.csproj", "{0EDC2645-979C-4F67-87E5-A9D842F11175}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0EDC2645-979C-4F67-87E5-A9D842F11175}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0EDC2645-979C-4F67-87E5-A9D842F11175}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0EDC2645-979C-4F67-87E5-A9D842F11175}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {0EDC2645-979C-4F67-87E5-A9D842F11175}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0EDC2645-979C-4F67-87E5-A9D842F11175}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0EDC2645-979C-4F67-87E5-A9D842F11175}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
+ EndGlobalSection
+EndGlobal
diff --git a/GMCabsDriverAssistantSolution/App.xaml b/GMCabsDriverAssistantSolution/App.xaml
new file mode 100644
index 0000000..2f710ca
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/App.xaml
@@ -0,0 +1,20 @@
+
+
+
+
+ #126db5
+
+
+
+
diff --git a/GMCabsDriverAssistantSolution/App.xaml.cs b/GMCabsDriverAssistantSolution/App.xaml.cs
new file mode 100644
index 0000000..6bbb44b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/App.xaml.cs
@@ -0,0 +1,219 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using GMCabsDriverAssistantSolution.Styles;
+using Plugin.FirebasePushNotification;
+using System.Diagnostics;
+
+namespace GMCabsDriverAssistantSolution;
+
+public partial class App : Application
+{
+ private static SQLiteDatabaseService database;
+ public static SQLiteDatabaseService Database
+ {
+ get
+ {
+ if (database == null)
+ {
+ string databasePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "AvailableBooking.db3");
+ database = new SQLiteDatabaseService(databasePath);
+ }
+
+ return database;
+ }
+ }
+ public App()
+ {
+ InitializeComponent();
+ dictionary.MergedDictionaries.Add(PhoneLayoutStyle.SharedInstance);
+ MainPage = new AppShell();
+ }
+
+ [Obsolete]
+ protected override async void OnStart()
+ {
+ try
+ {
+ ShareConstant.IsInForeground = true;
+ Preferences.Set(SecureStorageData.InitLaunched, "");
+ CrossFirebasePushNotification.Current.Subscribe("all");
+ CrossFirebasePushNotification.Current.OnTokenRefresh += (s, e) =>
+ {
+ Debug.WriteLine($"Token: {e.Token}");
+ };
+ Debug.WriteLine($"TOKEN: {CrossFirebasePushNotification.Current.Token}");
+
+ CrossFirebasePushNotification.Current.OnNotificationReceived += (s, e) =>
+ {
+ try
+ {
+ Debug.WriteLine("Received");
+ if (e.Data.ContainsKey("category"))
+ {
+ if (e.Data["category"].ToString().Equals("BookingCancelled"))
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ CancelledBookingResponseDto cancelledBookingResponseDto = new CancelledBookingResponseDto();
+ cancelledBookingResponseDto.PickUPAddress = e.Data["fromAddress"].ToString();
+ cancelledBookingResponseDto.DropUpAddress = e.Data["toAddress"].ToString();
+ MessagingCenter.Send(this, nameof(App), cancelledBookingResponseDto);
+ //if (Device.RuntimePlatform == Device.iOS)
+ //{
+ // if (ShareConstant.IsInForeground)
+ // {
+ // var player = CrossSimpleAudioPlayer.Current;
+ // player.Load("system.wav");
+ // player.Play();
+ // }
+ //}
+ });
+ }
+ else if (e.Data["category"].ToString().Equals("BookingClearAccepted"))
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ MessagingCenter.Send(this, "ClearAcceptance", string.Empty);
+ });
+ }
+ else if (e.Data["category"].ToString().Equals("CouponRedeemed"))
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ CouponDto coupon = new CouponDto();
+ coupon.Id = e.Data["couponid"].ToString();
+ coupon.Status = e.Data["status"].ToString();
+ MessagingCenter.Send(this, nameof(App), coupon);
+ });
+ }
+ else if (e.Data["category"].ToString().Equals("NotificationAvailable"))
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ NotificationDto notification = new NotificationDto();
+ notification.Id = e.Data["id"].ToString();
+ notification.Subject = e.Data["subject"].ToString();
+ notification.Body = e.Data["notification_body"].ToString();
+ MessagingCenter.Send(this, nameof(App), notification);
+ //if (Device.RuntimePlatform == Device.iOS)
+ //{
+ // if (ShareConstant.IsInForeground)
+ // {
+ // var player = CrossSimpleAudioPlayer.Current;
+ // player.Load("system.wav");
+ // player.Play();
+ // }
+ //}
+ });
+ }
+ else if (e.Data["category"].ToString().Equals("IsTabletInstallation"))
+ {
+
+ Debug.WriteLine($"{e.Data["category"]}");
+ var istablet = Convert.ToBoolean(e.Data["istabletinstallation"].ToString());
+ Preferences.Set("IsTablet", istablet);
+ MessagingCenter.Send(this, nameof(App), e.Data["category"].ToString());
+
+ }
+ else if (e.Data["category"].ToString().Equals("DriverAlertNotification"))
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ Debug.WriteLine($"{e.Data["category"]}");
+ MessagingCenter.Send(this, nameof(App), e.Data["category"].ToString());
+ });
+ }
+ else if (e.Data["category"].ToString().Equals("CouponAvailable"))
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ Debug.WriteLine($"{e.Data["category"]}");
+ MessagingCenter.Send(this, nameof(App), e.Data["category"].ToString());
+ //if (Device.RuntimePlatform == Device.iOS)
+ //{
+ // if (ShareConstant.IsInForeground)
+ // {
+ // var player = CrossSimpleAudioPlayer.Current;
+ // player.Load("system.wav");
+ // player.Play();
+ // }
+ //}
+
+ });
+ }
+ else if (e.Data["category"].ToString().Equals("BookingAvailable"))
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ Debug.WriteLine($"{e.Data["category"]}");
+ MessagingCenter.Send(this, nameof(App), e.Data["category"].ToString());
+ //if (Device.RuntimePlatform == Device.iOS)
+ //{
+ // if (ShareConstant.IsInForeground)
+ // {
+ // var player = CrossSimpleAudioPlayer.Current;
+ // player.Load("newbooking.wav");
+ // player.Play();
+ // }
+ //}
+
+ });
+ }
+ else
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ Debug.WriteLine($"{e.Data["category"]}");
+ MessagingCenter.Send(this, nameof(App), e.Data["category"].ToString());
+ });
+ }
+ }
+ else if (e.Data.ContainsKey("coupon_category"))
+ {
+ if (e.Data["coupon_category"].ToString().Equals("CouponRedeemed"))
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ MessagingCenter.Send(this, nameof(App), e.Data["coupon_category"].ToString());
+ });
+
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ };
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Onstart Error Entry: {ex.StackTrace}");
+ }
+ }
+
+ protected override void OnSleep()
+ {
+ try
+ {
+ ShareConstant.IsInForeground = false;
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Onsleep Error Entry: {ex.StackTrace}");
+ }
+ }
+ protected override void OnResume()
+ {
+ try
+ {
+ ShareConstant.IsInForeground = true;
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"OnResume Error Entry: {ex.StackTrace}");
+ }
+ }
+
+}
diff --git a/GMCabsDriverAssistantSolution/AppShell.xaml b/GMCabsDriverAssistantSolution/AppShell.xaml
new file mode 100644
index 0000000..f8d69c1
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/AppShell.xaml
@@ -0,0 +1,240 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GMCabsDriverAssistantSolution/AppShell.xaml.cs b/GMCabsDriverAssistantSolution/AppShell.xaml.cs
new file mode 100644
index 0000000..5dc23c5
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/AppShell.xaml.cs
@@ -0,0 +1,236 @@
+using GMCabsDriverAssistantSolution.Views;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Threading.Tasks;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+using GMCabsDriverAssistant.ViewModels;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using Sentry;
+using GMCabsDriverAssistant.Messages;
+
+namespace GMCabsDriverAssistantSolution;
+
+public partial class AppShell : Shell
+{
+ #region Fields
+ private readonly AppShellViewModel _viewModel;
+ private string imeiNumber;
+ private string carNumber;
+ #endregion
+
+ #region Properties
+ #endregion
+
+ #region Constructor
+ public AppShell()
+ {
+ InitializeComponent();
+ BindingContext = _viewModel = new AppShellViewModel(this);
+ Task.Run(async () =>
+ {
+ //string couponsPermission = await SecureStorageData.GetSecureStorage(SecureStorageData.CanViewCoupons);
+ //if (string.IsNullOrEmpty(couponsPermission)) { couponsPermission = "false"; }
+
+ //string settingsPermission = await SecureStorageData.GetSecureStorage(SecureStorageData.CanViewSettings);
+ //if (string.IsNullOrEmpty(settingsPermission)) { settingsPermission = "false"; }
+
+ //string homePermission = await SecureStorageData.GetSecureStorage(SecureStorageData.CanViewHome);
+ //if (string.IsNullOrEmpty(homePermission)) { homePermission = "true"; }
+
+ //_viewModel.IsVisibleDrivingLicenceScan = Preferences.Get(SecureStorageData.CanUpdateLicence, false);
+ //_viewModel.IsVisibleVoucherScan = Preferences.Get(SecureStorageData.CanScanVouchers, false);
+ //_viewModel.IsVisibleRydo = Preferences.Get(SecureStorageData.CanAcceptBookings, false);
+ //_viewModel.IsVisibleCoupons = Preferences.Get(SecureStorageData.CanViewCoupons, true);
+ //_viewModel.IsVisibleSettings = Preferences.Get(SecureStorageData.CanViewSettings, true);
+ //_viewModel.IsCanViewHome = Preferences.Get(SecureStorageData.CanViewHome, false);
+ //_viewModel.DriverName = Preferences.Get(SecureStorageData.DriverName, "");
+ //_viewModel.DriverMobileNumber = Preferences.Get("DriverMobileNumber", "");
+ });
+
+ Routing.RegisterRoute(nameof(LoginPage), typeof(LoginPage));
+ Routing.RegisterRoute(nameof(NewPage1), typeof(NewPage1));
+ //Routing.RegisterRoute(nameof(HomePage), typeof(HomePage));
+ Routing.RegisterRoute(nameof(AdminPasswordPage), typeof(AdminPasswordPage));
+ Routing.RegisterRoute(nameof(TaxiInstallPage), typeof(TaxiInstallPage));
+ Routing.RegisterRoute(nameof(InstallCompletePage), typeof(InstallCompletePage));
+ Routing.RegisterRoute(nameof(UserRegistrationGenerateOtpPage), typeof(UserRegistrationGenerateOtpPage));
+ Routing.RegisterRoute(nameof(UserSignUpPage), typeof(UserSignUpPage));
+ Routing.RegisterRoute(nameof(UserRegistrationVerifyOtpPage), typeof(UserRegistrationVerifyOtpPage));
+ Routing.RegisterRoute(nameof(UserRegistrationUpdateDriverPinPage), typeof(UserRegistrationUpdateDriverPinPage));
+ Routing.RegisterRoute(nameof(CouponsPage), typeof(CouponsPage));
+ Routing.RegisterRoute(nameof(CouponsV2Page), typeof(CouponsV2Page));
+ Routing.RegisterRoute(nameof(ScanDrivingLicencePage), typeof(ScanDrivingLicencePage));
+ Routing.RegisterRoute(nameof(ScanVoucherPage), typeof(ScanVoucherPage));
+ Routing.RegisterRoute(nameof(SettingsPage), typeof(SettingsPage));
+ //Routing.RegisterRoute(nameof(BookingsPage), typeof(BookingsPage));
+ //Routing.RegisterRoute(nameof(BookingDetailsPage), typeof(BookingDetailsPage));
+ //Routing.RegisterRoute(nameof(AcceptBookingPage), typeof(AcceptBookingPage));
+ //Routing.RegisterRoute(nameof(CancelledBookingPage), typeof(CancelledBookingPage));
+ Routing.RegisterRoute(nameof(AcceptedFutureBookingsPage), typeof(AcceptedFutureBookingsPage));
+ //Routing.RegisterRoute(nameof(AcceptedFutureBookingDetailPage), typeof(AcceptedFutureBookingDetailPage));
+ //Routing.RegisterRoute(nameof(VoucherScanHistory), typeof(VoucherScanHistory));
+ //Routing.RegisterRoute(nameof(BookingDetailsTabletPage), typeof(BookingDetailsTabletPage));
+ //Routing.RegisterRoute(nameof(OnTripTabletPage), typeof(OnTripTabletPage));
+ //Routing.RegisterRoute(nameof(BookingOnWayTabletPage), typeof(BookingOnWayTabletPage));
+ //Routing.RegisterRoute(nameof(PassgerCollectedPage), typeof(PassgerCollectedPage));
+ //Routing.RegisterRoute(nameof(PassengerDroppedWithNoPaymentMethodIdNoFixedFareTablet), typeof(PassengerDroppedWithNoPaymentMethodIdNoFixedFareTablet));
+ //Routing.RegisterRoute(nameof(PassengerDroppedWithNoPaymentMethodIdAndFixedFareTablet), typeof(PassengerDroppedWithNoPaymentMethodIdAndFixedFareTablet));
+ //Routing.RegisterRoute(nameof(PassengerDroppedWithPaymentMethodIdAndFixedFareTablet), typeof(PassengerDroppedWithPaymentMethodIdAndFixedFareTablet));
+ //Routing.RegisterRoute(nameof(PassengerDroppedWithPaymentMethodIdNoFixedFareTablet), typeof(PassengerDroppedWithPaymentMethodIdNoFixedFareTablet));
+ //Routing.RegisterRoute(nameof(BookingCompletedTabletPage), typeof(BookingCompletedTabletPage));
+ //Routing.RegisterRoute(nameof(NavigateToHomePageTablet), typeof(NavigateToHomePageTablet));
+ //Routing.RegisterRoute(nameof(CancelledBookingTabletPage), typeof(CancelledBookingTabletPage));
+ Routing.RegisterRoute(nameof(ImeiNumberInstallPage), typeof(ImeiNumberInstallPage));
+ //Routing.RegisterRoute(nameof(JobHistoryTabletPage), typeof(JobHistoryTabletPage));
+ //Routing.RegisterRoute(nameof(MyAccountTabletPage), typeof(MyAccountTabletPage));
+ //Routing.RegisterRoute(nameof(MyShiftsTabletPage), typeof(MyShiftsTabletPage));
+ //Routing.RegisterRoute(nameof(AcceptedFutureBookingsTabletPage), typeof(AcceptedFutureBookingsTabletPage));
+ //Routing.RegisterRoute(nameof(AcceptedFutureBookingTabletDetailPage), typeof(AcceptedFutureBookingTabletDetailPage));
+
+ //if (!Preferences.ContainsKey(Constants.VoucherScanUseFrontCamera))
+ //{
+ // Preferences.Set(Constants.VoucherScanUseFrontCamera, true);
+ //}
+ imeiNumber = Preferences.Get("imeiNumber", null);
+ carNumber = Preferences.Get("carNumber", null);
+ var isTablet = Preferences.Get("IsTablet", false);
+ //homePageTabletFlyout.IsVisible = true;
+ //homePageFlyout.IsVisible = true;
+ if (isTablet && !string.IsNullOrWhiteSpace(imeiNumber) && !string.IsNullOrWhiteSpace(carNumber))
+ {
+ ICollection collection = Application.Current.Resources.MergedDictionaries;
+ if (collection != null)
+ {
+ collection.Clear();
+ //collection.Add(new TabletLayoutStyle());
+ }
+ }
+ //if (Device.RuntimePlatform == Device.Android && isTablet && !string.IsNullOrWhiteSpace(imeiNumber) && !string.IsNullOrWhiteSpace(carNumber))
+ //{
+ // homePageTabletFlyout.IsVisible = true;
+ // homePageFlyout.IsVisible = false;
+ // _viewModel.IsVisibleCoupons = false;
+ // _viewModel.IsVisibleSettings = false;
+ // _viewModel.IsCanViewHome = false;
+ // _viewModel.IsVisibleJobHistory = true;
+ // _viewModel.IsVisibleRydo = true;
+ // _viewModel.IsVisibleMyShifts = true;
+ // _viewModel.IsVisibleMyAccount = true;
+ //}
+ //else
+ //{
+ // _viewModel.IsVisibleCoupons = true;
+ // _viewModel.IsVisibleSettings = true;
+ // homePageTabletFlyout.IsVisible = false;
+ // homePageFlyout.IsVisible = true;
+ // _viewModel.IsVisibleJobHistory = false;
+ // _viewModel.IsVisibleMyShifts = false;
+ // _viewModel.IsVisibleMyAccount = false;
+ //}
+ }
+ #endregion
+
+ #region Methods
+ [Obsolete]
+ private async void LogoutClicked(object sender, EventArgs e)
+ {
+ DispatchAppComponentService.SetToInitialProperties();
+ var imeiNumber = Preferences.Get("imeiNumber", null);
+ var carNumber = Preferences.Get("carNumber", null);
+ var isTablet = Preferences.Get("IsTablet", false);
+ //if (!isTablet && Device.RuntimePlatform != Device.iOS)
+ //{
+ // Preferences.Set("isForeground", "NO");
+ // DependencyService.Resolve().StopMyForegroundService();
+ //}
+ //else if (Device.RuntimePlatform == Device.iOS)
+ //{
+ // var message = new StopServiceMessage();
+ // MessagingCenter.Send(message, "ServiceStopped");
+ //}
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ Debug.WriteLine("TOKEN-------------", token);
+ var lastLatitude = Convert.ToDouble(Preferences.Get("lastLat", "0"));
+ var lastLongitude = Convert.ToDouble(Preferences.Get("lastLng", "0"));
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ await gmCabsDriverService.LogoutDriverApp(token, lastLatitude, lastLongitude);
+ SecureStorage.RemoveAll();
+ Preferences.Clear();
+ Preferences.Set(SecureStorageData.Token, token);
+ if (!string.IsNullOrWhiteSpace(imeiNumber))
+ {
+ Preferences.Set("imeiNumber", imeiNumber);
+ }
+ if (!string.IsNullOrWhiteSpace(carNumber))
+ {
+ Preferences.Set("carNumber", carNumber);
+ }
+ Preferences.Set("IsTablet", isTablet);
+ SentrySdk.ConfigureScope(scope =>
+ {
+ scope.User = null;
+ });
+ await Current.GoToAsync($"//{nameof(LoginPage)}");
+ }
+ private async void Coupons_Clicked(object sender, EventArgs e)
+ {
+ //await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(CouponsPage)}");
+ await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(CouponsV2Page)}");
+ }
+ private async void Rydo_Clicked(object sender, EventArgs e)
+ {
+ //if (!string.IsNullOrEmpty(imeiNumber) && !string.IsNullOrEmpty(carNumber))
+ //{
+ // await Current.GoToAsync($"//{nameof(HomePageTablet)}/{nameof(AcceptedFutureBookingsTabletPage)}");
+ //}
+ //else
+ //{
+ await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(AcceptedFutureBookingsPage)}");
+ //}
+ }
+ private async void ScanDrivingLicence_Clicked(object sender, EventArgs e)
+ {
+ await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(ScanDrivingLicencePage)}");
+ }
+ private async void ScanVoucher_Clicked(object sender, EventArgs e)
+ {
+ await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(ScanVoucherPage)}");
+ }
+ private async void Settings_Clicked(object sender, EventArgs e)
+ {
+ await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(SettingsPage)}");
+ }
+ //private async void JobHistory_Clicked(object sender, EventArgs e)
+ //{
+ // await Current.GoToAsync($"//{nameof(HomePageTablet)}/{nameof(JobHistoryTabletPage)}");
+ //}
+ //private async void MyAccount_Clicked(object sender, EventArgs e)
+ //{
+ // if (!string.IsNullOrEmpty(imeiNumber) && !string.IsNullOrEmpty(carNumber))
+ // {
+ // await Current.GoToAsync($"//{nameof(HomePageTablet)}/{nameof(MyAccountTabletPage)}");
+ // }
+ // else
+ // {
+ // await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(MyAccountTabletPage)}");
+ // }
+ //}
+ //private async void MyShifts_Clicked(object sender, EventArgs e)
+ //{
+ // if (!string.IsNullOrEmpty(imeiNumber) && !string.IsNullOrEmpty(carNumber))
+ // {
+ // await Current.GoToAsync($"//{nameof(HomePageTablet)}/{nameof(MyShiftsTabletPage)}");
+ // }
+ // else
+ // {
+ // await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(MyShiftsTabletPage)}");
+ // }
+ //}
+ #endregion
+
+
+}
diff --git a/GMCabsDriverAssistantSolution/Constants.Debug.cs b/GMCabsDriverAssistantSolution/Constants.Debug.cs
new file mode 100644
index 0000000..769df41
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Constants.Debug.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant
+{
+ partial class Constants
+ {
+ //public const string BASE_URL = "http://devapi.insightpayments.com/api";
+ //public const string BASE_URL_RYDO_API = "http://driverapidev.insightpayments.com";
+
+ public const string BASE_URL = "http://3.6.215.207:8091/api";
+ public const string BASE_URL_RYDO_API = "http://3.6.215.207:8094";
+
+ //public const string BASE_URL = "https://api.insightpayments.com/api";
+ //public const string BASE_URL_RYDO_API = "https://drivers.rydo.com.au/";
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Constants.cs b/GMCabsDriverAssistantSolution/Constants.cs
new file mode 100644
index 0000000..0e4300f
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Constants.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant
+{
+ partial class Constants
+ {
+ public const string VoucherScanUseFrontCamera = "VoucherScanUseFrontCamera";
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/CustomControls/NoUnderlineEntry.cs b/GMCabsDriverAssistantSolution/CustomControls/NoUnderlineEntry.cs
new file mode 100644
index 0000000..78a3fbe
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/CustomControls/NoUnderlineEntry.cs
@@ -0,0 +1,6 @@
+namespace GMCabsDriverAssistantSolution.CustomControls
+{
+ public class NoUnderlineEntry : Entry
+ {
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/CustomControls/OtpEntry.cs b/GMCabsDriverAssistantSolution/CustomControls/OtpEntry.cs
new file mode 100644
index 0000000..4ec2b8d
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/CustomControls/OtpEntry.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.CustomControls
+{
+ public class OtpEntry : Entry
+ {
+ public delegate void BackspaceEventHandler(object sender, EventArgs e);
+
+ public event BackspaceEventHandler OnBackspace;
+
+ public OtpEntry() { }
+
+ public void OnBackspacePressed()
+ {
+ if (OnBackspace != null)
+ {
+ OnBackspace(null, null);
+ }
+
+ }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Enums/BookingNextAction.cs b/GMCabsDriverAssistantSolution/Enums/BookingNextAction.cs
new file mode 100644
index 0000000..e312a1c
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Enums/BookingNextAction.cs
@@ -0,0 +1,11 @@
+namespace GMCabsDriverAssistant.Enums
+{
+ public enum BookingNextAction
+ {
+ None,
+ NoAction,
+ ChangeServiceType,
+ OfferTip,
+ WaitLonger
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Enums/BookingStatus.cs b/GMCabsDriverAssistantSolution/Enums/BookingStatus.cs
new file mode 100644
index 0000000..8577c7f
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Enums/BookingStatus.cs
@@ -0,0 +1,18 @@
+namespace GMCabsDriverAssistant.Enums
+{
+ public enum BookingStatus
+ {
+ None,
+ Scheduled,
+ Processing,
+ NoDriverAvailable,
+ UserCancelled,
+ AdminCancelled,
+ Accepted,
+ PassengerCollected,
+ DriverCancelled,
+ CustomerNoShow,
+ Completed,
+ SystemCancelled
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Enums/BookingType.cs b/GMCabsDriverAssistantSolution/Enums/BookingType.cs
new file mode 100644
index 0000000..ff90858
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Enums/BookingType.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Enums
+{
+ public enum BookingType
+ {
+ None,
+ Public,
+ Corporate
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Enums/FareType.cs b/GMCabsDriverAssistantSolution/Enums/FareType.cs
new file mode 100644
index 0000000..c910112
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Enums/FareType.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Enums
+{
+ public enum FareType
+ {
+ Fixed = 1,
+ Meter = 2
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Enums/PaymentType.cs b/GMCabsDriverAssistantSolution/Enums/PaymentType.cs
new file mode 100644
index 0000000..915224b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Enums/PaymentType.cs
@@ -0,0 +1,9 @@
+namespace GMCabsDriverAssistant.Enums
+{
+ public enum PaymentType
+ {
+ None,
+ DirectToDriver,
+ Account
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Enums/ServiceType.cs b/GMCabsDriverAssistantSolution/Enums/ServiceType.cs
new file mode 100644
index 0000000..9f52802
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Enums/ServiceType.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Enums
+{
+ public enum ServiceType
+ {
+ None,
+ Taxi,
+ HireCar,
+ FixedPrice,
+ MyDriver
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Enums/TaxiType.cs b/GMCabsDriverAssistantSolution/Enums/TaxiType.cs
new file mode 100644
index 0000000..14554d1
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Enums/TaxiType.cs
@@ -0,0 +1,11 @@
+namespace GMCabsDriverAssistant.Enums
+{
+ public enum TaxiType
+ {
+ None,
+ Standard,
+ MaxiTaxi,
+ StationWagon,
+ LondonCabs
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/GMCabsDriverAssistantSolution.csproj b/GMCabsDriverAssistantSolution/GMCabsDriverAssistantSolution.csproj
new file mode 100644
index 0000000..5776ffe
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/GMCabsDriverAssistantSolution.csproj
@@ -0,0 +1,184 @@
+
+
+
+ net6.0-android;net6.0-ios;net6.0-maccatalyst
+ $(TargetFrameworks);net6.0-windows10.0.19041.0
+
+
+ Exe
+ GMCabsDriverAssistantSolution
+ true
+ true
+ enable
+
+
+ GMCabsDriverAssistantSolution
+
+
+ au.com.gmcabs.driverassistant
+ 6D8C0974-C903-452F-98F8-07E76D498921
+
+
+ 1.0
+ 1
+
+ 14.2
+ 14.0
+ 21.0
+ 10.0.17763.0
+ 10.0.17763.0
+ 6.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+
+
+
+
+
+ 123.1.1.1
+
+
+ 2.44.2.1
+
+
+
+
diff --git a/GMCabsDriverAssistantSolution/ILocationConsent.cs b/GMCabsDriverAssistantSolution/ILocationConsent.cs
new file mode 100644
index 0000000..1c4f615
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ILocationConsent.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistant
+{
+ public interface ILocationConsent
+ {
+ Task GetLocationConsent();
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/MainPage.xaml b/GMCabsDriverAssistantSolution/MainPage.xaml
new file mode 100644
index 0000000..6fc5f93
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/MainPage.xaml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GMCabsDriverAssistantSolution/MainPage.xaml.cs b/GMCabsDriverAssistantSolution/MainPage.xaml.cs
new file mode 100644
index 0000000..0f594d4
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/MainPage.xaml.cs
@@ -0,0 +1,24 @@
+namespace GMCabsDriverAssistantSolution;
+
+public partial class MainPage : ContentPage
+{
+ int count = 0;
+
+ public MainPage()
+ {
+ InitializeComponent();
+ }
+
+ private void OnCounterClicked(object sender, EventArgs e)
+ {
+ count++;
+
+ if (count == 1)
+ CounterBtn.Text = $"Clicked {count} time";
+ else
+ CounterBtn.Text = $"Clicked {count} times";
+
+ SemanticScreenReader.Announce(CounterBtn.Text);
+ }
+}
+
diff --git a/GMCabsDriverAssistantSolution/MauiProgram.cs b/GMCabsDriverAssistantSolution/MauiProgram.cs
new file mode 100644
index 0000000..da87f6d
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/MauiProgram.cs
@@ -0,0 +1,18 @@
+namespace GMCabsDriverAssistantSolution;
+
+public static class MauiProgram
+{
+ public static MauiApp CreateMauiApp()
+ {
+ var builder = MauiApp.CreateBuilder();
+ builder
+ .UseMauiApp()
+ .ConfigureFonts(fonts =>
+ {
+ fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
+ fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
+ });
+
+ return builder.Build();
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Messages/LocationErrorMessage.cs b/GMCabsDriverAssistantSolution/Messages/LocationErrorMessage.cs
new file mode 100644
index 0000000..377fc11
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Messages/LocationErrorMessage.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Messages
+{
+ public class LocationErrorMessage
+ {
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Messages/LocationMessage.cs b/GMCabsDriverAssistantSolution/Messages/LocationMessage.cs
new file mode 100644
index 0000000..06cc421
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Messages/LocationMessage.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Messages
+{
+ public class LocationMessage
+ {
+ public double Latitude { get; set; }
+ public double Longitude { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Messages/StartServiceMessage.cs b/GMCabsDriverAssistantSolution/Messages/StartServiceMessage.cs
new file mode 100644
index 0000000..13389a8
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Messages/StartServiceMessage.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Messages
+{
+ public class StartServiceMessage
+ {
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Messages/StopServiceMessage.cs b/GMCabsDriverAssistantSolution/Messages/StopServiceMessage.cs
new file mode 100644
index 0000000..6541f4d
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Messages/StopServiceMessage.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Messages
+{
+ public class StopServiceMessage
+ {
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/AcceptBookingTimerDto.cs b/GMCabsDriverAssistantSolution/Models/AcceptBookingTimerDto.cs
new file mode 100644
index 0000000..24ad126
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/AcceptBookingTimerDto.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class AcceptBookingTimerDto
+ {
+ public int PendingSeconds { get; set; }
+ public string PickUPAddress { get; set; }
+ public string DropUpAddress { get; set; }
+ public bool IsFutureBooking { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/AccountBalanceDto.cs b/GMCabsDriverAssistantSolution/Models/AccountBalanceDto.cs
new file mode 100644
index 0000000..5cc39e1
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/AccountBalanceDto.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class AccountBalanceDto
+ {
+ public decimal LevyBalance { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/ApiResponseDto.cs b/GMCabsDriverAssistantSolution/Models/ApiResponseDto.cs
new file mode 100644
index 0000000..c279415
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/ApiResponseDto.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class ApiResponseDto
+ {
+ public int StatusCode { get; set; }
+ public string Message { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/AvailableBooking.cs b/GMCabsDriverAssistantSolution/Models/AvailableBooking.cs
new file mode 100644
index 0000000..bc4f2b6
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/AvailableBooking.cs
@@ -0,0 +1,12 @@
+using SQLite;
+
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class AvailableBooking
+ {
+ [PrimaryKey, AutoIncrement]
+ public int Id { get; set; }
+ public string BookingID { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/AvailablePlotRequestDto.cs b/GMCabsDriverAssistantSolution/Models/AvailablePlotRequestDto.cs
new file mode 100644
index 0000000..e2082b2
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/AvailablePlotRequestDto.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class AvailablePlotRequestDto
+ {
+ [JsonPropertyName("DriverID")]
+ public Guid DriverID { get; set; }
+
+ [JsonPropertyName("Latitude")]
+ public double? Latitude { get; set; }
+
+ [JsonPropertyName("Longitude")]
+ public double? Longitude { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/AvailablePlotResponseDto.cs b/GMCabsDriverAssistantSolution/Models/AvailablePlotResponseDto.cs
new file mode 100644
index 0000000..cfd1035
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/AvailablePlotResponseDto.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class AvailablePlotResponseDto
+ {
+ [JsonPropertyName("PlotName")]
+ public string PlotName { get; set; }
+
+ [JsonPropertyName("PlotPosition")]
+ public int PlotPosition { get; set; }
+
+ [JsonPropertyName("PlotExpiryTime")]
+ public int PlotExpiryTime { get; set; }
+ public ApiResponseDto apiResponseDto { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/BookingDto.cs b/GMCabsDriverAssistantSolution/Models/BookingDto.cs
new file mode 100644
index 0000000..2331c91
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/BookingDto.cs
@@ -0,0 +1,254 @@
+using GMCabsDriverAssistant.Enums;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class BookingDto
+ {
+ [JsonPropertyName("booking_id")]
+ public Guid BookingId { get; set; }
+
+ [JsonPropertyName("discount")]
+ public decimal Discount { get; set; }
+
+ [JsonPropertyName("start_address")]
+ public string StartAddress { get; set; }
+
+ [JsonPropertyName("start_suburb")]
+ public string StartSuburb { get; set; }
+
+ [JsonPropertyName("end_address")]
+ public string EndAddress { get; set; }
+
+ [JsonPropertyName("end_suburb")]
+ public string EndSuburb { get; set; }
+
+ [JsonPropertyName("future_booking")]
+ public bool FutureBooking { get; set; }
+
+ [JsonPropertyName("next_available")]
+ public bool NextAvailable { get; set; }
+
+ [JsonPropertyName("notes")]
+ public string Notes { get; set; }
+
+ [JsonPropertyName("taxi_type_id")]
+ public int? TaxiTypeId { get; set; }
+
+ [JsonPropertyName("fixed_amount")]
+ public int? FixedAmount { get; set; }
+
+ [JsonPropertyName("min_fare_amount")]
+ public int? MinFareAmount { get; set; }
+
+ [JsonPropertyName("provider_charge_fixed_fare")]
+ public int? ProviderChargeFixedFare { get; set; }
+
+ [JsonPropertyName("provider_charge_meter_fare")]
+ public int? ProviderChargeMeterFare { get; set; }
+
+ [JsonPropertyName("provider_charge_fixed_fare_preferred")]
+ public int? ProviderChargeFixedFarePreferred { get; set; }
+
+ [JsonPropertyName("provider_charge_meter_fare_preferred")]
+ public int? ProviderChargeMeterFarePreferred { get; set; }
+
+ [JsonPropertyName("pre_tip")]
+ public int? PreTip { get; set; }
+
+ [JsonPropertyName("start_time_local")]
+ public int StartTimeLocal { get; set; }
+
+ [JsonPropertyName("start_time_utc")]
+ public int StartTimeUtc { get; set; }
+
+ [JsonPropertyName("luggage_count")]
+ public int LuggageCount { get; set; }
+
+ [JsonPropertyName("passenger_count")]
+ public int PassengerCount { get; set; }
+
+ [JsonPropertyName("service_type_id")]
+ public int ServiceTypeId { get; set; }
+
+ [JsonPropertyName("passenger_phone_number")]
+ public string PassengerPhoneNumber { get; set; }
+
+ [JsonPropertyName("passenger_name")]
+ public string PassengerName { get; set; }
+
+ [JsonPropertyName("voucher_amount")]
+ public decimal VoucherAmount { get; set; }
+
+ [JsonPropertyName("latitude")]
+ public double Latitude { get; set; }
+
+ [JsonPropertyName("longitude")]
+ public double Longitude { get; set; }
+
+ [JsonPropertyName("distance")]
+ public float Distance { get; set; }
+
+ public string FormattedDistance
+ {
+ get => (Distance >= 1000) ? $"{Distance / 1000:0.##}k" : $"{(int)Distance}m";
+ }
+
+ [JsonPropertyName("estimate_fare")]
+ public decimal EstimateFare { get; set; }
+
+ [JsonPropertyName("is_corporate")]
+ public bool IsCorporate { get; set; }
+
+ [JsonPropertyName("in_hail")]
+ public bool InHail { get; set; }
+
+ [JsonPropertyName("payment_method_id")]
+ public Guid? PaymentMethodId { get; set; }
+
+ [JsonPropertyName("payment_method_verified")]
+ public bool? PaymentMethodVerified { get; set; }
+
+ [JsonPropertyName("rydo_stars")]
+ public int RydoStars { get; set; }
+
+ [JsonPropertyName("priority_driver")]
+ public bool PriorityDriver { get; set; }
+
+ [JsonPropertyName("end_latitude")]
+ public double EndLatitude { get; set; }
+
+ [JsonPropertyName("end_longitude")]
+ public double EndLongitude { get; set; }
+
+ [JsonPropertyName("start_latitude")]
+ public double StartLatitude { get; set; }
+
+ [JsonPropertyName("start_longitude")]
+ public double StartLongitude { get; set; }
+
+ [JsonPropertyName("payment_type")]
+ public PaymentType PaymentType { get; set; }
+
+ [JsonPropertyName("booking_type")]
+ public BookingType BookingType { get; set; }
+
+ [JsonPropertyName("pickup_time")]
+ public int PickupTime { get; set; }
+
+ [JsonPropertyName("fare_type")]
+ public FareType FareType { get; set; }
+
+ [JsonPropertyName("status_id")]
+ public int StatusId { get; set; }
+
+ [JsonPropertyName("status_code")]
+ public string StatusCode { get; set; }
+
+ [JsonPropertyName("delivered")]
+ public bool Delivered { get; set; }
+
+ [JsonPropertyName("ride_id")]
+ public Guid? RideId { get; set; }
+
+ [JsonPropertyName("fare_amount")]
+ public int? FareAmount { get; set; }
+
+ [JsonPropertyName("end_state")]
+ public string EndState { get; set; }
+
+ [JsonPropertyName("service_id")]
+ public int ServiceId { get; set; }
+
+ [JsonPropertyName("start_state")]
+ public string StartState { get; set; }
+
+ [JsonPropertyName("journey_distance")]
+ public int JourneyDistance { get; set; }
+
+ [JsonPropertyName("reward_points")]
+ public int RewardPoints { get; set; }
+
+ [JsonPropertyName("booking_fee")]
+ public double BookingFee { get; set; }
+
+ [JsonPropertyName("booking_fee_waived")]
+ public bool BookingFeeWaived { get; set; }
+
+ [JsonPropertyName("tip")]
+ public int? Tip { get; set; }
+
+ [JsonPropertyName("driver_number_plate")]
+ public string DriverNumberPlate { get; set; }
+
+ [JsonPropertyName("estimated_arrival_time")]
+ public int EstimatedArrivalTime { get; set; }
+
+ [JsonPropertyName("voucher_id")]
+ public string VoucherId { get; set; }
+
+ [JsonPropertyName("promotion_id")]
+ public string PromotionId { get; set; }
+
+ [JsonPropertyName("stored_cards_available")]
+ public bool StoredCardsAvailable { get; set; }
+
+ [JsonPropertyName("current_stop_number")]
+ public int? CurrentStopNumber { get; set; }
+
+ [JsonPropertyName("stopover_locations")]
+ public IEnumerable StopoverLocations { get; set; }
+
+ public string FormattedPickUpTimeDateOnly
+ {
+ get
+ {
+ DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
+ dateTime = dateTime.AddSeconds(PickupTime).ToLocalTime();
+ return dateTime.ToString("dd/MM/yyyy");
+ }
+
+ }
+ public string FormattedPickUpTimeTimeOnly
+ {
+ get
+ {
+ DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
+ dateTime = dateTime.AddSeconds(PickupTime).ToLocalTime();
+ return dateTime.ToString("HH:mm ttt");
+ }
+
+ }
+ public string FormmattedPickUpDateTime
+ {
+ get
+ {
+ DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
+ dateTime = dateTime.AddSeconds(PickupTime).ToLocalTime();
+ return dateTime.ToString("dd/MM/yyyy HH:mm:ss");
+ }
+
+ }
+ public bool IsSeenBooking { get; set; }
+ }
+ public class StopoverLocation
+ {
+
+ [JsonPropertyName("latitude")]
+ public decimal Latitude { get; set; }
+
+ [JsonPropertyName("longitude")]
+ public decimal Longitude { get; set; }
+
+ [JsonPropertyName("address")]
+ public string Address { get; set; }
+
+ [JsonPropertyName("stop_number")]
+ public decimal StopNumber { get; set; }
+ }
+
+
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Models/CancelledBookingResponseDto.cs b/GMCabsDriverAssistantSolution/Models/CancelledBookingResponseDto.cs
new file mode 100644
index 0000000..fe63ef3
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/CancelledBookingResponseDto.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class CancelledBookingResponseDto
+ {
+ public string PickUPAddress { get; set; }
+ public string DropUpAddress { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/ContactCustomerDto.cs b/GMCabsDriverAssistantSolution/Models/ContactCustomerDto.cs
new file mode 100644
index 0000000..f1dc2ea
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/ContactCustomerDto.cs
@@ -0,0 +1,15 @@
+using GMCabsDriverAssistant.Models.Rydo;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class ContactCustomerDto
+ {
+ public string PassengerName { get; set; }
+ public string PassengerPhoneNumber { get; set; }
+ public Guid BookingId { get; set; }
+ public MessageRequest messageRequest { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/Coupon.cs b/GMCabsDriverAssistantSolution/Models/Coupon.cs
new file mode 100644
index 0000000..447d2c2
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Coupon.cs
@@ -0,0 +1,12 @@
+namespace GMCabsDriverAssistant.Models
+{
+ public class Coupon
+ {
+ public int Id { get; set; }
+ public string IssueDate { get; set; }
+ public string IssueLocation { get; set; }
+ public string ExpiryDate { get; set; }
+ public string Amount { get; set; }
+ public string QrCodeData { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/CouponDto.cs b/GMCabsDriverAssistantSolution/Models/CouponDto.cs
new file mode 100644
index 0000000..835fafd
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/CouponDto.cs
@@ -0,0 +1,18 @@
+using System;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class CouponDto
+ {
+ public string Id { get; set; }
+ public string QrCodeBase64 { get; set; }
+ public ImageSource Image { get; set; }
+ public float Amount { get; set; }
+ public DateTime IssuedDate { get; set; }
+ public DateTime ExpiryDate { get; set; }
+ public string Status { get; set; }
+ public int IssuedLocationID { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/CouponHistoryDto.cs b/GMCabsDriverAssistantSolution/Models/CouponHistoryDto.cs
new file mode 100644
index 0000000..7550fdc
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/CouponHistoryDto.cs
@@ -0,0 +1,19 @@
+using System;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class CouponHistoryDto
+ {
+ public string Id { get; set; }
+ public string QrCodeBase64 { get; set; }
+ public float Amount { get; set; }
+ public DateTime IssuedDate { get; set; }
+ public DateTime? RedeemedDate { get; set; }
+ public DateTime ExpiryDate { get; set; }
+ public string CouponBackgroundColor { get; set; }
+ public string CouponText { get; set; }
+ public string IssuedLocation { get; set; }
+ public string RedeemedLocation { get; set; }
+ public bool isRedemed { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/CreateLightDriverRequest.cs b/GMCabsDriverAssistantSolution/Models/CreateLightDriverRequest.cs
new file mode 100644
index 0000000..9d8662f
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/CreateLightDriverRequest.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class CreateLightDriverRequest
+ {
+ public string DriverLicence { get; set; }
+ public string FirstName { get; set; }
+ public string LastName { get; set; }
+ public string Password { get; set; }
+ public string Email { get; set; }
+ public string MobileNumber { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/DriverAppSelectedPermissionsDto.cs b/GMCabsDriverAssistantSolution/Models/DriverAppSelectedPermissionsDto.cs
new file mode 100644
index 0000000..c82920c
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/DriverAppSelectedPermissionsDto.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class DriverAppSelectedPermissionsDto
+ {
+ public bool LocationSetToAlways { get; set; }
+ public bool BatteryOptimisationDisabled { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/DriverRatingResponse.cs b/GMCabsDriverAssistantSolution/Models/DriverRatingResponse.cs
new file mode 100644
index 0000000..a7526b5
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/DriverRatingResponse.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class DriverRatingResponse
+ {
+ [JsonPropertyName("id")]
+ public Guid Id { get; set; }
+
+ [JsonPropertyName("referral_code")]
+ public string ReferralCode { get; set; }
+
+ [JsonPropertyName("rating")]
+ public int Rating { get; set; }
+
+ [JsonPropertyName("first_name")]
+ public string FirstName { get; set; }
+
+ [JsonPropertyName("last_name")]
+ public string LastName { get; set; }
+
+ [JsonPropertyName("phone_number")]
+ public string PhoneNumber { get; set; }
+
+ [JsonPropertyName("driver_authority")]
+ public string DriverAuthority { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/ImeiDto.cs b/GMCabsDriverAssistantSolution/Models/ImeiDto.cs
new file mode 100644
index 0000000..91ea43a
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/ImeiDto.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class ImeiDto
+ {
+ public string ImeiNumber { get; set; }
+ public string CarNumber { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/LocationUpdateRequestDto.cs b/GMCabsDriverAssistantSolution/Models/LocationUpdateRequestDto.cs
new file mode 100644
index 0000000..f302e23
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/LocationUpdateRequestDto.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class LocationUpdateRequestDto
+ {
+ [JsonPropertyName("latitude")]
+ public double Latitude { get; set; }
+
+ [JsonPropertyName("longitude")]
+ public double Longitude { get; set; }
+
+ [JsonPropertyName("imei")]
+ public string Imei { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/LocationVoucherDto.cs b/GMCabsDriverAssistantSolution/Models/LocationVoucherDto.cs
new file mode 100644
index 0000000..2792a3b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/LocationVoucherDto.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class LocationVoucherDto
+ {
+ public int LoationID { get; set; }
+ public string VoucherReemText { get; set; }
+ public string VoucherFooterText { get; set; }
+ public string VoucherOfferText { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/LoginRequestDto.cs b/GMCabsDriverAssistantSolution/Models/LoginRequestDto.cs
new file mode 100644
index 0000000..467f17e
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/LoginRequestDto.cs
@@ -0,0 +1,26 @@
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class LoginRequestDto
+ {
+ [JsonPropertyName("mobileNumber")]
+ public string MobileNumber { get; set; }
+
+ [JsonPropertyName("pin")]
+ public string Pin { get; set; }
+
+ [JsonPropertyName("latitude")]
+ public double? Latitude { get; set; }
+
+ [JsonPropertyName("longitude")]
+ public double? Longitude { get; set; }
+
+ [JsonPropertyName("fcmToken")]
+ public string FCMToken { get; set; }
+
+ [JsonPropertyName("imei")]
+ public string Imei { get; set; }
+ public bool IsTabletSession { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/LoginResponseDto.cs b/GMCabsDriverAssistantSolution/Models/LoginResponseDto.cs
new file mode 100644
index 0000000..172cb7f
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/LoginResponseDto.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Net;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class LoginResponseDto
+ {
+ #region Properties
+
+ public Guid Token { get; set; }
+ public string DriverName { get; set; }
+ public string DriverMobileNumber { get; set; }
+ public Guid UserCode { get; set; }
+ public bool CanAcceptBookings { get; set; }
+ public bool CanUpdateLicence { get; set; }
+ public bool CanScanVouchers { get; set; }
+ public string InstalledTaxiNumber { get; set; } = null;
+ public bool CanViewCoupons { get; set; }
+ public bool CanViewSettings { get; set; }
+ public bool CanViewHome { get; set; }
+ public bool CanViewJobHistory { get; set; }
+ public bool IsTabletSession { get; set; }
+ public string LoginResponseMessage { get; set; }
+ public int UserId { get; set; }
+
+ #endregion
+
+ #region Constants
+ public const string DRIVER_NAME = nameof(DriverName);
+
+ public const string DRIVER_MOBILE_NUMBER = nameof(DriverMobileNumber);
+
+ public const string USER_CODE = nameof(UserCode);
+ #endregion
+
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/MeterTrip.cs b/GMCabsDriverAssistantSolution/Models/MeterTrip.cs
new file mode 100644
index 0000000..845690a
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/MeterTrip.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class MeterTrip
+ {
+ public string StartSuburb { get; set; }
+ public string PickUpDateTime { get; set; }
+ public int TimerSeconds { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/NotificationDto.cs b/GMCabsDriverAssistantSolution/Models/NotificationDto.cs
new file mode 100644
index 0000000..78e9182
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/NotificationDto.cs
@@ -0,0 +1,17 @@
+using System;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class NotificationDto
+ {
+ public string Id { get; set; }
+ public int UserID { get; set; }
+ public string Subject { get; set; }
+ public string Body { get; set; }
+ public string FromName { get; set; }
+ public DateTime SentDate { get; set; }
+ public DateTime? ReceivedDate { get; set; }
+ public DateTime? DateViewed { get; set; }
+ public bool Important { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/PlotResponseDto.cs b/GMCabsDriverAssistantSolution/Models/PlotResponseDto.cs
new file mode 100644
index 0000000..6f46d05
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/PlotResponseDto.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class PlotResponseDto
+ {
+ [JsonPropertyName("ID")]
+ public Guid ID { get; set; }
+
+ [JsonPropertyName("ZoneID")]
+ public Guid ZoneID { get; set; }
+
+ [JsonPropertyName("Name")]
+ public string Name { get; set; }
+
+ [JsonPropertyName("Latitude")]
+ public double? Latitude { get; set; }
+
+ [JsonPropertyName("Longitude")]
+ public double? Longitude { get; set; }
+
+ [JsonPropertyName("Radius")]
+ public decimal? Radius { get; set; }
+
+ [JsonPropertyName("Available")]
+ public bool Available { get; set; }
+
+ [JsonPropertyName("Distance")]
+ public int Distance { get; set; }
+
+ [JsonPropertyName("PlotExpiryTime")]
+ public int PlotExpiryTime { get; set; }
+
+ [JsonPropertyName("DriverDistance")]
+ public int? DriverDistance { get; set; }
+
+ [JsonPropertyName("Position")]
+ public int Position { get; set; }
+ public string OtherAvailablePlotAreas
+ {
+ get
+ {
+ return (Distance>=1000)? Name + "(" + Distance/1000 + "k)" : Name + "(" + Distance + "m)";
+ }
+ }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/RecentScannedCouponDto.cs b/GMCabsDriverAssistantSolution/Models/RecentScannedCouponDto.cs
new file mode 100644
index 0000000..663f2eb
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/RecentScannedCouponDto.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class RecentScannedCouponDto
+ {
+ public string Status { get; set; }
+
+ public DateTime ScannedTime { get; set; }
+
+ public string CouponBackgroundColor { get; set; }
+ public string CouponTextColor { get; set; }
+
+ public ImageSource Image { get; set; }
+
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/ReleaseBookingDto.cs b/GMCabsDriverAssistantSolution/Models/ReleaseBookingDto.cs
new file mode 100644
index 0000000..bbb56cf
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/ReleaseBookingDto.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class ReleaseBookingDto
+ {
+ public Guid BookingId { get; set; }
+ public string ReleaseReason { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/ResetDriverPinResponse.cs b/GMCabsDriverAssistantSolution/Models/ResetDriverPinResponse.cs
new file mode 100644
index 0000000..8d23b86
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/ResetDriverPinResponse.cs
@@ -0,0 +1,20 @@
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Services
+{
+ public class ResetDriverPinResponse
+ {
+ [JsonPropertyName("type")]
+ public string Type { get; set; }
+
+ [JsonPropertyName("title")]
+ public string Title { get; set; }
+
+ [JsonPropertyName("status")]
+ public int Status { get; set; }
+
+ [JsonPropertyName("traceId")]
+ public string TraceId { get; set; }
+ }
+
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Models/Rydo/AcceptDeclineBookingRequest.cs b/GMCabsDriverAssistantSolution/Models/Rydo/AcceptDeclineBookingRequest.cs
new file mode 100644
index 0000000..1c34196
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Rydo/AcceptDeclineBookingRequest.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.Models.Rydo
+{
+ public class AcceptDeclineBookingRequest
+ {
+ #region Properties
+ [JsonPropertyName("driver_id")]
+ public Guid DriverId { get; set; }
+
+ [JsonPropertyName("driver_latitude")]
+ public double DriverLatitude { get; set; }
+
+ [JsonPropertyName("driver_longitude")]
+ public double DriverLongitude { get; set; }
+
+ [JsonPropertyName("driver_source")]
+ public int DriverSource { get; set; }
+
+ #endregion
+ }
+
+}
diff --git a/GMCabsDriverAssistantSolution/Models/Rydo/AcceptDeclineBookingResponse.cs b/GMCabsDriverAssistantSolution/Models/Rydo/AcceptDeclineBookingResponse.cs
new file mode 100644
index 0000000..77511b0
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Rydo/AcceptDeclineBookingResponse.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.Models.Rydo
+{
+ public class AcceptDeclineBookingResponse
+ {
+ public int StatusCode { get; set; }
+ public string Message { get; set; }
+
+ [JsonPropertyName("future_booking")]
+ public bool FutureBooking { get; set; }
+
+ [JsonPropertyName("payment_method_id")]
+ public Guid? PaymentMethodId { get; set; }
+
+ [JsonPropertyName("passenger_name")]
+ public string PassengerName { get; set; }
+
+ [JsonPropertyName("pickup_time")]
+ public long? PickupTime { get; set; }
+
+ [JsonPropertyName("is_corporate")]
+ public bool IsCorporate { get; set; }
+ public string PickUpAddress { get; set; }
+ [JsonPropertyName("booking_id")]
+ public Guid BookingId { get; set; }
+
+ [JsonPropertyName("passenger_phone_number")]
+ public string PassengerPhoneNumber { get; set; }
+ }
+
+}
diff --git a/GMCabsDriverAssistantSolution/Models/Rydo/EftposLoginRequest.cs b/GMCabsDriverAssistantSolution/Models/Rydo/EftposLoginRequest.cs
new file mode 100644
index 0000000..b03f5a4
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Rydo/EftposLoginRequest.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.Models.Rydo
+{
+ public class EftposLoginRequest
+ {
+ #region Properties
+ [JsonPropertyName("driver_id")]
+ public Guid DriverId { get; set; }
+
+ [JsonPropertyName("mobile_number")]
+ public string MobileNumber { get; set; }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/Rydo/EftposLoginResponse.cs b/GMCabsDriverAssistantSolution/Models/Rydo/EftposLoginResponse.cs
new file mode 100644
index 0000000..645d374
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Rydo/EftposLoginResponse.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.Models.Rydo
+{
+ public class EftposLoginResponse
+ {
+ #region Constants
+ public const string RYDO_ACCESS_TOKEN = "RydoAccessToken";
+ public const string RYDO_TOKEN_TYPE = "RydoTokenType";
+ #endregion
+
+ #region Properties
+ [JsonPropertyName("access_token")]
+ public string AccessToken { get; set; }
+
+ [JsonPropertyName("token_type")]
+ public string TokenType { get; set; }
+
+ [JsonPropertyName("expires_in")]
+ public int ExpiresIn { get; set; }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/Rydo/EndRideRequestDto.cs b/GMCabsDriverAssistantSolution/Models/Rydo/EndRideRequestDto.cs
new file mode 100644
index 0000000..213bc39
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Rydo/EndRideRequestDto.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models.Rydo
+{
+ public class EndRideRequestDto
+ {
+ [JsonPropertyName("driver_id")]
+ public Guid DriverId { get; set; }
+
+ [JsonPropertyName("direct_to_driver")]
+ public bool DirectToDriver { get; set; }
+
+ [JsonPropertyName("fare")]
+ public int Fare { get; set; }
+
+ [JsonPropertyName("extra")]
+ public int Extra { get; set; }
+
+ [JsonPropertyName("latitude")]
+ public double Latitude { get; set; }
+
+ [JsonPropertyName("longitude")]
+ public double Longitude { get; set; }
+
+ [JsonPropertyName("source_device_id")]
+ public int SourceDeviceId { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/Rydo/MessageRequest.cs b/GMCabsDriverAssistantSolution/Models/Rydo/MessageRequest.cs
new file mode 100644
index 0000000..de9a103
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Rydo/MessageRequest.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models.Rydo
+{
+ public class MessageRequest
+ {
+ [JsonPropertyName("Message")]
+ public string Message { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/Rydo/StartRideRequest.cs b/GMCabsDriverAssistantSolution/Models/Rydo/StartRideRequest.cs
new file mode 100644
index 0000000..377f56a
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Rydo/StartRideRequest.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models.Rydo
+{
+ public class StartRideRequest
+ {
+ [JsonPropertyName("driver_id")]
+ public string DriverId { get; set; }
+ [JsonPropertyName("force_start")]
+ public bool ForceStart { get; set; }
+ [JsonPropertyName("driver_source")]
+ public int? DriverSouce { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/Rydo/StartRideRequestDto.cs b/GMCabsDriverAssistantSolution/Models/Rydo/StartRideRequestDto.cs
new file mode 100644
index 0000000..9b2b45e
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Rydo/StartRideRequestDto.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models.Rydo
+{
+ public class StartRideRequestDto
+ {
+ public StartRideRequest startRideRequest { get; set; }
+ public Guid BookingId { get; set;}
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/Rydo/StartTripRequest.cs b/GMCabsDriverAssistantSolution/Models/Rydo/StartTripRequest.cs
new file mode 100644
index 0000000..38546ea
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/Rydo/StartTripRequest.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models.Rydo
+{
+ public class StartTripRequest
+ {
+ [JsonPropertyName("driver_id")]
+ public string DriverId { get; set; }
+
+ [JsonPropertyName("driver_source")]
+ public int? DriverSouce { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/ShiftResponseDto.cs b/GMCabsDriverAssistantSolution/Models/ShiftResponseDto.cs
new file mode 100644
index 0000000..6d7d932
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/ShiftResponseDto.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class ShiftResponseDto
+ {
+ [JsonPropertyName("userID")]
+ public int UserID { get; set; }
+
+ [JsonPropertyName("startDate")]
+ public DateTime? StartDate { get; set; }
+
+ [JsonPropertyName("endDate")]
+ public DateTime? EndDate { get; set; }
+
+ [JsonPropertyName("networkVehicleID")]
+ public int NetworkVehicleID { get; set; }
+
+ [JsonPropertyName("carNumber")]
+ public string CarNumber { get; set; }
+
+ [JsonPropertyName("imei")]
+ public string Imei { get; set; }
+
+ [JsonPropertyName("startSuburb")]
+ public string StartSuburb { get; set; }
+
+ [JsonPropertyName("endSuburb")]
+ public string EndSuburb { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/SilentModeSettingRequest.cs b/GMCabsDriverAssistantSolution/Models/SilentModeSettingRequest.cs
new file mode 100644
index 0000000..c1f04c5
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/SilentModeSettingRequest.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class SilentModeSettingRequest
+ {
+ public bool IsSilentModeEnabled { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/StartRideResponse.cs b/GMCabsDriverAssistantSolution/Models/StartRideResponse.cs
new file mode 100644
index 0000000..1e673af
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/StartRideResponse.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class StartRideResponse
+ {
+ public int StatusCode { get; set; }
+ public string Message { get; set; }
+
+ [JsonPropertyName("passenger_name")]
+ public string PassengerName { get; set; }
+ [JsonPropertyName("is_corporate")]
+ public bool IsCorporate { get; set; }
+ [JsonPropertyName("end_address")]
+ public string EndAddress { get; set; }
+ [JsonPropertyName("end_suburb")]
+ public string EndSuburb { get; set; }
+
+ [JsonPropertyName("stopover_locations")]
+ public List StopoverLocations { get; set; }
+ [JsonPropertyName("end_latitude")]
+ public double EndLatitude { get; set; }
+ [JsonPropertyName("end_longitude")]
+ public double EndLongitude { get; set; }
+ public string FullDestinationAddress { get; set; }
+
+ [JsonPropertyName("payment_method_id")]
+ public Guid? PaymentMethodId { get; set; }
+
+ [JsonPropertyName("fixed_amount")]
+ public decimal? FixedAmount { get; set; }
+ public int FrameWidth { get; set; }
+ public string DriverId { get; set; }
+ public Guid BookingId { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/StartTripResponse.cs b/GMCabsDriverAssistantSolution/Models/StartTripResponse.cs
new file mode 100644
index 0000000..0b1bf9e
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/StartTripResponse.cs
@@ -0,0 +1,210 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class StartTripResponse
+ {
+ [JsonPropertyName("booking_id")]
+ public Guid BookingId { get; set; }
+
+ [JsonPropertyName("discount")]
+ public decimal Discount { get; set; }
+
+ [JsonPropertyName("start_address")]
+ public string StartAddress { get; set; }
+
+ [JsonPropertyName("start_suburb")]
+ public string StartSuburb { get; set; }
+
+ [JsonPropertyName("end_address")]
+ public string EndAddress { get; set; }
+
+ [JsonPropertyName("end_suburb")]
+ public string EndSuburb { get; set; }
+
+ [JsonPropertyName("future_booking")]
+ public bool FutureBooking { get; set; }
+
+ [JsonPropertyName("next_available")]
+ public bool NextAvailable { get; set; }
+
+ [JsonPropertyName("notes")]
+ public string Notes { get; set; }
+
+ [JsonPropertyName("taxi_type_id")]
+ public int? TaxiTypeId { get; set; }
+
+ [JsonPropertyName("fixed_amount")]
+ public int? FixedAmount { get; set; }
+
+ [JsonPropertyName("min_fare_amount")]
+ public int MinFareAmount { get; set; }
+
+ [JsonPropertyName("provider_charge_fixed_fare")]
+ public int ProviderChargeFixedFare { get; set; }
+
+ [JsonPropertyName("provider_charge_meter_fare")]
+ public int ProviderChargeMeterFare { get; set; }
+
+ [JsonPropertyName("provider_charge_fixed_fare_preferred")]
+ public int ProviderChargeFixedFarePreferred { get; set; }
+
+ [JsonPropertyName("provider_charge_meter_fare_preferred")]
+ public int ProviderChargeMeterFarePreferred { get; set; }
+
+ [JsonPropertyName("pre_tip")]
+ public int PreTip { get; set; }
+
+ [JsonPropertyName("start_time_local")]
+ public long StartTimeLocal { get; set; }
+
+ [JsonPropertyName("start_time_utc")]
+ public long StartTimeUtc { get; set; }
+
+ [JsonPropertyName("luggage_count")]
+ public int LuggageCount { get; set; }
+
+ [JsonPropertyName("passenger_count")]
+ public int PassengerCount { get; set; }
+
+ [JsonPropertyName("service_type_id")]
+ public int ServiceTypeId { get; set; }
+
+ [JsonPropertyName("passenger_phone_number")]
+ public string PassengerPhoneNumber { get; set; }
+
+ [JsonPropertyName("passenger_name")]
+ public string PassengerName { get; set; }
+
+ [JsonPropertyName("voucher_amount")]
+ public int VoucherAmount { get; set; }
+
+ [JsonPropertyName("latitude")]
+ public double Latitude { get; set; }
+
+ [JsonPropertyName("longitude")]
+ public double Longitude { get; set; }
+
+ [JsonPropertyName("distance")]
+ public double Distance { get; set; }
+
+ [JsonPropertyName("estimate_fare")]
+ public int EstimateFare { get; set; }
+
+ [JsonPropertyName("is_corporate")]
+ public bool IsCorporate { get; set; }
+
+ [JsonPropertyName("in_hail")]
+ public bool InHail { get; set; }
+
+ [JsonPropertyName("payment_method_id")]
+ public Guid? PaymentMethodId { get; set; }
+
+ [JsonPropertyName("payment_method_verified")]
+ public bool? PaymentMethodVerified { get; set; }
+
+ [JsonPropertyName("rydo_stars")]
+ public int RydoStars { get; set; }
+
+ [JsonPropertyName("priority_driver")]
+ public bool PriorityDriver { get; set; }
+
+ [JsonPropertyName("end_latitude")]
+ public double EndLatitude { get; set; }
+
+ [JsonPropertyName("end_longitude")]
+ public double EndLongitude { get; set; }
+
+ [JsonPropertyName("start_latitude")]
+ public double StartLatitude { get; set; }
+
+ [JsonPropertyName("start_longitude")]
+ public double StartLongitude { get; set; }
+
+ [JsonPropertyName("payment_type")]
+ public int PaymentType { get; set; }
+
+ [JsonPropertyName("booking_type")]
+ public int BookingType { get; set; }
+
+ [JsonPropertyName("pickup_time")]
+ public long PickupTime { get; set; }
+
+ [JsonPropertyName("fare_type")]
+ public int FareType { get; set; }
+
+ [JsonPropertyName("status_id")]
+ public int StatusId { get; set; }
+
+ [JsonPropertyName("status_code")]
+ public string StatusCode { get; set; }
+
+ [JsonPropertyName("delivered")]
+ public bool Delivered { get; set; }
+
+ [JsonPropertyName("ride_id")]
+ public Guid? RideId { get; set; }
+
+ [JsonPropertyName("fare_amount")]
+ public int? FareAmount { get; set; }
+
+ [JsonPropertyName("end_state")]
+ public string EndState { get; set; }
+
+ [JsonPropertyName("service_id")]
+ public int ServiceId { get; set; }
+
+ [JsonPropertyName("start_state")]
+ public string StartState { get; set; }
+
+ [JsonPropertyName("journey_distance")]
+ public int JourneyDistance { get; set; }
+
+ [JsonPropertyName("reward_points")]
+ public int RewardPoints { get; set; }
+
+ [JsonPropertyName("booking_fee")]
+ public int BookingFee { get; set; }
+
+ [JsonPropertyName("booking_fee_waived")]
+ public bool BookingFeeWaived { get; set; }
+
+ [JsonPropertyName("tip")]
+ public int? Tip { get; set; }
+
+ [JsonPropertyName("driver_number_plate")]
+ public string DriverNumberPlate { get; set; }
+
+ [JsonPropertyName("estimated_arrival_time")]
+ public int EstimatedArrivalTime { get; set; }
+
+ [JsonPropertyName("voucher_id")]
+ public string VoucherId { get; set; }
+
+ [JsonPropertyName("promotion_id")]
+ public string PromotionId { get; set; }
+
+ [JsonPropertyName("stored_cards_available")]
+ public bool StoredCardsAvailable { get; set; }
+
+ [JsonPropertyName("current_stop_number")]
+ public int? CurrentStopNumber { get; set; }
+
+ [JsonPropertyName("stopover_locations")]
+ public List StopoverLocations { get; set; }
+
+ [JsonPropertyName("pre_accepted")]
+ public bool PreAccepted { get; set; }
+
+ [JsonPropertyName("tid")]
+ public string Tid { get; set; }
+
+ [JsonPropertyName("platform_identity")]
+ public string PlatformIdentity { get; set; }
+ public int ResponseStatusCode { get; set; }
+ public string Message { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/StopoverLocations.cs b/GMCabsDriverAssistantSolution/Models/StopoverLocations.cs
new file mode 100644
index 0000000..fb4383b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/StopoverLocations.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json.Serialization;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class StopoverLocations
+ {
+ [JsonPropertyName("latitude")]
+ public double Latitude { get; set; }
+
+ [JsonPropertyName("longitude")]
+ public double Longitude { get; set; }
+
+ [JsonPropertyName("address")]
+ public string Address { get; set; }
+ [JsonPropertyName("suburb")]
+ public string Suburb { get; set; }
+ [JsonPropertyName("stop_number")]
+ public int StopNumber { get; set; }
+ public string FullStopOverAddress => Address + " " + Suburb;
+ public string LabelColor { get; set; } = "#BBB9B9";
+ public double CircleColorOpecity { get; set; }
+ public bool IsLineVisible { get; set; } = true;
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/TripsBookingResponse.cs b/GMCabsDriverAssistantSolution/Models/TripsBookingResponse.cs
new file mode 100644
index 0000000..b3d3a1d
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/TripsBookingResponse.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class TripsBookingResponse
+ {
+ public DateTime BookingDate { get; set; }
+ public string PickupAddress { get; set; }
+ public string DropoffAddress { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/UnreadCountResponseDto.cs b/GMCabsDriverAssistantSolution/Models/UnreadCountResponseDto.cs
new file mode 100644
index 0000000..cdb1f17
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/UnreadCountResponseDto.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class UnreadCountResponseDto
+ {
+ public int StatusCode { get; set; }
+ public int UnreadNotificationCount { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Models/ValidateTokenResponseDto.cs b/GMCabsDriverAssistantSolution/Models/ValidateTokenResponseDto.cs
new file mode 100644
index 0000000..bd1a55a
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Models/ValidateTokenResponseDto.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Models
+{
+ public class ValidateTokenResponseDto
+ {
+ public bool Result { get; set; }
+ public bool CanAcceptBookings { get; set; }
+ public bool CanUpdateLicence { get; set; }
+ public bool CanScanVouchers { get; set; }
+ public bool CanViewCoupons { get; set; }
+ public bool CanViewSettings { get; set; }
+ public bool CanViewHome { get; set; }
+ public bool CanViewJobHistory { get; set; }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Platforms/Android/AndroidManifest.xml b/GMCabsDriverAssistantSolution/Platforms/Android/AndroidManifest.xml
new file mode 100644
index 0000000..399b5f2
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Android/AndroidManifest.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Platforms/Android/FirebaseServices.cs b/GMCabsDriverAssistantSolution/Platforms/Android/FirebaseServices.cs
new file mode 100644
index 0000000..80584b3
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Android/FirebaseServices.cs
@@ -0,0 +1,19 @@
+using Firebase.Messaging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.Platforms.Android
+{
+ public class FirebaseServices : FirebaseMessagingService
+ {
+ public FirebaseServices() { }
+
+ public override void OnNewToken(string token)
+ {
+ base.OnNewToken(token);
+ }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Platforms/Android/MainActivity.cs b/GMCabsDriverAssistantSolution/Platforms/Android/MainActivity.cs
new file mode 100644
index 0000000..b8588f6
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Android/MainActivity.cs
@@ -0,0 +1,10 @@
+using Android.App;
+using Android.Content.PM;
+using Android.OS;
+
+namespace GMCabsDriverAssistantSolution;
+
+[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
+public class MainActivity : MauiAppCompatActivity
+{
+}
diff --git a/GMCabsDriverAssistantSolution/Platforms/Android/MainApplication.cs b/GMCabsDriverAssistantSolution/Platforms/Android/MainApplication.cs
new file mode 100644
index 0000000..41a3b65
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Android/MainApplication.cs
@@ -0,0 +1,15 @@
+using Android.App;
+using Android.Runtime;
+
+namespace GMCabsDriverAssistantSolution;
+
+[Application]
+public class MainApplication : MauiApplication
+{
+ public MainApplication(IntPtr handle, JniHandleOwnership ownership)
+ : base(handle, ownership)
+ {
+ }
+
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+}
diff --git a/GMCabsDriverAssistantSolution/Platforms/Android/Resources/values/colors.xml b/GMCabsDriverAssistantSolution/Platforms/Android/Resources/values/colors.xml
new file mode 100644
index 0000000..c04d749
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Android/Resources/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #512BD4
+ #2B0B98
+ #2B0B98
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Platforms/Android/google-services.json b/GMCabsDriverAssistantSolution/Platforms/Android/google-services.json
new file mode 100644
index 0000000..02afd65
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Android/google-services.json
@@ -0,0 +1,39 @@
+{
+ "project_info": {
+ "project_number": "1043650258738",
+ "project_id": "gm-driver-assistant",
+ "storage_bucket": "gm-driver-assistant.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:1043650258738:android:09e96234595e06190e192b",
+ "android_client_info": {
+ "package_name": "au.com.gmcabs.driverassistant"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "1043650258738-f7temh37gnu293l6oe1r6r7dqa4k71ms.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyBZDupHesCvSye9Yi5zDiyUUSFm3ZcmBj8"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "1043650258738-f7temh37gnu293l6oe1r6r7dqa4k71ms.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Platforms/Android/network_security_config.xml b/GMCabsDriverAssistantSolution/Platforms/Android/network_security_config.xml
new file mode 100644
index 0000000..b1cc36b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Android/network_security_config.xml
@@ -0,0 +1,10 @@
+
+
+
+ 10.0.2.2
+ insightpayments.com
+ devapi.insightpayments.com
+ xamarin.com
+ 3.6.215.207
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Platforms/MacCatalyst/AppDelegate.cs b/GMCabsDriverAssistantSolution/Platforms/MacCatalyst/AppDelegate.cs
new file mode 100644
index 0000000..c3e2860
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/MacCatalyst/AppDelegate.cs
@@ -0,0 +1,9 @@
+using Foundation;
+
+namespace GMCabsDriverAssistantSolution;
+
+[Register("AppDelegate")]
+public class AppDelegate : MauiUIApplicationDelegate
+{
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+}
diff --git a/GMCabsDriverAssistantSolution/Platforms/MacCatalyst/Info.plist b/GMCabsDriverAssistantSolution/Platforms/MacCatalyst/Info.plist
new file mode 100644
index 0000000..c96dd0a
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/MacCatalyst/Info.plist
@@ -0,0 +1,30 @@
+
+
+
+
+ UIDeviceFamily
+
+ 1
+ 2
+
+ UIRequiredDeviceCapabilities
+
+ arm64
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ XSAppIconAssets
+ Assets.xcassets/appicon.appiconset
+
+
diff --git a/GMCabsDriverAssistantSolution/Platforms/MacCatalyst/Program.cs b/GMCabsDriverAssistantSolution/Platforms/MacCatalyst/Program.cs
new file mode 100644
index 0000000..732de27
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/MacCatalyst/Program.cs
@@ -0,0 +1,15 @@
+using ObjCRuntime;
+using UIKit;
+
+namespace GMCabsDriverAssistantSolution;
+
+public class Program
+{
+ // This is the main entry point of the application.
+ static void Main(string[] args)
+ {
+ // if you want to use a different Application Delegate class from "AppDelegate"
+ // you can specify it here.
+ UIApplication.Main(args, null, typeof(AppDelegate));
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Platforms/Tizen/Main.cs b/GMCabsDriverAssistantSolution/Platforms/Tizen/Main.cs
new file mode 100644
index 0000000..f0efd44
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Tizen/Main.cs
@@ -0,0 +1,16 @@
+using System;
+using Microsoft.Maui;
+using Microsoft.Maui.Hosting;
+
+namespace GMCabsDriverAssistantSolution;
+
+class Program : MauiApplication
+{
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+
+ static void Main(string[] args)
+ {
+ var app = new Program();
+ app.Run(args);
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Platforms/Tizen/tizen-manifest.xml b/GMCabsDriverAssistantSolution/Platforms/Tizen/tizen-manifest.xml
new file mode 100644
index 0000000..c8c8977
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Tizen/tizen-manifest.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+ maui-appicon-placeholder
+
+
+
+
+ http://tizen.org/privilege/internet
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Platforms/Windows/App.xaml b/GMCabsDriverAssistantSolution/Platforms/Windows/App.xaml
new file mode 100644
index 0000000..bdfdb88
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Windows/App.xaml
@@ -0,0 +1,8 @@
+
+
+
diff --git a/GMCabsDriverAssistantSolution/Platforms/Windows/App.xaml.cs b/GMCabsDriverAssistantSolution/Platforms/Windows/App.xaml.cs
new file mode 100644
index 0000000..af95a46
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Windows/App.xaml.cs
@@ -0,0 +1,24 @@
+using Microsoft.UI.Xaml;
+
+// To learn more about WinUI, the WinUI project structure,
+// and more about our project templates, see: http://aka.ms/winui-project-info.
+
+namespace GMCabsDriverAssistantSolution.WinUI;
+
+///
+/// Provides application-specific behavior to supplement the default Application class.
+///
+public partial class App : MauiWinUIApplication
+{
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public App()
+ {
+ this.InitializeComponent();
+ }
+
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+}
+
diff --git a/GMCabsDriverAssistantSolution/Platforms/Windows/Package.appxmanifest b/GMCabsDriverAssistantSolution/Platforms/Windows/Package.appxmanifest
new file mode 100644
index 0000000..2bcb11e
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Windows/Package.appxmanifest
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+ $placeholder$
+ User Name
+ $placeholder$.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GMCabsDriverAssistantSolution/Platforms/Windows/app.manifest b/GMCabsDriverAssistantSolution/Platforms/Windows/app.manifest
new file mode 100644
index 0000000..48ff669
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/Windows/app.manifest
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ true/PM
+ PerMonitorV2, PerMonitor
+
+
+
diff --git a/GMCabsDriverAssistantSolution/Platforms/iOS/AppDelegate.cs b/GMCabsDriverAssistantSolution/Platforms/iOS/AppDelegate.cs
new file mode 100644
index 0000000..c3e2860
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/iOS/AppDelegate.cs
@@ -0,0 +1,9 @@
+using Foundation;
+
+namespace GMCabsDriverAssistantSolution;
+
+[Register("AppDelegate")]
+public class AppDelegate : MauiUIApplicationDelegate
+{
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+}
diff --git a/GMCabsDriverAssistantSolution/Platforms/iOS/Info.plist b/GMCabsDriverAssistantSolution/Platforms/iOS/Info.plist
new file mode 100644
index 0000000..0004a4f
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/iOS/Info.plist
@@ -0,0 +1,32 @@
+
+
+
+
+ LSRequiresIPhoneOS
+
+ UIDeviceFamily
+
+ 1
+ 2
+
+ UIRequiredDeviceCapabilities
+
+ arm64
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ XSAppIconAssets
+ Assets.xcassets/appicon.appiconset
+
+
diff --git a/GMCabsDriverAssistantSolution/Platforms/iOS/Program.cs b/GMCabsDriverAssistantSolution/Platforms/iOS/Program.cs
new file mode 100644
index 0000000..732de27
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Platforms/iOS/Program.cs
@@ -0,0 +1,15 @@
+using ObjCRuntime;
+using UIKit;
+
+namespace GMCabsDriverAssistantSolution;
+
+public class Program
+{
+ // This is the main entry point of the application.
+ static void Main(string[] args)
+ {
+ // if you want to use a different Application Delegate class from "AppDelegate"
+ // you can specify it here.
+ UIApplication.Main(args, null, typeof(AppDelegate));
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Properties/launchSettings.json b/GMCabsDriverAssistantSolution/Properties/launchSettings.json
new file mode 100644
index 0000000..edf8aad
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Properties/launchSettings.json
@@ -0,0 +1,8 @@
+{
+ "profiles": {
+ "Windows Machine": {
+ "commandName": "MsixPackage",
+ "nativeDebugging": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Resources/AppIcon/appicon.svg b/GMCabsDriverAssistantSolution/Resources/AppIcon/appicon.svg
new file mode 100644
index 0000000..9d63b65
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Resources/AppIcon/appicon.svg
@@ -0,0 +1,4 @@
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Resources/AppIcon/appiconfg.svg b/GMCabsDriverAssistantSolution/Resources/AppIcon/appiconfg.svg
new file mode 100644
index 0000000..21dfb25
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Resources/AppIcon/appiconfg.svg
@@ -0,0 +1,8 @@
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Resources/Fonts/OpenSans-Regular.ttf b/GMCabsDriverAssistantSolution/Resources/Fonts/OpenSans-Regular.ttf
new file mode 100644
index 0000000..6cbaf4b
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Fonts/OpenSans-Regular.ttf differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Fonts/OpenSans-Semibold.ttf b/GMCabsDriverAssistantSolution/Resources/Fonts/OpenSans-Semibold.ttf
new file mode 100644
index 0000000..554d68a
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Fonts/OpenSans-Semibold.ttf differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/adminlock.png b/GMCabsDriverAssistantSolution/Resources/Images/adminlock.png
new file mode 100644
index 0000000..60ca898
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/adminlock.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/avail_button.png b/GMCabsDriverAssistantSolution/Resources/Images/avail_button.png
new file mode 100644
index 0000000..121a819
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/avail_button.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/back_arrow.png b/GMCabsDriverAssistantSolution/Resources/Images/back_arrow.png
new file mode 100644
index 0000000..efd2449
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/back_arrow.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/backspace.png b/GMCabsDriverAssistantSolution/Resources/Images/backspace.png
new file mode 100644
index 0000000..0121601
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/backspace.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/barcode.png b/GMCabsDriverAssistantSolution/Resources/Images/barcode.png
new file mode 100644
index 0000000..f920fe8
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/barcode.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/baseline_home_black_24dp.png b/GMCabsDriverAssistantSolution/Resources/Images/baseline_home_black_24dp.png
new file mode 100644
index 0000000..ee35b84
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/baseline_home_black_24dp.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/busy_button.png b/GMCabsDriverAssistantSolution/Resources/Images/busy_button.png
new file mode 100644
index 0000000..a4fa05d
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/busy_button.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/card_cash.png b/GMCabsDriverAssistantSolution/Resources/Images/card_cash.png
new file mode 100644
index 0000000..82820a8
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/card_cash.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/clock.png b/GMCabsDriverAssistantSolution/Resources/Images/clock.png
new file mode 100644
index 0000000..289af89
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/clock.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/cut_out_stars.png b/GMCabsDriverAssistantSolution/Resources/Images/cut_out_stars.png
new file mode 100644
index 0000000..78456cb
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/cut_out_stars.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/driver.png b/GMCabsDriverAssistantSolution/Resources/Images/driver.png
new file mode 100644
index 0000000..d26d0b0
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/driver.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/gmlogo.png b/GMCabsDriverAssistantSolution/Resources/Images/gmlogo.png
new file mode 100644
index 0000000..564350b
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/gmlogo.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/gmlogo_tablet.png b/GMCabsDriverAssistantSolution/Resources/Images/gmlogo_tablet.png
new file mode 100644
index 0000000..0c86cfa
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/gmlogo_tablet.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/google_map.png b/GMCabsDriverAssistantSolution/Resources/Images/google_map.png
new file mode 100644
index 0000000..e576dea
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/google_map.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/green_pin.png b/GMCabsDriverAssistantSolution/Resources/Images/green_pin.png
new file mode 100644
index 0000000..cbf9ba1
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/green_pin.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/grey_pin.png b/GMCabsDriverAssistantSolution/Resources/Images/grey_pin.png
new file mode 100644
index 0000000..daa7df0
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/grey_pin.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/home.png b/GMCabsDriverAssistantSolution/Resources/Images/home.png
new file mode 100644
index 0000000..c62558f
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/home.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_blank.png b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_blank.png
new file mode 100644
index 0000000..48774c0
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_blank.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_end_shift.png b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_end_shift.png
new file mode 100644
index 0000000..2b53783
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_end_shift.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_home.png b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_home.png
new file mode 100644
index 0000000..fd9ebb6
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_home.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_licence_scan.png b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_licence_scan.png
new file mode 100644
index 0000000..d1224ac
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_licence_scan.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_rydo.png b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_rydo.png
new file mode 100644
index 0000000..3221990
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_rydo.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_settings.png b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_settings.png
new file mode 100644
index 0000000..7fad9a6
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_settings.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_voucher_scan.png b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_voucher_scan.png
new file mode 100644
index 0000000..9ab7121
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/ic_menu_voucher_scan.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/ic_outline_document_scanner_black_24.png b/GMCabsDriverAssistantSolution/Resources/Images/ic_outline_document_scanner_black_24.png
new file mode 100644
index 0000000..d3ee9c2
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/ic_outline_document_scanner_black_24.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/ic_stat_ic_notification.png b/GMCabsDriverAssistantSolution/Resources/Images/ic_stat_ic_notification.png
new file mode 100644
index 0000000..1b6a2ed
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/ic_stat_ic_notification.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/icon_about.png b/GMCabsDriverAssistantSolution/Resources/Images/icon_about.png
new file mode 100644
index 0000000..4884525
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/icon_about.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/icon_feed.png b/GMCabsDriverAssistantSolution/Resources/Images/icon_feed.png
new file mode 100644
index 0000000..fdf6daf
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/icon_feed.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/importanticonsmall.png b/GMCabsDriverAssistantSolution/Resources/Images/importanticonsmall.png
new file mode 100644
index 0000000..e01e7e1
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/importanticonsmall.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/key_pad_image.png b/GMCabsDriverAssistantSolution/Resources/Images/key_pad_image.png
new file mode 100644
index 0000000..34e246b
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/key_pad_image.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/menu.png b/GMCabsDriverAssistantSolution/Resources/Images/menu.png
new file mode 100644
index 0000000..03dd560
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/menu.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/message.png b/GMCabsDriverAssistantSolution/Resources/Images/message.png
new file mode 100644
index 0000000..12a64e7
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/message.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/next_arrow.png b/GMCabsDriverAssistantSolution/Resources/Images/next_arrow.png
new file mode 100644
index 0000000..4ec1bdd
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/next_arrow.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/paid.png b/GMCabsDriverAssistantSolution/Resources/Images/paid.png
new file mode 100644
index 0000000..b6c60de
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/paid.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/passenger.png b/GMCabsDriverAssistantSolution/Resources/Images/passenger.png
new file mode 100644
index 0000000..eb04fe5
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/passenger.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/phone_image.png b/GMCabsDriverAssistantSolution/Resources/Images/phone_image.png
new file mode 100644
index 0000000..4cb6a09
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/phone_image.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/red_pin.png b/GMCabsDriverAssistantSolution/Resources/Images/red_pin.png
new file mode 100644
index 0000000..f6c81ad
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/red_pin.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/rightdoc.png b/GMCabsDriverAssistantSolution/Resources/Images/rightdoc.png
new file mode 100644
index 0000000..a1c14f8
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/rightdoc.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/righttic.png b/GMCabsDriverAssistantSolution/Resources/Images/righttic.png
new file mode 100644
index 0000000..7bd986f
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/righttic.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/scanned.png b/GMCabsDriverAssistantSolution/Resources/Images/scanned.png
new file mode 100644
index 0000000..d01f68b
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/scanned.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/setting_alert.png b/GMCabsDriverAssistantSolution/Resources/Images/setting_alert.png
new file mode 100644
index 0000000..6676705
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/setting_alert.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/support.png b/GMCabsDriverAssistantSolution/Resources/Images/support.png
new file mode 100644
index 0000000..790893d
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/support.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/sync.png b/GMCabsDriverAssistantSolution/Resources/Images/sync.png
new file mode 100644
index 0000000..35b70fe
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/sync.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/user.png b/GMCabsDriverAssistantSolution/Resources/Images/user.png
new file mode 100644
index 0000000..12e01ed
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/user.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/waze.png b/GMCabsDriverAssistantSolution/Resources/Images/waze.png
new file mode 100644
index 0000000..5f671cd
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/waze.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/wrongdoc.png b/GMCabsDriverAssistantSolution/Resources/Images/wrongdoc.png
new file mode 100644
index 0000000..30fc90b
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/wrongdoc.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Images/xamarin_logo.png b/GMCabsDriverAssistantSolution/Resources/Images/xamarin_logo.png
new file mode 100644
index 0000000..b36d00e
Binary files /dev/null and b/GMCabsDriverAssistantSolution/Resources/Images/xamarin_logo.png differ
diff --git a/GMCabsDriverAssistantSolution/Resources/Raw/AboutAssets.txt b/GMCabsDriverAssistantSolution/Resources/Raw/AboutAssets.txt
new file mode 100644
index 0000000..15d6244
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Resources/Raw/AboutAssets.txt
@@ -0,0 +1,15 @@
+Any raw assets you want to be deployed with your application can be placed in
+this directory (and child directories). Deployment of the asset to your application
+is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
+
+
+
+These files will be deployed with you package and will be accessible using Essentials:
+
+ async Task LoadMauiAsset()
+ {
+ using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
+ using var reader = new StreamReader(stream);
+
+ var contents = reader.ReadToEnd();
+ }
diff --git a/GMCabsDriverAssistantSolution/Resources/Splash/splash.svg b/GMCabsDriverAssistantSolution/Resources/Splash/splash.svg
new file mode 100644
index 0000000..21dfb25
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Resources/Splash/splash.svg
@@ -0,0 +1,8 @@
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Resources/Styles/Colors.xaml b/GMCabsDriverAssistantSolution/Resources/Styles/Colors.xaml
new file mode 100644
index 0000000..245758b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Resources/Styles/Colors.xaml
@@ -0,0 +1,44 @@
+
+
+
+
+ #512BD4
+ #DFD8F7
+ #2B0B98
+ White
+ Black
+ #E1E1E1
+ #C8C8C8
+ #ACACAC
+ #919191
+ #6E6E6E
+ #404040
+ #212121
+ #141414
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #F7B548
+ #FFD590
+ #FFE5B9
+ #28C2D1
+ #7BDDEF
+ #C3F2F4
+ #3E8EED
+ #72ACF1
+ #A7CBF6
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Resources/Styles/Styles.xaml b/GMCabsDriverAssistantSolution/Resources/Styles/Styles.xaml
new file mode 100644
index 0000000..1ec9d55
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Resources/Styles/Styles.xaml
@@ -0,0 +1,384 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GMCabsDriverAssistantSolution/Services/DispatchAppComponentService.cs b/GMCabsDriverAssistantSolution/Services/DispatchAppComponentService.cs
new file mode 100644
index 0000000..125fb94
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Services/DispatchAppComponentService.cs
@@ -0,0 +1,144 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Utils;
+using GMCabsDriverAssistant.ViewModels;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+using GMCabsDriverAssistantSolution.ViewModels;
+
+namespace GMCabsDriverAssistant.Services
+{
+ public class DispatchAppComponentService : BaseViewModel
+ {
+ #region Properties
+ public static DispatchAppComponentService _instance = null;
+ public static object chekLock = new object();
+ public static string startTripButtonText = "START TRIP";
+ public static string startTimeOrEndLocation = "";
+ public static string timerSeconds = "00:00:00";
+ public static bool meterTripStarted = false;
+ public static bool visibleTrip = false;
+ public static string startSuburb = "";
+ public static bool isOkButtonVisible = false;
+ public static bool isStartTripButtonVisible = true;
+ public static bool isPlotButtonVisible = true;
+ public static string pickUpDateTimeOrEndSuburb = "";
+ public static bool isTripStarted = false;
+ public static bool isTripEndeded = false;
+ public static int seconds = 0;
+ public static int autocloseOkSecond = 30;
+ public static string bluetoothConnectionStatusText;
+ public static string imageIcon = "avail_button.png";
+ #endregion
+
+ #region Constructor
+ private DispatchAppComponentService()
+ {
+ }
+ public static DispatchAppComponentService Instance
+ {
+ get
+ {
+ lock (chekLock)
+ {
+ if (_instance == null)
+ _instance = new DispatchAppComponentService();
+ return _instance;
+ }
+ }
+
+ }
+ #endregion
+
+ #region Methods
+ public static void ManageDriverTrip(bool fromMeter)
+ {
+ if (startTripButtonText.Equals("START TRIP"))
+ {
+ startTimeOrEndLocation = "Start Time";
+ startTrip(fromMeter);
+ timerSeconds = "00:00:00";
+ }
+ else if (startTripButtonText.Equals("DROP OFF"))
+ {
+ startTimeOrEndLocation = "Ending At";
+ endTrip(fromMeter);
+ isOkButtonVisible = true;
+ }
+ }
+ private static void startTrip(bool fromMeter)
+ {
+ meterTripStarted = true;
+ imageIcon = "busy_button.png";
+ visibleTrip = true;
+ pickUpDateTimeOrEndSuburb = DateTime.Now.ToString("dd MMM hh:mm tt");
+ startTripButtonText = "DROP OFF";
+ Preferences.Set("MeterRunningStatus", "Running");
+ }
+ private static void endTrip(bool fromMeter)
+ {
+ meterTripStarted = true;
+ imageIcon = "avail_button.png";
+ isStartTripButtonVisible = false;
+ Preferences.Set("MeterRunningStatus", "Stopped");
+ }
+ public async static Task GetSuburbName(bool fromMeter, bool isStart)
+ {
+ int statusflags = 0;
+ var token = Preferences.Get(SecureStorageData.Token,"");
+ if (isStart)
+ statusflags = Constant.DRIVER_STATUS_ON_TRIP;
+ else
+ statusflags = Constant.DRIVER_STATUS_AVAILABLE;
+
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ var suburbName = await gmCabsDriverService.UpdateBookingStatus(token, statusflags, fromMeter);
+ return suburbName;
+ }
+ public static void StartTrip(int seconds)
+ {
+ ++seconds;
+ timerSeconds = (seconds / 3600 <= 9 ? "0" + seconds / 3600 : "" + seconds / 3600) + ":" + ((seconds % 3600) / 60 <= 9 ? "0" + (seconds % 3600) / 60 : "" + (seconds % 3600) / 60) + ":" + (seconds % 60 <= 9 ? "0" + seconds % 60 : "" + seconds % 60);
+ }
+ public static void OnOkClick()
+ {
+ visibleTrip = false;
+ startTripButtonText = "START TRIP";
+ isStartTripButtonVisible = true;
+ isOkButtonVisible = false;
+ Preferences.Set("MeterRunningStatus", "");
+ }
+ public static string MeterStartTrip()
+ {
+ startTripButtonText = "START TRIP";
+ return startTripButtonText;
+ }
+ public static string MeterEndTrip()
+ {
+ startTripButtonText = "DROP OFF";
+ return startTripButtonText;
+ }
+ public static void SetToInitialProperties()
+ {
+ startTripButtonText = "START TRIP";
+ startTimeOrEndLocation = "";
+ timerSeconds = "00:00:00";
+ meterTripStarted = false;
+ imageIcon = "avail_button.png";
+ visibleTrip = false;
+ startSuburb = "";
+ isOkButtonVisible = false;
+ isStartTripButtonVisible = true;
+ pickUpDateTimeOrEndSuburb = "";
+ isTripStarted = false;
+ isTripEndeded = false;
+ seconds = 0;
+ autocloseOkSecond = 30;
+ }
+ #endregion
+
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Services/GMCabsDriverService.cs b/GMCabsDriverAssistantSolution/Services/GMCabsDriverService.cs
new file mode 100644
index 0000000..7c46371
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Services/GMCabsDriverService.cs
@@ -0,0 +1,1075 @@
+using GMCabsDriverAssistant.Enums;
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Models.Rydo;
+using GMCabsDriverAssistant.Utils;
+using GMCabsDriverAssistantSolution.Models.Rydo;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using static GMCabsDriverAssistant.Constants;
+
+namespace GMCabsDriverAssistant.Services
+{
+ public class GMCabsDriverService
+ {
+ #region Fields
+
+ #endregion
+
+ #region Properties
+ #endregion
+
+ #region Constructor
+ #endregion
+
+ #region Methods
+
+ public async Task ValidateAuthToken(string token, string fcmToken)
+ {
+
+ ValidateTokenResponseDto validateTokenResponseDto = new ValidateTokenResponseDto();
+ Uri uri = new Uri($"{BASE_URL}/Auth/ValidateToken");
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(new { token, fcmToken });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ validateTokenResponseDto = JsonSerializer.Deserialize(responseData, options);
+ }
+ return validateTokenResponseDto;
+ }
+ public async Task Login(LoginRequestDto loginRequestDto)
+ {
+ LoginResponseDto loginResponseDto = new LoginResponseDto();
+ try
+ {
+ Uri uri = new Uri(string.Format(BASE_URL + "/Auth/Login", string.Empty));
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(loginRequestDto);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ loginResponseDto = JsonSerializer.Deserialize(responseData, options);
+
+ if (response.IsSuccessStatusCode)
+ {
+ // DO Nothing
+
+ }
+ else if (response.StatusCode == HttpStatusCode.BadRequest)
+ {
+ //TODO
+ return loginResponseDto;
+ }
+ else if (response.StatusCode == HttpStatusCode.Unauthorized)
+ {
+ //TODO
+ return loginResponseDto;
+ }
+
+ }
+ catch (Exception ex)
+ {
+
+ throw ex;
+ }
+ return loginResponseDto;
+ }
+ public async Task EftposLogin(EftposLoginRequest eftposLoginRequest)
+ {
+ EftposLoginResponse eftposLoginResponse = new EftposLoginResponse();
+
+ Uri uri = new Uri(string.Format(BASE_URL_RYDO_API + "/v1/account/eftpos-login", string.Empty));
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(eftposLoginRequest);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ eftposLoginResponse = JsonSerializer.Deserialize(responseData, options);
+ }
+ return eftposLoginResponse;
+ }
+ public async Task GetUnreadNotificationCount(string appToken)
+ {
+ UnreadCountResponseDto unreadCountResponse = new UnreadCountResponseDto();
+ var unreadNotificationCount = 0;
+
+ Uri uri = new Uri($"{BASE_URL}/Notifications/UnreadCount?token={appToken}");
+
+ Console.WriteLine($"URI: {uri}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ unreadNotificationCount = JsonSerializer.Deserialize(responseData, options);
+
+ unreadCountResponse.StatusCode = Constant.SUCCESS_CODE;
+ unreadCountResponse.UnreadNotificationCount = unreadNotificationCount;
+ }
+ else
+ {
+ if (response.StatusCode == HttpStatusCode.Unauthorized)
+ {
+ unreadCountResponse.StatusCode = Constant.UNAUTHORIZED_CODE;
+ unreadCountResponse.UnreadNotificationCount = unreadNotificationCount;
+ }
+ else
+ {
+ unreadCountResponse.StatusCode = Constant.BADREQUEST_CODE;
+ unreadCountResponse.UnreadNotificationCount = unreadNotificationCount;
+ }
+ }
+
+ return unreadCountResponse;
+ }
+ public async Task> GetBookingAvailableCount(string accessToken, string driverId, double lat, double lng)
+ {
+ List bookingIDs = null;
+
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{driverId}/available?latitude={lat}&longitude={lng}");
+ Console.WriteLine($"URI: {uri}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var responseData = await response.Content.ReadAsStringAsync();
+ List bookings = JsonSerializer.Deserialize>(responseData);
+ if (bookings != null)
+ {
+ bookingIDs = new List();
+ foreach (BookingDto booking in bookings) { bookingIDs.Add(booking.BookingId); }
+ }
+ }
+ return bookingIDs;
+ }
+ public async Task> GetCoupons(string appToken)
+ {
+ List coupons = new List();
+ Uri uri = new Uri(string.Format(BASE_URL + "/Coupons?token=" + appToken, string.Empty));
+ Console.WriteLine($"URI: {uri}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ coupons = JsonSerializer.Deserialize>(responseData, options);
+ }
+ else if (response.StatusCode == HttpStatusCode.BadRequest)
+ {
+ //TODO
+ }
+ else if (response.StatusCode == HttpStatusCode.Unauthorized)
+ {
+ //TODO
+ }
+
+ return coupons;
+ }
+ public async Task> GetCouponsHistory(string appToken)
+ {
+ List couponsHistory = new List();
+
+ Uri uri = new Uri(string.Format(BASE_URL + "/Coupons/History?token=" + appToken, string.Empty));
+ Console.WriteLine($"URI: {uri}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ couponsHistory = JsonSerializer.Deserialize>(responseData, options);
+ }
+ else if (response.StatusCode == HttpStatusCode.BadRequest)
+ {
+ //TODO
+ }
+ else if (response.StatusCode == HttpStatusCode.Unauthorized)
+ {
+ //TODO
+ }
+
+ return couponsHistory;
+ }
+ public async Task> GetNotifications(string appToken)
+ {
+ List notifications = new List();
+ try
+ {
+ Uri uri = new Uri(string.Format(BASE_URL + "/Notifications?token=" + appToken, string.Empty));
+ Console.WriteLine($"URI: {uri}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage respose = await _httpClient.GetAsync(uri);
+ if (respose != null)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await respose.Content.ReadAsStringAsync();
+ notifications = JsonSerializer.Deserialize>(responseData, options);
+ }
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ return notifications;
+ }
+ public async Task MarkNotificationAsViewed(string appToken, string notificationId)
+ {
+ Uri uri = new Uri($"{BASE_URL}/Notifications/NotificationViewed/{notificationId}?token={appToken}");
+ Console.WriteLine($"URI: {uri}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+
+ var response = await _httpClient.PutAsync(uri, null);
+
+ return response.IsSuccessStatusCode;
+ }
+ public async Task> GetBookings(string accessToken, Guid driverId, double lat, double lng)
+ {
+ List bookings = new List();
+
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{driverId}/available?latitude={lat}&longitude={lng}");
+ Debug.WriteLine(uri);
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+
+ if (response.IsSuccessStatusCode)
+ {
+ var responseData = await response.Content.ReadAsStringAsync();
+ bookings = JsonSerializer.Deserialize>(responseData);
+ //if (bookings.Count <= 0)
+ //{
+ // uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{driverId}/available?future_bookings=1");
+ // _httpClient = new HttpClient();
+ // _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ // response = await _httpClient.GetAsync(uri);
+ // if (response.IsSuccessStatusCode)
+ // {
+ // var featureResponseData = await response.Content.ReadAsStringAsync();
+ // bookings = JsonSerializer.Deserialize>(featureResponseData);
+ // }
+
+ //}
+ }
+ bookings = bookings.OrderBy(x => x.FormmattedPickUpDateTime).ToList();
+ return await Task.FromResult(bookings);
+ }
+ public async Task AcceptBooking(AcceptDeclineBookingRequest acceptBookingRequest, string accessToken, string bookingId)
+ {
+ AcceptDeclineBookingResponse acceptBookingResponse = new AcceptDeclineBookingResponse();
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/accept");
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(acceptBookingRequest);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.PutAsync(uri, content);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ acceptBookingResponse = JsonSerializer.Deserialize(responseData, options);
+ }
+ acceptBookingResponse.StatusCode = (int)response.StatusCode;
+ acceptBookingResponse.Message = (string)response.ReasonPhrase;
+ return acceptBookingResponse;
+ }
+ public async Task DeclineBooking(AcceptDeclineBookingRequest declineBookingRequest, string accessToken, string bookingId)
+ {
+ AcceptDeclineBookingResponse declineBookingResponse = new AcceptDeclineBookingResponse();
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/decline");
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(declineBookingRequest);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.PutAsync(uri, content);
+ declineBookingResponse.StatusCode = (int)response.StatusCode;
+ declineBookingResponse.Message = (string)response.ReasonPhrase;
+
+ return declineBookingResponse;
+ }
+ public async Task SendDriverLocation(string appToken, LocationUpdateRequestDto locationUpdateRequestDto)
+ {
+ Uri uri = new Uri($"{BASE_URL}/DriverAssistantApp/UpdateLocation?token={appToken}");
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(locationUpdateRequestDto);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PutAsync(uri, content);
+
+ return (int)response.StatusCode;
+ }
+ public async Task SendDriverLocationTablet(LocationUpdateRequestDto locationUpdateRequestDto)
+ {
+ Uri uri = new Uri($"{BASE_URL}/DriverAssistantApp/UpdateLocationTablet");
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(locationUpdateRequestDto);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PutAsync(uri, content);
+
+ return (int)response.StatusCode;
+ }
+ public async Task UpdateSilentModeSetting(string appToken, SilentModeSettingRequest request)
+ {
+ Uri uri = new Uri($"{BASE_URL}/DriverAssistantApp/UpdateDriverAppSilentModeSetting?token={appToken}");
+ string json = JsonSerializer.Serialize(request);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PutAsync(uri, content);
+
+ return response.IsSuccessStatusCode;
+ }
+ public async Task> GetAcceptedFutureBookings(string accessToken, Guid driverId)
+ {
+ List bookings = new List();
+
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{driverId}/accepted");
+ Debug.WriteLine(uri);
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var responseData = await response.Content.ReadAsStringAsync();
+ bookings = JsonSerializer.Deserialize>(responseData);
+ }
+ return await Task.FromResult(bookings);
+ }
+ public async Task GetBookingDetails(string accessToken, Guid bookingId)
+ {
+ BookingDto booking = new BookingDto();
+
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/details");
+ Debug.WriteLine(uri);
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var responseData = await response.Content.ReadAsStringAsync();
+ booking = JsonSerializer.Deserialize(responseData);
+ }
+
+ return await Task.FromResult(booking);
+ }
+ public async Task GetAcceptedOnDemandBookingForDriver(string accessToken, Guid driverId)
+ {
+ List booking = new List();
+
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{driverId}/accepted");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var responseData = await response.Content.ReadAsStringAsync();
+ booking = JsonSerializer.Deserialize>(responseData);
+ }
+
+ // there can be only on accepted on demand booking so the below result will either be the only entry or null
+ return await Task.FromResult(booking.FirstOrDefault());
+ }
+ public async Task UpdateProfile(string appToken, MultipartFormDataContent content)
+ {
+ Uri uri = new Uri($"{BASE_URL}/Driver/UpdateDriverDetails?token={appToken}");
+ Debug.WriteLine(uri);
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+
+ return response.IsSuccessStatusCode;
+ }
+ public async Task GenerateOtp(string mobileNumber)
+ {
+ Uri uri = new Uri($"{BASE_URL}/Auth/GenerateOtp?mobileNumber={mobileNumber}");
+ Debug.WriteLine(uri);
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, null);
+
+ return response.IsSuccessStatusCode;
+ }
+ public async Task VerifyOtp(string mobileNumber, string otp)
+ {
+ var isOtpValid = false;
+
+ Uri uri = new Uri($"{BASE_URL}/Auth/VerifyOtp");
+ Console.WriteLine($"URI: {uri}");
+ string json = JsonSerializer.Serialize(new { mobileNumber, otp });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+ if (response.IsSuccessStatusCode)
+ {
+ var responseData = await response.Content.ReadAsStringAsync();
+ isOtpValid = bool.Parse(responseData);
+ }
+
+ return isOtpValid;
+ }
+ public async Task UpdateDriverPin(string mobileNumber, int pin)
+ {
+ Uri uri = new Uri($"{BASE_URL}/Auth/UpdateDriverPin");
+ Debug.WriteLine(uri);
+
+ string json = JsonSerializer.Serialize(new { mobileNumber, pin });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+
+ return response.IsSuccessStatusCode;
+ }
+ public async Task CouponScan(string appToken, string couponText)
+ {
+ Uri uri = new Uri($"{BASE_URL}/Driver/CouponScan?token={appToken}");
+ string json = JsonSerializer.Serialize(new { couponText });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+ var status = await response.Content.ReadAsStringAsync();
+ return status.ToString();
+ }
+ public async Task VoucherScanedCount(string appToken, DateTime reportingDate)
+ {
+ var voucherScanedCount = 0;
+
+ Uri uri = new Uri($"{BASE_URL}/Coupons/VouchersScannedCount?token={appToken}");
+ string json = JsonSerializer.Serialize(new { reportingDate });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ voucherScanedCount = JsonSerializer.Deserialize(responseData, options);
+ }
+
+ return voucherScanedCount;
+ }
+ public async Task LogoutDriverApp(string appToken, double lastLat, double lastLng)
+ {
+ Uri uri = new Uri($"{BASE_URL}/Auth/Logout?token={appToken}&lastLat={lastLat}&lastLng={lastLng}");
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PostAsync(uri, content);
+
+ return response.IsSuccessStatusCode;
+ }
+ public async Task DeclineFutureBooking(string accessToken, String bookingId)
+ {
+ bool result = false;
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/release");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ StringContent content = new StringContent("", Encoding.UTF8, "application/json");
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.PutAsync(uri, content);
+ if (response.IsSuccessStatusCode)
+ {
+ result = true;
+ }
+ return result;
+ }
+ public async Task CreateLightDriver(CreateLightDriverRequest createLightDriverRequest)
+ {
+ bool result = false;
+ try
+ {
+ Uri uri = new Uri(string.Format(BASE_URL + "/Auth/CreateLightDriver", string.Empty));
+ Console.WriteLine($"URI: {uri}");
+ string json = JsonSerializer.Serialize(createLightDriverRequest);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+ if (response.StatusCode == HttpStatusCode.OK)
+ {
+ result= true;
+ }
+ else if (response.StatusCode == HttpStatusCode.BadRequest)
+ {
+ //TODO
+ result= false;
+ }
+
+ }
+ catch (Exception ex)
+ {
+ result = false;
+ }
+ return result;
+ }
+ public async Task GetLocationVoucherByLocationID(string appToken, int issuedFromLocationID)
+ {
+ LocationVoucherDto locationVoucher = new LocationVoucherDto();
+ Uri uri = new Uri(string.Format(BASE_URL + "/Coupons/GetLocationVoucherByLocationID?token=" + appToken+ "&issuedFromLocationID=" + issuedFromLocationID, string.Empty));
+ Console.WriteLine($"URI: {uri}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ locationVoucher = JsonSerializer.Deserialize(responseData, options);
+ }
+ else if (response.StatusCode == HttpStatusCode.BadRequest)
+ {
+ //TODO
+ }
+ else if (response.StatusCode == HttpStatusCode.Unauthorized)
+ {
+ //TODO
+ }
+
+ return locationVoucher;
+ }
+ public async Task ValidateAdminPassword(string adminPassword)
+ {
+ var isValidAdminPassword = false;
+ Uri uri = new Uri(string.Format(BASE_URL + "/Auth/ValidateAdminPassword?adminPassword=" + adminPassword));
+ Console.WriteLine($"URI: {uri}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.StatusCode == HttpStatusCode.OK)
+ {
+ isValidAdminPassword = true;
+ }
+ else if (response.StatusCode == HttpStatusCode.BadRequest)
+ {
+ isValidAdminPassword = false;
+ }
+
+ return isValidAdminPassword;
+ }
+ public async Task ValidateTaxiNumberInstallation(string taxiNumber)
+ {
+ var isValidAdminPassword = false;
+ Uri uri = new Uri(string.Format(BASE_URL + "/DriverAssistantApp/ValidateTaxiNumberInstallation?taxiNumber=" + taxiNumber));
+ Console.WriteLine($"URI: {uri}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.StatusCode == HttpStatusCode.OK)
+ {
+ isValidAdminPassword = true;
+ }
+ else if (response.StatusCode == HttpStatusCode.BadRequest)
+ {
+ isValidAdminPassword = false;
+ }
+
+ return isValidAdminPassword;
+ }
+ public async Task StartRiding(StartRideRequest startRideRequest, string accessToken, string bookingId)
+ {
+ StartRideResponse startRideResponse = new StartRideResponse();
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/start-ride");
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(startRideRequest);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.PutAsync(uri, content);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ startRideResponse = JsonSerializer.Deserialize(responseData, options);
+ }
+ startRideResponse.StatusCode = (int)response.StatusCode;
+ startRideResponse.Message = (string)response.ReasonPhrase;
+ return startRideResponse;
+ }
+ public async Task SendMessage(MessageRequest messageRequest, string accessToken, string bookingId)
+ {
+ ApiResponseDto apiResponseDto = new ApiResponseDto();
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/message");
+ Console.WriteLine($"URI: {uri}");
+ string json = JsonSerializer.Serialize(messageRequest);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ var response = await _httpClient.PostAsync(uri, content);
+ apiResponseDto.StatusCode = (int)response.StatusCode;
+ apiResponseDto.Message = (string)response.ReasonPhrase;
+ return apiResponseDto;
+ }
+ public async Task ReleaseBooking(string accessToken, string bookingId)
+ {
+ ApiResponseDto apiResponseDto = new ApiResponseDto();
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/release");
+ Console.WriteLine($"URI: {uri}");
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ var response = await _httpClient.PutAsync(uri, content);
+ apiResponseDto.StatusCode = (int)response.StatusCode;
+ apiResponseDto.Message = (string)response.ReasonPhrase;
+ return apiResponseDto;
+ }
+ public async Task NoShowBooking(string accessToken, string bookingId)
+ {
+ ApiResponseDto apiResponseDto = new ApiResponseDto();
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/no-show");
+ Console.WriteLine($"URI: {uri}");
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ var response = await _httpClient.PutAsync(uri, content);
+ apiResponseDto.StatusCode = (int)response.StatusCode;
+ apiResponseDto.Message = (string)response.ReasonPhrase;
+ return apiResponseDto;
+ }
+ public async Task NotifyStop(int stopNumber, string accessToken, string bookingId)
+ {
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/notify-stop?stop_number={stopNumber}");
+ Console.WriteLine($"URI: {uri}");
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.PutAsync(uri, content);
+ return (int)response.StatusCode;
+ }
+ public async Task EndRiding(EndRideRequestDto endRideRequestDto, string accessToken, string bookingId)
+ {
+ ApiResponseDto apiResponseDto = new ApiResponseDto();
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/end-ride");
+ Console.WriteLine($"URI: {uri}");
+ string json = JsonSerializer.Serialize(endRideRequestDto);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ var response = await _httpClient.PutAsync(uri, content);
+ apiResponseDto.StatusCode = (int)response.StatusCode;
+ apiResponseDto.Message = (string)response.ReasonPhrase;
+ return apiResponseDto;
+ }
+ public async Task MakePaymentAtTerminal(string bookingId, string driverId, int amount)
+ {
+ ApiResponseDto apiResponseDto = new ApiResponseDto();
+ Uri uri = new Uri(string.Format(BASE_URL + "/Terminal/PayAtTerminal?bookingID=" + bookingId + "&driverID=" + driverId + "&amount=" + amount));
+ Console.WriteLine($"URI: {uri}");
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PutAsync(uri, content);
+ apiResponseDto.StatusCode = (int)response.StatusCode;
+ apiResponseDto.Message = (string)response.ReasonPhrase;
+ return apiResponseDto;
+ }
+ public async Task CloseAccountDriverApp(string appToken)
+ {
+ Uri uri = new Uri($"{BASE_URL}/Driver/CloseAccount?token={appToken}");
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PutAsync(uri, content);
+
+ return response.IsSuccessStatusCode;
+ }
+ public async Task UpdateBookingStatus(string appToken, int statusFlag, bool isMetered)
+ {
+ Uri uri = new Uri(string.Format(BASE_URL + $"/DriverAssistantApp/MeterTripStatus?token={appToken}&statusFlag={statusFlag}&isMetered={isMetered}"));
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PutAsync(uri, content);
+ var suburbName = (response.StatusCode == HttpStatusCode.OK) ? await response.Content.ReadAsStringAsync() : String.Empty;
+ return suburbName.ToString();
+ }
+ public async Task DriverDistress(string appToken, double lat, double lng)
+ {
+ bool result = false;
+ Uri uri = new Uri(string.Format(BASE_URL + $"/DriverAssistantApp/DriverDistress?token={appToken}&lat={lat}&lng={lng}"));
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PutAsync(uri, content);
+ if (response.StatusCode == HttpStatusCode.OK)
+ {
+ result = true;
+ }
+ return result;
+ }
+ public async Task RequestPayment(string appToken, int amount)
+ {
+ Uri uri = new Uri(string.Format(BASE_URL + "/DriverAssistantApp/RequestPayment?token=" + appToken + "&amount=" + amount));
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PutAsync(uri, content);
+
+ return response.IsSuccessStatusCode;
+ }
+ public async Task> GetAvailableImeiNumbers(string enteredValue)
+ {
+ List imeiNumers = null;
+ Uri uri = new Uri($"{BASE_URL}/TabletDevice/UninstalledImeis?enteredValue={enteredValue}");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ if (responseData != string.Empty)
+ {
+ imeiNumers = JsonSerializer.Deserialize>(responseData,options);
+ }
+ }
+ return imeiNumers;
+ }
+ // now done on logon
+ //public async Task CompleteInstallation(string imeiValue)
+ //{
+ // bool result = false;
+ // Uri uri = new Uri($"{BASE_URL}/TabletDevice/CompleteTabletInstall?imei={imeiValue}");
+ // string json = JsonSerializer.Serialize(new { });
+ // StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ // HttpClient _httpClient = new HttpClient();
+ // var response = await _httpClient.PutAsync(uri, content);
+
+ // if (response.IsSuccessStatusCode)
+ // {
+ // // need to handle a false in content result which means some other device has already been installed in the selected taxi
+
+ // result = true;
+ // }
+ // return result;
+ //}
+ public async Task> GetTripDetails(string appToken)
+ {
+ List tripsBookingResponses = new List();
+
+ Uri uri = new Uri(string.Format(BASE_URL + "/DriverAssistantApp/Trips?token=" + appToken));
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ tripsBookingResponses = JsonSerializer.Deserialize>(responseData, options);
+ }
+
+ return tripsBookingResponses;
+ }
+ public async Task GetLevyBalance(string appToken)
+ {
+ AccountBalanceDto accountBalanceDto = new AccountBalanceDto();
+
+ Uri uri = new Uri(string.Format(BASE_URL + "/Driver/AccountBalance?token=" + appToken));
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ accountBalanceDto = JsonSerializer.Deserialize(responseData, options);
+ }
+
+ return accountBalanceDto;
+ }
+ public async Task GetDriverRatings(string accessToken, string driverId, string phoneNumber)
+ {
+ DriverRatingResponse driverRatingResponse = new DriverRatingResponse();
+
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/drivers?id={driverId}&phone_number={phoneNumber}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ driverRatingResponse = JsonSerializer.Deserialize(responseData, options);
+ }
+ return driverRatingResponse;
+ }
+ public async Task> GetShiftDetails(string appToken)
+ {
+ List shiftResponses = new List();
+
+ Uri uri = new Uri(string.Format(BASE_URL + "/DriverAssistantApp/Shifts?token=" + appToken));
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ shiftResponses = JsonSerializer.Deserialize>(responseData, options);
+ }
+
+ return shiftResponses;
+ }
+
+ public async Task> GetAvailablePlot(string accessToken, string driverId, double lat, double lng)
+ {
+ List plotResponses = new List();
+
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/available-plot?driver_id={driverId}&lat={lat}&lng={lng}");
+
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.GetAsync(uri);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ plotResponses = JsonSerializer.Deserialize>(responseData, options);
+ }
+ return plotResponses;
+ }
+ public async Task GetPlottedDriverInformation(AvailablePlotRequestDto availablePlotRequest, string accessToken)
+ {
+ AvailablePlotResponseDto availablePlotResponse = new AvailablePlotResponseDto();
+
+ Uri uri = new Uri(string.Format(BASE_URL_RYDO_API + "/v1/bookings/driver-plot", string.Empty));
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(availablePlotRequest);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.PostAsync(uri, content);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ availablePlotResponse = JsonSerializer.Deserialize(responseData, options);
+ availablePlotResponse.apiResponseDto = new ApiResponseDto();
+ availablePlotResponse.apiResponseDto.StatusCode = (int)response.StatusCode;
+ availablePlotResponse.apiResponseDto.Message = string.Empty;
+ }
+ else if (response.StatusCode == HttpStatusCode.InternalServerError)
+ {
+ availablePlotResponse.apiResponseDto = new ApiResponseDto();
+ availablePlotResponse.apiResponseDto.StatusCode = (int)response.StatusCode;
+ availablePlotResponse.apiResponseDto.Message = (string)response.ReasonPhrase;
+ }
+ else
+ {
+ availablePlotResponse.apiResponseDto = new ApiResponseDto();
+ availablePlotResponse.apiResponseDto.StatusCode = (int)response.StatusCode;
+ availablePlotResponse.apiResponseDto.Message = "Unable to plot in this area";
+ }
+ return availablePlotResponse;
+ }
+ public async Task RemoveDriverPlot(Guid driverID, string accessToken)
+ {
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{driverID}/driver-leave-plot");
+ Console.WriteLine($"URI: {uri}");
+ string json = JsonSerializer.Serialize(new { });
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.PutAsync(uri, content);
+ return (int)response.StatusCode;
+ }
+ public async Task StartTripFutureBooking(StartTripRequest startTripRequest, string accessToken, string bookingId)
+ {
+ StartTripResponse startTripResponse = new StartTripResponse();
+ Uri uri = new Uri($"{BASE_URL_RYDO_API}/v1/bookings/{bookingId}/head-to-pickup");
+ Console.WriteLine($"URI: {uri}");
+
+ string json = JsonSerializer.Serialize(startTripRequest);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ HttpResponseMessage response = await _httpClient.PutAsync(uri, content);
+ if (response.IsSuccessStatusCode)
+ {
+ var options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ var responseData = await response.Content.ReadAsStringAsync();
+ startTripResponse = JsonSerializer.Deserialize(responseData, options);
+ }
+ startTripResponse.ResponseStatusCode = (int)response.StatusCode;
+ startTripResponse.Message = (string)response.ReasonPhrase;
+ return startTripResponse;
+ }
+ public async Task DriverAppSelectedPermissions(string appToken, DriverAppSelectedPermissionsDto request)
+ {
+ Uri uri = new Uri($"{BASE_URL}/DriverAssistantApp/DriverAppSelectedPermissions?token={appToken}");
+ string json = JsonSerializer.Serialize(request);
+ StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
+ HttpClient _httpClient = new HttpClient();
+ PutAppVersionInHeader(_httpClient);
+ var response = await _httpClient.PutAsync(uri, content);
+
+ return response.IsSuccessStatusCode;
+ }
+
+ #endregion
+
+ #region Utility
+
+ private void PutAppVersionInHeader(HttpClient _httpClient)
+ {
+ string[] parts = AppInfo.Version.ToString().Split('.');
+ string formattedString = parts.Select(p => int.Parse(p).ToString("D2")).Aggregate((p1, p2) => p1 + p2);
+
+ _httpClient.DefaultRequestHeaders.Add("app-version", formattedString);
+ }
+
+ #endregion Utility
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Services/IAlarmService.cs b/GMCabsDriverAssistantSolution/Services/IAlarmService.cs
new file mode 100644
index 0000000..db2ab83
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Services/IAlarmService.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Services
+{
+ public interface IAlarmService
+ {
+ void StartMyAlarmService();
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Services/IBatteryInfo.cs b/GMCabsDriverAssistantSolution/Services/IBatteryInfo.cs
new file mode 100644
index 0000000..b604fdb
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Services/IBatteryInfo.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Services
+{
+ public interface IBatteryInfo
+ {
+ void StartSetting();
+ bool CheckIsIgnoringBatteryOptimizations();
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Services/IForegroundService.cs b/GMCabsDriverAssistantSolution/Services/IForegroundService.cs
new file mode 100644
index 0000000..b58e53b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Services/IForegroundService.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Services
+{
+ public interface IForegroundService
+ {
+ void StartMyForegroundService();
+ void StopMyForegroundService();
+ bool IsForeGroundServiceRunning();
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Services/INotificationChannelService.cs b/GMCabsDriverAssistantSolution/Services/INotificationChannelService.cs
new file mode 100644
index 0000000..cd1132b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Services/INotificationChannelService.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Services
+{
+ public interface INotificationChannelService
+ {
+ void ManageNotificationChannelService();
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Services/LocationService.cs b/GMCabsDriverAssistantSolution/Services/LocationService.cs
new file mode 100644
index 0000000..5d96439
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Services/LocationService.cs
@@ -0,0 +1,122 @@
+using GMCabsDriverAssistant.Messages;
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Utils;
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+
+namespace GMCabsDriverAssistant.Services
+{
+
+ public class LocationService
+ {
+ private const double LOCATION_DISTANCE = 0.015; // 15 meters
+ readonly bool stopping = false;
+ private double lastLatitude = 0;
+ private double lastLongitude = 0;
+
+ public LocationService()
+ {
+ }
+
+ public async Task Run(CancellationToken token)
+ {
+ await Task.Run(async () =>
+ {
+ while (!stopping)
+ {
+ token.ThrowIfCancellationRequested();
+ try
+ {
+ await Task.Delay(10000);
+
+ var request = new GeolocationRequest(GeolocationAccuracy.Best);
+ var location = await Geolocation.GetLocationAsync(request);
+ if (location != null)
+ {
+ var message = new LocationMessage
+ {
+ Latitude = location.Latitude,
+ Longitude = location.Longitude
+ };
+ await UpdateLocationOnServer(location.Latitude, location.Longitude);
+
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ MessagingCenter.Send(message, "Location");
+ });
+ }
+ }
+ catch (Exception ex)
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ var errormessage = new LocationErrorMessage();
+ MessagingCenter.Send(errormessage, "LocationError");
+ });
+ }
+ }
+ return;
+ }, token);
+ }
+ private async Task UpdateLocationOnServer(double currentLatitude, double currentLongitude)
+ {
+ var token = Preferences.Get(SecureStorageData.Token,"");
+ if (token != null)
+ {
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ LocationUpdateRequestDto locationUpdateRequestDto = new LocationUpdateRequestDto();
+ if (lastLatitude == 0.00 && lastLongitude == 0.00)
+ {
+ lastLatitude = currentLatitude;
+ lastLongitude = currentLongitude;
+ locationUpdateRequestDto.Latitude = currentLatitude;
+ locationUpdateRequestDto.Longitude = currentLongitude;
+ locationUpdateRequestDto.Imei = Preferences.Get("imeiNumber", null);
+ if (!string.IsNullOrEmpty(locationUpdateRequestDto.Imei))
+ {
+ await gmCabsDriverService.SendDriverLocationTablet(locationUpdateRequestDto);
+ }
+ else
+ {
+ await gmCabsDriverService.SendDriverLocation(token, locationUpdateRequestDto);
+ }
+
+
+ Preferences.Set("lastLat", currentLatitude);
+ Preferences.Set("lastLng", currentLongitude);
+ }
+ else
+ {
+ Location lastLocation = new Location(lastLatitude, lastLongitude);
+ Location currentLocation = new Location(currentLatitude, currentLongitude);
+ double kilometers = Location.CalculateDistance(lastLocation, currentLocation, DistanceUnits.Kilometers);
+ if (kilometers > LOCATION_DISTANCE)
+ {
+
+ lastLatitude = currentLatitude;
+ lastLongitude = currentLongitude;
+ locationUpdateRequestDto.Latitude = currentLatitude;
+ locationUpdateRequestDto.Longitude = currentLongitude;
+ locationUpdateRequestDto.Imei = Preferences.Get("imeiNumber", null);
+ if (!string.IsNullOrEmpty(locationUpdateRequestDto.Imei))
+ {
+ await gmCabsDriverService.SendDriverLocationTablet(locationUpdateRequestDto);
+ }
+ else
+ {
+ await gmCabsDriverService.SendDriverLocation(token, locationUpdateRequestDto);
+ }
+
+ Preferences.Set("lastLat", currentLatitude);
+ Preferences.Set("lastLng", currentLongitude);
+ }
+ }
+
+ }
+ }
+ }
+
+}
diff --git a/GMCabsDriverAssistantSolution/Services/SQLiteDatabaseService.cs b/GMCabsDriverAssistantSolution/Services/SQLiteDatabaseService.cs
new file mode 100644
index 0000000..6204fbd
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Services/SQLiteDatabaseService.cs
@@ -0,0 +1,50 @@
+using GMCabsDriverAssistant.Models;
+using SQLite;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistant.Services
+{
+ public class SQLiteDatabaseService
+ {
+ private readonly SQLiteAsyncConnection _database;
+ public SQLiteDatabaseService(string dbPath)
+ {
+ _database = new SQLiteAsyncConnection(dbPath);
+ _database.CreateTableAsync();
+ }
+
+ public Task SaveBookingIdsAsync(IEnumerable bookingsId)
+ {
+ List availableBookings = new List();
+ AvailableBooking booking = new AvailableBooking();
+ foreach (var availableBookingId in bookingsId)
+ {
+ try
+ {
+ booking.BookingID = availableBookingId;
+ Console.WriteLine($" Booking Id : {booking.BookingID}");
+ availableBookings.Add(booking);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($" Exception Message : {ex.Message}");
+ }
+
+ }
+ return _database.InsertAllAsync(availableBookings);
+ }
+
+ public Task> GetBookingIdsAsync()
+ {
+ return _database.Table().ToListAsync();
+ }
+
+ public Task DeleteBookingIdsAsync(AvailableBooking bookingsId)
+ {
+ return _database.DeleteAsync(bookingsId);
+ }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Styles/PhoneLayoutStyle.xaml b/GMCabsDriverAssistantSolution/Styles/PhoneLayoutStyle.xaml
new file mode 100644
index 0000000..82f0988
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Styles/PhoneLayoutStyle.xaml
@@ -0,0 +1,40 @@
+
+
+ gmlogo.png
+ Call GM Cabs for assistance on
+
+ 20,10,20,10
+ 20,30,20,0
+ 0,0,0,0
+ 0,5,0,10
+ 0,-5,0,0
+ 0,0,0,0
+ 20,0,20,5
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Styles/PhoneLayoutStyle.xaml.cs b/GMCabsDriverAssistantSolution/Styles/PhoneLayoutStyle.xaml.cs
new file mode 100644
index 0000000..f255ebb
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Styles/PhoneLayoutStyle.xaml.cs
@@ -0,0 +1,11 @@
+namespace GMCabsDriverAssistantSolution.Styles;
+
+[XamlCompilation(XamlCompilationOptions.Compile)]
+public partial class PhoneLayoutStyle : ResourceDictionary
+{
+ public static PhoneLayoutStyle SharedInstance { get; } = new PhoneLayoutStyle();
+ public PhoneLayoutStyle()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/UserControl/TripInformationPage.xaml b/GMCabsDriverAssistantSolution/UserControl/TripInformationPage.xaml
new file mode 100644
index 0000000..c3fd69d
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/UserControl/TripInformationPage.xaml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/UserControl/TripInformationPage.xaml.cs b/GMCabsDriverAssistantSolution/UserControl/TripInformationPage.xaml.cs
new file mode 100644
index 0000000..2d9df73
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/UserControl/TripInformationPage.xaml.cs
@@ -0,0 +1,84 @@
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.UserControl.ViewModels;
+using GMCabsDriverAssistant.ViewModels;
+using GMCabsDriverAssistantSolution.Views;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+//using Xamarin.CommunityToolkit.Extensions;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+
+namespace GMCabsDriverAssistant.UserControl
+{
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class TripInformationPage : ContentView
+ {
+ [Browsable(true)]
+ [Category("Action")]
+ [Description("Invoked when user clicks button")]
+ public event BluetoothStatusChanged BluetoothStatusUpdated;
+
+ public string BluetoothConnectionStatusText
+ {
+ get => _viewModel.BluetoothConnectionStatusText;
+ }
+
+ private readonly TripInformationViewModel _viewModel;
+ public TripInformationPage()
+ {
+ InitializeComponent();
+ BindingContext = _viewModel = new TripInformationViewModel();
+ _viewModel.BluetoothStatusChanged += _viewModel_BluetoothStatusChanged;
+ }
+
+ private void _viewModel_BluetoothStatusChanged()
+ {
+ BluetoothStatusUpdated?.Invoke();
+ }
+
+ void OnDuressPressed(object sender, EventArgs args)
+ {
+ _viewModel.StartDriverDuress();
+ }
+ void OnDuressReleased(object sender, EventArgs args)
+ {
+ _viewModel.EndDriverDuress();
+ }
+
+ private void BtnPlot_Clicked(object sender, EventArgs e)
+ {
+ //Navigation.PushAsync(new AvailablePlotTabletPage());
+ }
+ private void OnMapIconTapped(object sender, EventArgs e)
+ {
+ var location = new Location(33.8688, 151.2093); // Replace with desired coordinates
+ var options = new MapLaunchOptions { Name = "Sydney" }; // Replace with desired location name
+ Map.OpenAsync(location, options);
+ }
+ private async void OnWazeIconTapped(object sender, EventArgs e)
+ {
+ // if App Url doesnt work use Browser Url => "https://waze.com/ul?q=" + latLng.latitude + "," + latLng.longitude + "&navigate=yes&zoom=17";
+ //string latitude = "33.8688";
+ //string longitude = "151.2093";
+ string wazeUri = "waze://";
+
+ try
+ {
+ // Launch Waze app
+ await Launcher.OpenAsync(wazeUri);
+ }
+ catch (Exception ex)
+ {
+ string errorMessage = "Waze is not installed in your device, Please install the app first";
+ //Navigation.ShowPopup(new ErrorPopup(errorMessage));
+ }
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/UserControl/ViewModels/TripInformationViewModel.cs b/GMCabsDriverAssistantSolution/UserControl/ViewModels/TripInformationViewModel.cs
new file mode 100644
index 0000000..7228bbe
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/UserControl/ViewModels/TripInformationViewModel.cs
@@ -0,0 +1,668 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using GMCabsDriverAssistant.ViewModels;
+using GMCabsDriverAssistantSolution.Views;
+//using Plugin.BluetoothLE;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Text;
+using System.Threading;
+//using Xamarin.CommunityToolkit.Extensions;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+using GMCabsDriverAssistantSolution.ViewModels;
+
+namespace GMCabsDriverAssistant.UserControl.ViewModels
+{
+ public delegate void BluetoothStatusChanged();
+
+ class TripInformationViewModel : BaseViewModel
+ {
+ [Browsable(true)]
+ [Category("Action")]
+ [Description("Invoked when user clicks button")]
+ public event BluetoothStatusChanged BluetoothStatusChanged;
+
+ #region Fields
+ private bool hasUnreadNotifications;
+ public int seconds = 0;
+ public string timerSeconds = "00:00:00";
+ public string pickUpAddress = "";
+ public string dropUpAddress = "";
+ private bool isBookingAvailable;
+ private string startTripButtonText;
+ private bool visibleTrip;
+ private string startSuburb;
+ private bool isStartTripButtonVisible;
+ private string pickUpDateTimeOrEndSuburb;
+
+ //private List Characteristics;
+ private bool foundDevice = false;
+ //private IAdapter adapter;
+
+ public bool MeterTripStarted;
+ private int lastMeterTripStatus = -1;
+ private string startTimeOrEndLocation;
+ private bool isOkButtonVisible = false;
+ public int autocloseOkSecond = 30;
+ Page _page;
+ private int mainStackLayoutMargin;
+ private int indicatorMargin;
+ private int logoMargin;
+ private bool isDummyButtonsVisible;
+ private int controlsMargin;
+ private int dummyButtonLayoutMargin;
+ private bool duressReleased;
+ private int duressSeconds;
+ private string duressButtonText;
+ private string bluetoothConnectionStatusText;
+ private string imageIcon;
+ private int topLayoutMargin;
+ private int rightLayoutMargin;
+ private bool isPlotButtonVisible;
+ #endregion
+
+ #region Properties
+ public Command OnStartEndTripClick { get; }
+
+ MeterTrip meterTrip = new MeterTrip();
+ public ObservableCollection Bookings { get; }
+ public Command BookingTapped { get; }
+ public double CurrentLat { get; set; }
+ public double CurrentLng { get; set; }
+ public Location CurrentLocation { get; set; }
+ public Command onStartTripClick { get; }
+ public Command OnOkButtonClick { get; }
+ public string StartTripButtonText
+ {
+ get => startTripButtonText;
+ set => SetProperty(ref startTripButtonText, value);
+ }
+ public bool HasUnreadNotifications
+ {
+ get => hasUnreadNotifications;
+ set => SetProperty(ref hasUnreadNotifications, value);
+ }
+
+ public string TimerSeconds
+ {
+ get => timerSeconds;
+ set => SetProperty(ref timerSeconds, value);
+ }
+ public string PickUpAddress
+ {
+ get => pickUpAddress;
+ set
+ {
+ SetProperty(ref pickUpAddress, value);
+ }
+ }
+ public string DropUpAddress
+ {
+ get => dropUpAddress;
+ set
+ {
+ SetProperty(ref dropUpAddress, value);
+ }
+ }
+ public bool IsBookingAvailable
+ {
+ get => isBookingAvailable;
+ set => SetProperty(ref isBookingAvailable, value);
+ }
+
+ public bool VisibleTrip
+ {
+ get => visibleTrip;
+ set => SetProperty(ref visibleTrip, value);
+ }
+ public string StartSuburb
+ {
+ get => startSuburb;
+ set
+ {
+ SetProperty(ref startSuburb, value);
+ }
+ }
+ public bool IsStartTripButtonVisible
+ {
+ get => isStartTripButtonVisible;
+ set => SetProperty(ref isStartTripButtonVisible, value);
+ }
+ public string PickUpDateTimeOrEndSuburb
+ {
+ get => pickUpDateTimeOrEndSuburb;
+ set => SetProperty(ref pickUpDateTimeOrEndSuburb, value);
+ }
+ public Thickness MainStackLayoutMargin
+ {
+ get { return new Thickness(mainStackLayoutMargin, 0, mainStackLayoutMargin, 20); }
+ }
+ public Thickness IndicatorMargin
+ {
+ get { return new Thickness(0, indicatorMargin, 0, 0); }
+ }
+ public Thickness LogoMargin
+ {
+#if DEBUG
+ get { return new Thickness(0, logoMargin, 0, 0); }
+#else
+ get { return new Thickness(logoMargin, 0 , 0, 0); }
+#endif
+ }
+ public Thickness ImageLayoutMargin
+ {
+#if DEBUG
+ get { return new Thickness(0, topLayoutMargin, rightLayoutMargin, 0); }
+#else
+ get { return new Thickness(0, topLayoutMargin, rightLayoutMargin, 0); }
+#endif
+ }
+ public Thickness ControlsMargin
+ {
+ get { return new Thickness(0, controlsMargin, 0, 0); }
+ }
+ public Thickness DummyButtonLayoutMargin
+ {
+ get { return new Thickness(0, dummyButtonLayoutMargin, 0, 0); }
+ }
+ public bool IsDummyButtonsVisible
+ {
+ get => isDummyButtonsVisible;
+ set
+ {
+ SetProperty(ref isDummyButtonsVisible, value);
+ }
+ }
+ public Command onCancelTripClick { get; }
+ public Command OnMeterStartTripClick { get; }
+ public Command OnMeterEndTripClick { get; }
+
+
+ public string StartTimeOrEndLocation
+ {
+ get => startTimeOrEndLocation;
+ set => SetProperty(ref startTimeOrEndLocation, value);
+ }
+ public bool IsOkButtonVisible
+ {
+ get => isOkButtonVisible;
+ set => SetProperty(ref isOkButtonVisible, value);
+ }
+
+ public string BluetoothConnectionStatusText
+ {
+ get => bluetoothConnectionStatusText;
+ set
+ {
+ SetProperty(ref bluetoothConnectionStatusText, value);
+ BluetoothStatusChanged?.Invoke();
+ }
+ }
+ public string DuressButtonText
+ {
+ get => duressButtonText;
+ set
+ {
+ SetProperty(ref duressButtonText, value);
+ }
+ }
+ public string ImageIcon
+ {
+ get => imageIcon;
+ set
+ {
+ SetProperty(ref imageIcon, value);
+ }
+ }
+ public bool IsPlotButtonVisible
+ {
+ get => isPlotButtonVisible;
+ set => SetProperty(ref isPlotButtonVisible, value);
+ }
+ #endregion
+
+ #region Constructor
+ public TripInformationViewModel()
+ {
+ ContinuouslyShowAllPropertiesStatus();
+ ShowStartTimerDuration(DispatchAppComponentService.isTripStarted);
+ CountEndTripDuration(DispatchAppComponentService.isTripEndeded);
+ lastMeterTripStatus = Preferences.Get("MeterTripStatus", 0);
+ OnOkButtonClick = new Command(OnOkClick);
+ OnStartEndTripClick = new Command(OnStartEndTripButtonClick);
+ OnMeterStartTripClick = new Command(CallMeterStartTrip);
+ OnMeterEndTripClick = new Command(MeterEndTrip);
+ DuressButtonText = "!";
+
+ CheckForConnectedMeter();
+
+#if DEBUG
+ mainStackLayoutMargin = 30;
+ indicatorMargin = 5;
+ logoMargin = 20;
+ IsDummyButtonsVisible = true;
+ controlsMargin = 20;
+ dummyButtonLayoutMargin = 10;
+ topLayoutMargin = -5;
+ rightLayoutMargin = -15;
+#else
+ mainStackLayoutMargin = 30;
+ indicatorMargin = 5;
+ logoMargin = 20;
+ IsDummyButtonsVisible = true;
+ controlsMargin = 20;
+ dummyButtonLayoutMargin = 10;
+ topLayoutMargin = -5;
+ rightLayoutMargin = -15;
+#endif
+ }
+
+ #endregion
+
+ #region Methods
+ private void OnStartEndTripButtonClick(object obj)
+ {
+ ManageDriverTrip(false);
+ }
+ private void OnOkClick()
+ {
+ DispatchAppComponentService.OnOkClick();
+ DispatchAppComponentService.isPlotButtonVisible = true;
+ ShowAllPropertiesStatus();
+ }
+ private void MeterStartTrip()
+ {
+ // setting MeterTripStarted only here to ensure a manual trip does not get mistaken for a meter trip
+ if (!MeterTripStarted)
+ {
+ StartTripButtonText = DispatchAppComponentService.MeterStartTrip();
+ ManageDriverTrip(true);
+ }
+ }
+ private void MeterEndTrip()
+ {
+ if (MeterTripStarted)
+ {
+ StartTripButtonText = DispatchAppComponentService.MeterEndTrip();
+ ManageDriverTrip(true);
+ }
+ }
+ public void StartDriverDuress()
+ {
+ duressReleased = false;
+ duressSeconds = 0;
+ bool hasVibrated = false;
+ Device.StartTimer(TimeSpan.FromSeconds(1), () =>
+ {
+ duressSeconds++;
+ if (duressSeconds > 2)
+ {
+ if (!hasVibrated)
+ {
+ hasVibrated = true;
+ Vibration.Vibrate(TimeSpan.FromSeconds(1));
+ }
+ }
+
+ if (duressReleased)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ });
+ }
+ public async void EndDriverDuress()
+ {
+ duressReleased = true;
+ Vibration.Cancel();
+ if (duressSeconds > 2)
+ {
+ var token = Preferences.Get(SecureStorageData.Token,"");
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+
+ var currentLocation = Geolocation.GetLastKnownLocationAsync();
+
+ double currentLat = 0;
+ double currentLng = 0;
+ if (currentLocation != null && currentLocation.Result != null)
+ {
+ currentLat = currentLocation.Result.Latitude;
+ currentLng = currentLocation.Result.Longitude;
+ }
+
+ await gmCabsDriverService.DriverDistress(token, currentLat, currentLng);
+
+ DuressButtonText = "...";
+ await System.Threading.Tasks.Task.Delay(2000);
+ DuressButtonText = "!";
+ }
+ }
+ private void ShowStartTimerDuration(bool isTripStarted)
+ {
+ seconds = DispatchAppComponentService.seconds;
+ if (isTripStarted)
+ {
+ Device.StartTimer(TimeSpan.FromSeconds(1), () =>
+ {
+ var meterRunningStatus = Preferences.Get("MeterRunningStatus", "");
+ if (meterRunningStatus == "Running")
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ ++seconds;
+ DispatchAppComponentService.StartTrip(seconds);
+ TimerSeconds = DispatchAppComponentService.timerSeconds;
+ DispatchAppComponentService.seconds = seconds;
+ });
+ }
+ if (meterRunningStatus == "Running")
+ return true;
+ else
+ return false;
+ });
+
+ }
+ }
+ private void CountEndTripDuration(bool isTripEnded)
+ {
+ autocloseOkSecond = DispatchAppComponentService.autocloseOkSecond;
+ if (isTripEnded)
+ {
+ Device.StartTimer(TimeSpan.FromSeconds(1), () =>
+ {
+ var meterRunningStatus = Preferences.Get("MeterRunningStatus", "");
+ if (meterRunningStatus == "Stopped")
+ {
+ if (autocloseOkSecond == 0)
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ OnOkClick();
+ });
+ }
+ else
+ {
+ --autocloseOkSecond;
+ DispatchAppComponentService.autocloseOkSecond = autocloseOkSecond;
+ }
+ }
+ if (meterRunningStatus == "Stopped")
+ return true;
+ else
+ return false;
+ });
+ }
+ }
+ private void ShowAllPropertiesStatus()
+ {
+ ImageIcon = DispatchAppComponentService.imageIcon;
+ IsStartTripButtonVisible = DispatchAppComponentService.isStartTripButtonVisible;
+ IsPlotButtonVisible = DispatchAppComponentService.isPlotButtonVisible;
+ StartTripButtonText = DispatchAppComponentService.startTripButtonText;
+ MeterTripStarted = DispatchAppComponentService.meterTripStarted;
+ VisibleTrip = DispatchAppComponentService.visibleTrip;
+ StartSuburb = DispatchAppComponentService.startSuburb;
+ PickUpDateTimeOrEndSuburb = DispatchAppComponentService.pickUpDateTimeOrEndSuburb;
+ StartTimeOrEndLocation = DispatchAppComponentService.startTimeOrEndLocation;
+ IsOkButtonVisible = DispatchAppComponentService.isOkButtonVisible;
+ TimerSeconds = DispatchAppComponentService.timerSeconds;
+ }
+ private void ContinuouslyShowAllPropertiesStatus()
+ {
+
+ Device.StartTimer(TimeSpan.FromSeconds(1), () =>
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ ShowAllPropertiesStatus();
+ });
+ return true;
+ });
+ }
+ public void SetTripStartEndButtonPosition()
+ {
+ DispatchAppComponentService.isPlotButtonVisible= false;
+ ShowAllPropertiesStatus();
+ }
+ #endregion
+
+ #region Trip Handling
+ private void ManageDriverTrip(bool fromMeter)
+ {
+ if (StartTripButtonText.Equals("START TRIP"))
+ {
+ DispatchAppComponentService.isTripStarted = true;
+ DispatchAppComponentService.isTripEndeded = false;
+ DispatchAppComponentService.ManageDriverTrip(fromMeter);
+ StartTimeOrEndLocation = DispatchAppComponentService.startTimeOrEndLocation;
+ StartTrip(fromMeter);
+ TimerSeconds = DispatchAppComponentService.timerSeconds;
+ DispatchAppComponentService.seconds = seconds = 0;
+ ShowStartTimerDuration(DispatchAppComponentService.isTripStarted);
+ DispatchAppComponentService.isPlotButtonVisible = false;
+ }
+ else if (StartTripButtonText.Equals("DROP OFF"))
+ {
+ DispatchAppComponentService.isTripStarted = false;
+ DispatchAppComponentService.isTripEndeded = true;
+ DispatchAppComponentService.ManageDriverTrip(fromMeter);
+ StartTimeOrEndLocation = DispatchAppComponentService.startTimeOrEndLocation;
+ EndTrip(fromMeter);
+ IsOkButtonVisible = DispatchAppComponentService.isOkButtonVisible;
+ DispatchAppComponentService.autocloseOkSecond = autocloseOkSecond = 30;
+ CountEndTripDuration(DispatchAppComponentService.isTripEndeded);
+ }
+ }
+ private async void StartTrip(bool fromMeter)
+ {
+ DispatchAppComponentService.startSuburb = await DispatchAppComponentService.GetSuburbName(fromMeter, true);
+ MeterTripStarted = DispatchAppComponentService.meterTripStarted;
+ ImageIcon = DispatchAppComponentService.imageIcon;
+ VisibleTrip = DispatchAppComponentService.visibleTrip;
+ StartSuburb = DispatchAppComponentService.startSuburb;
+ PickUpDateTimeOrEndSuburb = DispatchAppComponentService.pickUpDateTimeOrEndSuburb;
+ StartTripButtonText = DispatchAppComponentService.startTripButtonText;
+ }
+ private async void EndTrip(bool fromMeter)
+ {
+ DispatchAppComponentService.pickUpDateTimeOrEndSuburb = await DispatchAppComponentService.GetSuburbName(fromMeter, false);
+ MeterTripStarted = DispatchAppComponentService.meterTripStarted;
+ PickUpDateTimeOrEndSuburb = DispatchAppComponentService.pickUpDateTimeOrEndSuburb;
+ ImageIcon = DispatchAppComponentService.imageIcon;
+ IsStartTripButtonVisible = DispatchAppComponentService.isStartTripButtonVisible;
+ }
+ private void CallMeterStartTrip()
+ {
+ DispatchAppComponentService.startTripButtonText = "START TRIP";
+ DispatchAppComponentService.meterTripStarted = false;
+ DispatchAppComponentService.isTripStarted = true;
+ DispatchAppComponentService.isTripEndeded = false;
+ DispatchAppComponentService.isOkButtonVisible = false;
+ DispatchAppComponentService.isStartTripButtonVisible = true;
+ DispatchAppComponentService.ManageDriverTrip(false);
+ StartTimeOrEndLocation = DispatchAppComponentService.startTimeOrEndLocation;
+ StartTrip(false);
+ TimerSeconds = DispatchAppComponentService.timerSeconds;
+ DispatchAppComponentService.seconds = seconds = 0;
+ ShowStartTimerDuration(DispatchAppComponentService.isTripStarted);
+ }
+ #endregion Trip Handling
+
+ #region Meter Handling
+
+ private void CheckForConnectedMeter()
+ {
+ // ConnectToMeter();
+ }
+ //private void ConnectToMeter()
+ //{
+ // adapter = CrossBleAdapter.Current;
+ // var status = adapter.Status.ToString();
+
+ // if (status.Contains("Off"))
+ // {
+ // bluetoothConnectionStatusText = "Bluetooth connection off...";
+ // }
+ // else
+ // {
+ // BluetoothConnectionStatusText = "Checking meter connection...";
+ // BluetoothConnectionStatusText = $"Adapter status {CrossBleAdapter.Current.Status.ToString()}";
+
+ // IDevice bondedDevice = null;
+
+
+
+ // CrossBleAdapter.Current.GetConnectedDevices().Subscribe(deviceResult =>
+ // {
+ // bondedDevice = deviceResult.GetEnumerator().Current;
+ // });
+ // if (bondedDevice != null && bondedDevice.Status == ConnectionStatus.Connected)
+ // {
+ // ListenForCharacteristic(bondedDevice);
+ // }
+ // else
+ // {
+ // CrossBleAdapter.Current.GetPairedDevices().Subscribe(devices =>
+ // {
+ // if (devices != null)
+ // {
+ // ConnectionConfig conConfig = new ConnectionConfig();
+ // conConfig.AutoConnect = true;
+
+ // BluetoothConnectionStatusText = $"Listening for paired device";
+
+ // foreach (var pairedDevice in devices)
+ // {
+ // pairedDevice.ConnectWait(conConfig).Subscribe(device =>
+ // {
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { BluetoothConnectionStatusText = $"{device.Status}"; });
+ // ListenForCharacteristic(pairedDevice);
+ // });
+ // }
+ // }
+ // });
+
+ // if (CrossBleAdapter.Current.IsScanning)
+ // {
+ // BluetoothConnectionStatusText = $"resuming scan";
+ // }
+ // else
+ // {
+ // BluetoothConnectionStatusText = $"Adapter status {CrossBleAdapter.Current.Status.ToString()} - Scanning";
+ // Characteristics = new List();
+ // var scanResult = CrossBleAdapter.Current.Scan().Subscribe(scResult => { CheckDevice(scResult); }, exception =>
+ // {
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { BluetoothConnectionStatusText = $"Error: {exception.Message}"; });
+ // });
+ // }
+ // }
+ // }
+ //}
+ //private void CheckDevice(IScanResult scanResult)
+ //{
+ // if (scanResult.Device.Name != null && scanResult.Device.Name.StartsWith("MTI_") && !foundDevice)
+ // {
+ // BluetoothConnectionStatusText = $"Meter found - {scanResult.Device.Name}";
+ // foundDevice = true;
+
+ // CrossBleAdapter.Current.StopScan();
+ // ConnectToDevice(scanResult.Device);
+ // }
+ //}
+ //private void ConnectToDevice(IDevice discoveredDevice)
+ //{
+ // ConnectionConfig conConfig = new ConnectionConfig();
+ // conConfig.AutoConnect = true;
+
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { BluetoothConnectionStatusText = $"Device Details - P:{discoveredDevice.PairingStatus.ToString()} - C:{discoveredDevice.IsConnected()}"; });
+
+ // if (discoveredDevice.IsConnected())
+ // {
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { BluetoothConnectionStatusText = $"Searching for GUIDs"; });
+ // ListenForCharacteristic(discoveredDevice);
+ // }
+ // else
+ // {
+ // if (discoveredDevice.PairingStatus == PairingStatus.NotPaired)
+ // {
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { BluetoothConnectionStatusText = $"Pairing"; });
+ // discoveredDevice.PairingRequest("191135");
+ // }
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { BluetoothConnectionStatusText = $"Connecting"; });
+ // discoveredDevice.ConnectWait(conConfig).Subscribe(device =>
+ // {
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { BluetoothConnectionStatusText = $"{device.Status}"; });
+ // ListenForCharacteristic(device);
+ // });
+ // }
+ //}
+ //private void ListenForCharacteristic(IDevice device)
+ //{
+ // bool subscribed = false;
+ // try
+ // {
+ // device.GetKnownCharacteristics(Guid.Parse("de201840-063f-11e5-be3e-0002a5d5c51b"), new Guid[] { Guid.Parse("de000180-063f-11e5-9e69-0002a5d5c503") }).Subscribe(characteristics =>
+ // {
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { BluetoothConnectionStatusText = $"Service Detected"; });
+ // if (characteristics != null)
+ // {
+ // characteristics.RegisterAndNotify().Subscribe(registerResult =>
+ // {
+ // // RegisterAndNotify seems to keep firing each time, there must be a better way
+ // // to do this only once, currently just setting a local flag.
+ // if (!subscribed)
+ // {
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
+ // {
+ // BluetoothConnectionStatusText = "Ready";
+ // });
+ // subscribed = true;
+ // characteristics.WhenNotificationReceived().Subscribe(notification => { CheckNotification(notification); });
+ // }
+ // });
+ // }
+ // });
+ // }
+ // catch(Exception ex)
+ // {
+
+ // }
+ //}
+ //private void CheckNotification(CharacteristicGattResult notification)
+ //{
+ // if (notification != null && notification.Data != null && notification.Characteristic != null && notification.Characteristic.Uuid.ToString() == "de000180-063f-11e5-9e69-0002a5d5c503")
+ // {
+ // string data = $"Date:{DateTime.Now.ToString("HH:mm:ss")}, Description:{notification.Characteristic.Uuid},Data:{BitConverter.ToString(notification.Data)}\n";
+ // Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
+ // {
+ // int tripStatus = 0;
+ // if (notification.Data[0] != 0) { tripStatus = 1; }
+ // if (lastMeterTripStatus != tripStatus)
+ // {
+ // lastMeterTripStatus = tripStatus;
+ // Preferences.Set("MeterTripStatus", tripStatus);
+ // if (tripStatus == 0)
+ // {
+ // MeterEndTrip();
+ // }
+ // else if (tripStatus == 1)
+ // {
+ // //MeterStartTrip();
+ // CallMeterStartTrip();
+ // }
+ // }
+ // });
+
+ // }
+ //}
+
+ #endregion Meter Handling
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Utils/Constant.cs b/GMCabsDriverAssistantSolution/Utils/Constant.cs
new file mode 100644
index 0000000..b7d6980
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Utils/Constant.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Utils
+{
+ public static class Constant
+ {
+ public const int DRIVERAPP = 3;
+ public const int DRIVER_STATUS_ON_TRIP = 3;
+ public const int DRIVER_STATUS_AVAILABLE = 2;
+ public static bool IS_NOT_REDIRCT_TO_HOME = true;
+ public const int TIMER_SECONDS = 15;
+ public const int TIMER_MINUTES = 15;
+ public const int SUCCESS_CODE = 200;
+ public const int UNAUTHORIZED_CODE = 401;
+ public const int BADREQUEST_CODE = 400;
+ public const string FROM_PERMISSION_PAGE = "PermissionPage";
+ public const string FROM_HOME_PAGE = "HomePage";
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Utils/ExtensionMethods.cs b/GMCabsDriverAssistantSolution/Utils/ExtensionMethods.cs
new file mode 100644
index 0000000..1f848a5
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Utils/ExtensionMethods.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+
+namespace GMCabsDriverAssistant.Utils
+{
+ public static class ExtensionMethods
+ {
+ public static int DecimalDigits(this decimal n)
+ {
+ return n.ToString(System.Globalization.CultureInfo.InvariantCulture)
+ .SkipWhile(c => c != '.')
+ .Skip(1)
+ .Count();
+ }
+ public static bool IsDeletion(this TextChangedEventArgs e)
+ {
+ return !string.IsNullOrEmpty(e.OldTextValue) && e.OldTextValue.Length > e.NewTextValue.Length;
+ }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Utils/ScreenOrientationUtil.cs b/GMCabsDriverAssistantSolution/Utils/ScreenOrientationUtil.cs
new file mode 100644
index 0000000..e6b07bd
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Utils/ScreenOrientationUtil.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+
+namespace GMCabsDriverAssistant.Utils
+{
+ public class ScreenOrientationUtil
+ {
+ public static double ScreenWidth = Application.Current.MainPage.Width;
+ public static double ScreenHeight = Application.Current.MainPage.Height;
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Utils/SecureStorageData.cs b/GMCabsDriverAssistantSolution/Utils/SecureStorageData.cs
new file mode 100644
index 0000000..4765e40
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Utils/SecureStorageData.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistant.Utils
+{
+ public class SecureStorageData
+ {
+ public const string Token = "Token";
+ public const string CanAcceptBookings = "CanAcceptBookings";
+ public const string CanUpdateLicence = "CanUpdateLicence";
+ public const string CanScanVouchers = "CanScanVouchers";
+ public const string InitLaunched = "InitLaunched";
+ public const string UnSeenBooking = "UnSeenBooking";
+ public const string DriverName = "DriverName";
+ public const string CanViewCoupons = "CanViewCoupons";
+ public const string CanViewSettings = "CanViewSettings";
+ public const string CanViewHome = "CanViewHome";
+ public const string CanViewJobHistory = "CanViewJobHistory";
+ public const string FirstSeenFutureBooking = "FirstSeenFutureBooking";
+ public const string IsLocationPermitted = "IsLocationPermitted";
+ public const string IsBatteryOptimizationDisabled = "IsBatteryOptimizationDisabled";
+ public static async Task GetSecureStorage(string keyName)
+ {
+ string value = null;
+ try
+ {
+ value = await SecureStorage.GetAsync(keyName);
+ }
+ catch (Exception)
+ {
+ }
+ finally
+ {
+ if (String.IsNullOrEmpty(value))
+ {
+ value = DefaultValue(keyName);
+ }
+ }
+ return value;
+ }
+ private static string DefaultValue(string keyName)
+ {
+ switch (keyName)
+ {
+ case Token:
+ return "";
+ case CanAcceptBookings:
+ return "False";
+ case CanUpdateLicence:
+ return "False";
+ case CanScanVouchers:
+ return "False";
+ default:
+ return "";
+ }
+ }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Utils/ShareConstant.cs b/GMCabsDriverAssistantSolution/Utils/ShareConstant.cs
new file mode 100644
index 0000000..4165832
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Utils/ShareConstant.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GMCabsDriverAssistant.Utils
+{
+ public class ShareConstant
+ {
+ public static bool IsInForeground { get; set; } = false;
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/AcceptedFutureBookingsViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/AcceptedFutureBookingsViewModel.cs
new file mode 100644
index 0000000..502cd07
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/AcceptedFutureBookingsViewModel.cs
@@ -0,0 +1,126 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistantSolution.Models.Rydo;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ public class AcceptedFutureBookingsViewModel : BaseViewModel
+ {
+ #region Fields
+ private string emptyViewMessage;
+
+ private string startSuburb;
+
+ private string endSuburb;
+
+ private float distance;
+ //private string formattedDistance;
+
+ private bool isFutureBooking;
+
+ private BookingDto _selectedBooking;
+ #endregion
+
+ #region Properties
+ public string EmptyViewMessage
+ {
+ get => emptyViewMessage;
+ set => SetProperty(ref emptyViewMessage, value);
+ }
+ public string StartSuburb
+ {
+ get => startSuburb;
+ set => SetProperty(ref startSuburb, value);
+ }
+
+ public string EndSuburb
+ {
+ get => endSuburb;
+ set => SetProperty(ref endSuburb, value);
+ }
+
+ public float Distance
+ {
+ get => distance;
+ set => SetProperty(ref distance, value);
+ }
+
+ public bool IsFutureBooking
+ {
+ get => isFutureBooking;
+ set => SetProperty(ref isFutureBooking, value);
+ }
+
+ public BookingDto SelectedBooking
+ {
+ get => _selectedBooking;
+ set
+ {
+ SetProperty(ref _selectedBooking, value);
+ OnFutureBookingSelected(value);
+ }
+ }
+
+ public ObservableCollection FutureBookings { get; }
+ public Command BookingTapped { get; }
+ public Command OnRefreshClicked { get; }
+ #endregion
+
+ #region Constructor
+ public AcceptedFutureBookingsViewModel()
+ {
+ Title = "Accepted Bookings";
+ FutureBookings = new ObservableCollection();
+ OnRefreshClicked = new Command(async () => { await GetRydoFutureBookings(); });
+ BookingTapped = new Command(OnFutureBookingSelected);
+ }
+ #endregion
+
+ #region Methods
+ public void OnAppearing()
+ {
+ //IsBusy = true;
+ SelectedBooking = null;
+ Task.Run(async () =>
+ {
+ await GetRydoFutureBookings();
+ });
+ }
+
+ private async Task GetRydoFutureBookings()
+ {
+ EmptyViewMessage = "Loading Future Bookings...";
+ string rydoAccessToken = Preferences.Get(EftposLoginResponse.RYDO_ACCESS_TOKEN, "");
+ Guid driverId = Guid.Parse(Preferences.Get(LoginResponseDto.USER_CODE, ""));
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ FutureBookings.Clear();
+ var bookings = await gmCabsDriverService.GetAcceptedFutureBookings(rydoAccessToken, driverId);
+ var futureBookings = bookings.Where(b => b.FutureBooking == true);
+ if (futureBookings.Count() > 0)
+ {
+ foreach (BookingDto booking in futureBookings)
+ {
+ FutureBookings.Add(booking);
+ }
+ }
+ else
+ {
+ EmptyViewMessage = "No Future Bookings available";
+ }
+ }
+
+ async void OnFutureBookingSelected(BookingDto booking)
+ {
+ if (booking == null) return;
+
+ // await Shell.Current.GoToAsync($"{nameof(AcceptedFutureBookingDetailPage)}?{nameof(AcceptedFutureBookingDetailViewModel.BookingId)}={booking.BookingId:N}");
+ }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/AdminPasswordViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/AdminPasswordViewModel.cs
new file mode 100644
index 0000000..b94ea25
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/AdminPasswordViewModel.cs
@@ -0,0 +1,85 @@
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistantSolution.Views;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ class AdminPasswordViewModel : BaseViewModel
+ {
+ #region Fields
+ private string adminPassword;
+ private string message;
+ #endregion
+
+ #region Properties
+ public Command ContinueCommand { get; }
+ public Command BackCommand { get; }
+ public string AdminPassword
+ {
+ get => adminPassword;
+ set
+ {
+ SetProperty(ref adminPassword, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string ErrorMessage
+ {
+ get => message;
+ set => SetProperty(ref message, value);
+ }
+
+ #endregion
+
+ #region Constructor
+ public AdminPasswordViewModel()
+ {
+ ContinueCommand = new Command(OnContinueClicked);
+ BackCommand = new Command(OnBackClicked);
+ }
+ #endregion
+
+ #region Methods
+ [Obsolete]
+ private async void OnContinueClicked(object obj)
+ {
+ IsBusy = true;
+ ErrorMessage = "";
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ if (string.IsNullOrWhiteSpace(AdminPassword))
+ {
+ IsBusy = false;
+ ErrorMessage = "Admin Password required";
+ return;
+ }
+ var isValid = await gmCabsDriverService.ValidateAdminPassword(AdminPassword);
+ if (isValid)
+ {
+ IsBusy = false;
+ if (Device.RuntimePlatform == Device.Android && Device.Idiom == TargetIdiom.Tablet)
+ {
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}/{nameof(AdminPasswordPage)}/{nameof(ImeiNumberInstallPage)}");
+ }
+ else
+ {
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}/{nameof(AdminPasswordPage)}/{nameof(TaxiInstallPage)}");
+ }
+ }
+ else
+ {
+ IsBusy = false;
+ ErrorMessage = "Password is not match";
+ }
+ }
+ private async void OnBackClicked(object obj)
+ {
+ ErrorMessage = "";
+ await Shell.Current.GoToAsync("..");
+ }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/AppShellViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/AppShellViewModel.cs
new file mode 100644
index 0000000..ce6923e
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/AppShellViewModel.cs
@@ -0,0 +1,123 @@
+//using GMCabsDriverAssistantSolutions.Models;
+using GMCabsDriverAssistantSolution.Views;
+using System;
+using System.Collections.Generic;
+using System.Text;
+//using Xamarin.CommunityToolkit.Extensions;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+using GMCabsDriverAssistantSolution.ViewModels;
+using GMCabsDriverAssistant.Models;
+
+namespace GMCabsDriverAssistant.ViewModels
+{
+ public class AppShellViewModel : BaseViewModel
+ {
+ #region Fields
+ private string VERSION_NUMBER = VersionTracking.CurrentVersion;
+ private string driverName;
+ private string driverMobileNumber;
+ private bool isVisibleDrivingLicenceScan;
+ private bool isVisibleVoucherScan;
+ private bool isVisibleRydo;
+ private bool isVisibleCoupons = true;
+ private bool isVisibleSettings = true;
+ private bool isCanViewHome = true;
+ private bool isVisibleJobHistory = false;
+ private bool isVisibleMyAccount = false;
+ private bool isVisibleMyShifts = false;
+ #endregion
+
+ #region Properties
+ public bool IsVisibleDrivingLicenceScan
+ {
+ get => isVisibleDrivingLicenceScan;
+ set => SetProperty(ref isVisibleDrivingLicenceScan, value);
+ }
+ public bool IsVisibleVoucherScan
+ {
+ get => isVisibleVoucherScan;
+ set => SetProperty(ref isVisibleVoucherScan, value);
+ }
+ public bool IsVisibleRydo
+ {
+ get => isVisibleRydo;
+ set => SetProperty(ref isVisibleRydo, value);
+ }
+ public string VersionNumber
+ {
+ get => VERSION_NUMBER;
+ set => SetProperty(ref VERSION_NUMBER, value);
+ }
+ public string DriverName
+ {
+ get => driverName;
+ set => SetProperty(ref driverName, value);
+ }
+ public string DriverMobileNumber
+ {
+ get => driverMobileNumber;
+ set => SetProperty(ref driverMobileNumber, value);
+ }
+
+ public bool IsVisibleSettings
+ {
+ get => isVisibleSettings;
+ set => SetProperty(ref isVisibleSettings, value);
+ }
+ public bool IsVisibleCoupons
+ {
+ get => isVisibleCoupons;
+ set => SetProperty(ref isVisibleCoupons, value);
+ }
+ public bool IsCanViewHome
+ {
+ get => isCanViewHome;
+ set => SetProperty(ref isCanViewHome, value);
+ }
+ public bool IsVisibleJobHistory
+ {
+ get => isVisibleJobHistory;
+ set => SetProperty(ref isVisibleJobHistory, value);
+ }
+ public bool IsVisibleMyAccount
+ {
+ get => isVisibleMyAccount;
+ set => SetProperty(ref isVisibleMyAccount, value);
+ }
+ public bool IsVisibleMyShifts
+ {
+ get => isVisibleMyShifts;
+ set => SetProperty(ref isVisibleMyShifts, value);
+ }
+ public Command PrivacyPolicyClickCommand { get; }
+ Page _page;
+ #endregion
+
+ #region Constructor
+ public AppShellViewModel(Page page)
+ {
+ PrivacyPolicyClickCommand = new Command(OnPrivacyPolicyClicked);
+ MessagingCenter.Unsubscribe(this, "LoginSuccessful");
+ MessagingCenter.Subscribe(this, "LoginSuccessful", (sender, loginResponse) =>
+ {
+ DriverName = loginResponse.DriverName;
+ DriverMobileNumber = loginResponse.DriverMobileNumber;
+ IsVisibleDrivingLicenceScan = loginResponse.CanUpdateLicence;
+ IsVisibleVoucherScan = loginResponse.CanScanVouchers;
+ IsVisibleRydo = loginResponse.CanAcceptBookings;
+ });
+ _page = page;
+ }
+
+ #endregion
+
+ #region Methods
+ private void OnPrivacyPolicyClicked(object obj)
+ {
+ Shell.Current.FlyoutIsPresented = false;
+ // _page.Navigation.ShowPopup(new PrivacyPolicyDialogPage());
+ }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/BaseViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/BaseViewModel.cs
new file mode 100644
index 0000000..9765a7d
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/BaseViewModel.cs
@@ -0,0 +1,57 @@
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ public class BaseViewModel : INotifyPropertyChanged
+ {
+ #region Fields
+ private bool isBusy = false;
+ private string title = string.Empty;
+ #endregion
+
+ #region Properties
+ public bool IsBusy
+ {
+ get => isBusy;
+ set => SetProperty(ref isBusy, value);
+ }
+
+ public string Title
+ {
+ get => title;
+ set => SetProperty(ref title, value);
+ }
+ #endregion
+
+ protected bool SetProperty(ref T backingStore, T value,
+ [CallerMemberName] string propertyName = "",
+ Action onChanged = null)
+ {
+ if (EqualityComparer.Default.Equals(backingStore, value))
+ {
+ return false;
+ }
+
+ backingStore = value;
+ onChanged?.Invoke();
+ OnPropertyChanged(propertyName);
+ return true;
+ }
+
+ #region INotifyPropertyChanged
+ public event PropertyChangedEventHandler PropertyChanged;
+ protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
+ {
+ var changed = PropertyChanged;
+ if (changed == null)
+ {
+ return;
+ }
+
+ changed.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ #endregion
+ }
+
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/CouponHistoryViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/CouponHistoryViewModel.cs
new file mode 100644
index 0000000..b314349
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/CouponHistoryViewModel.cs
@@ -0,0 +1,83 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ public class CouponHistoryViewModel : BaseViewModel
+ {
+ #region Fields
+ private string loadingText = "Loading...";
+ private bool isLoading = true;
+ #endregion
+
+ #region Properties
+ public string LoadingText
+ {
+ get => loadingText;
+ set
+ {
+ SetProperty(ref loadingText, value);
+ }
+ }
+ public bool IsLoading
+ {
+ get => isLoading;
+ set
+ {
+ SetProperty(ref isLoading, value);
+ }
+ }
+ public ObservableCollection CouponsHistory { get; }
+ #endregion
+
+ #region Constructor
+ public CouponHistoryViewModel()
+ {
+ Title = "Coupon History";
+ CouponsHistory = new ObservableCollection();
+ GetCouponsHistory();
+ }
+ #endregion
+
+ #region Methods
+ private async void GetCouponsHistory()
+ {
+ string appToken = Preferences.Get(SecureStorageData.Token, "");
+ GMCabsDriverService gMCabsDriverService = new GMCabsDriverService();
+ CouponsHistory.Clear();
+ var coupons = await gMCabsDriverService.GetCouponsHistory(appToken);
+ if (coupons.Count > 0)
+ {
+ IsLoading = false; LoadingText = "";
+ }
+ else
+ {
+ IsLoading = true; LoadingText = "No coupons history available";
+ }
+ foreach (CouponHistoryDto coupon in coupons)
+ {
+ coupon.isRedemed = false;
+ if (coupon.RedeemedDate.HasValue)
+ {
+ coupon.CouponText = "Redeemed";
+ coupon.CouponBackgroundColor = "#2CC84E";
+ coupon.isRedemed = true;
+ }
+ else
+ {
+ coupon.CouponText = "EXPIRED";
+ coupon.CouponBackgroundColor = "#C82C2C";
+ }
+ CouponsHistory.Add(coupon);
+ }
+ }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/CouponsV2ViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/CouponsV2ViewModel.cs
new file mode 100644
index 0000000..ca03f72
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/CouponsV2ViewModel.cs
@@ -0,0 +1,236 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ public class CouponsV2ViewModel : BaseViewModel
+ {
+ #region Fields
+ Page page;
+ private string emptyViewMessage;
+ public ImageSource image;
+ public float amount;
+ public DateTime expiryDate;
+ private CouponDto _selectedCoupon;
+ private bool _hasCoupons = false;
+ private bool _hasEmptyMessage = false;
+
+ private bool _isNextButton = false;
+ private bool _isBackButton = false;
+ int couponPosition = 0;
+ int couponCount = 0;
+ #endregion
+
+ #region Properties
+ public string EmptyViewMessage
+ {
+ get => emptyViewMessage;
+ set => SetProperty(ref emptyViewMessage, value);
+ }
+ public ObservableCollection Coupons { get; }
+ public Command SyncCouponCommand { get; }
+
+ public ImageSource Image
+ {
+ get => image;
+ set => SetProperty(ref image, value);
+ }
+
+ public float Amount
+ {
+ get => amount;
+ set => SetProperty(ref amount, value);
+ }
+
+ public DateTime ExpiryDate
+ {
+ get => expiryDate;
+ set => SetProperty(ref expiryDate, value);
+ }
+
+ public CouponDto SelectedCoupon
+ {
+ get => _selectedCoupon;
+ set => SetProperty(ref _selectedCoupon, value);
+ }
+
+ public bool HasCoupons
+ {
+ get => _hasCoupons;
+ set => SetProperty(ref _hasCoupons, value);
+ }
+
+ public bool HasEmptyMessage
+ {
+ get => _hasEmptyMessage;
+ set => SetProperty(ref _hasEmptyMessage, value);
+ }
+
+ public bool IsNextButton
+ {
+ get => _isNextButton;
+ set => SetProperty(ref _isNextButton, value);
+ }
+
+ public bool IsBackButton
+ {
+ get => _isBackButton;
+ set => SetProperty(ref _isBackButton, value);
+ }
+
+ public Command NextCouponCommand { get; }
+ public Command BackCouponCommand { get; }
+ public Command RedemptionDetails { get; }
+
+ #endregion
+
+ #region Constructor
+ public CouponsV2ViewModel(Page page)
+ {
+ this.page = page;
+ Title = "Available Coupons";
+ SyncCouponCommand = new Command(async () => await GetCoupons());
+ BackCouponCommand = new Command(() => SelectCouponOption(true));
+ NextCouponCommand = new Command(() => SelectCouponOption(false));
+ RedemptionDetails = new Command(() => RedemptionDetailsDialog());
+ Coupons = new ObservableCollection();
+ HandleReceivedMessages();
+ }
+
+
+ #endregion
+
+ #region Methods
+ public void OnAppearing()
+ {
+ Task.Run(async () => await GetCoupons());
+ }
+ private async Task GetCoupons()
+ {
+ HasCoupons = false;
+ IsBackButton = false;
+ IsNextButton = false;
+ HasEmptyMessage = true;
+ EmptyViewMessage = "Loading Coupons...";
+ string appToken = Preferences.Get(SecureStorageData.Token, "");
+ GMCabsDriverService gMCabsDriverService = new GMCabsDriverService();
+
+ Coupons.Clear();
+ List coupons = await gMCabsDriverService.GetCoupons(appToken);
+ if (coupons != null && coupons.Count > 0)
+ {
+ couponPosition = 0;
+ couponCount = coupons.Count;
+ HasCoupons = true;
+ HasEmptyMessage = false;
+ if (couponCount == 1)
+ {
+ IsBackButton = false;
+ IsNextButton = false;
+ }
+ else
+ {
+ IsNextButton = true;
+ }
+ //foreach (CouponDto coupon in coupons)
+ //{
+ // QRCodeGenerator qrGenerator = new QRCodeGenerator();
+ // QRCodeData qrCodeData = qrGenerator.CreateQrCode(coupon.Id.ToString(), QRCodeGenerator.ECCLevel.Q);
+ // BitmapByteQRCode qrCode = new BitmapByteQRCode(qrCodeData);
+ // byte[] qrCodeAsBitmapByteArr = qrCode.GetGraphic(20);
+ // coupon.Image = ImageSource.FromStream(() => new MemoryStream(qrCodeAsBitmapByteArr));
+ // Coupons.Add(coupon);
+ //}
+ //Console.WriteLine("Before Position :" + couponPosition);
+ //Image = Coupons[couponPosition].Image;
+ }
+ else
+ {
+ HasCoupons = false;
+ HasEmptyMessage = true;
+ EmptyViewMessage = "No Coupons available";
+ }
+ }
+ private void SelectCouponOption(bool isback)
+ {
+ if (isback)
+ {
+ couponPosition = couponPosition - 1;
+ if (couponPosition + 1 == 1 && couponCount > 1)
+ {
+ IsBackButton = false;
+ IsNextButton = true;
+ }
+ else
+ {
+ IsNextButton = true;
+ }
+
+ }
+ else
+ {
+ couponPosition = couponPosition + 1;
+ IsBackButton = true;
+ if (couponCount == couponPosition + 1 && couponCount > 1)
+ {
+ IsNextButton = false;
+ }
+ }
+
+ SelectedCoupon = Coupons[couponPosition];
+ Image = Coupons[couponPosition].Image;
+ }
+
+ [Obsolete]
+ void HandleReceivedMessages()
+ {
+ MessagingCenter.Unsubscribe(this, nameof(App));
+ MessagingCenter.Subscribe(this, nameof(App), (sender, couponDto) => {
+ Device.BeginInvokeOnMainThread(() => {
+ CouponDto redeemedcoupon = new CouponDto
+ {
+ Id = couponDto.Id,
+ Status = couponDto.Status
+ };
+ List copyCoupons = new List(Coupons);
+ Coupons.Clear();
+ foreach (var item in copyCoupons)
+ {
+ if (item.Id == redeemedcoupon.Id)
+ {
+ item.Image = ImageSource.FromFile("scanned.png");
+ }
+ Coupons.Add(item);
+ }
+ Console.WriteLine("After Position :" + couponPosition);
+ SelectedCoupon = Coupons[couponPosition];
+ Image = Coupons[couponPosition].Image;
+ });
+ });
+
+ }
+
+ private async void RedemptionDetailsDialog()
+ {
+ int issuedFromLocationID = Coupons[couponPosition].IssuedLocationID;
+ string appToken = Preferences.Get(SecureStorageData.Token, "");
+ GMCabsDriverService gMCabsDriverService = new GMCabsDriverService();
+ LocationVoucherDto locationVoucher = await gMCabsDriverService.GetLocationVoucherByLocationID(appToken, issuedFromLocationID);
+ if (locationVoucher != null)
+ {
+ string voucherOfferText = locationVoucher.VoucherOfferText.Replace("", "").Replace("
", "");
+ await page.DisplayAlert("Redemption Details", voucherOfferText, "Ok");
+ }
+ }
+
+
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/CouponsViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/CouponsViewModel.cs
new file mode 100644
index 0000000..711d092
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/CouponsViewModel.cs
@@ -0,0 +1,107 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ public class CouponsViewModel : BaseViewModel
+ {
+ #region Fields
+ private string emptyViewMessage;
+ #endregion
+
+ #region Properties
+
+
+ public string EmptyViewMessage
+ {
+ get => emptyViewMessage;
+ set => SetProperty(ref emptyViewMessage, value);
+ }
+
+ public ObservableCollection Coupons { get; }
+ public Command SyncCouponCommand { get; }
+ #endregion
+
+ #region Constructor
+ [Obsolete]
+ public CouponsViewModel()
+ {
+ Title = "Coupons";
+ SyncCouponCommand = new Command(async () => await GetCoupons());
+ Coupons = new ObservableCollection();
+ HandleReceivedMessages();
+ }
+ #endregion
+
+ #region Methods
+ public void OnAppearing()
+ {
+ Task.Run(async () => await GetCoupons());
+ }
+ private async Task GetCoupons()
+ {
+ EmptyViewMessage = "Loading Coupons...";
+ string appToken = Preferences.Get(SecureStorageData.Token, "");
+ GMCabsDriverService gMCabsDriverService = new GMCabsDriverService();
+
+ Coupons.Clear();
+ List coupons = await gMCabsDriverService.GetCoupons(appToken);
+ if (coupons != null && coupons.Count > 0)
+ {
+ //foreach (CouponDto coupon in coupons)
+ //{
+ // QRCodeGenerator qrGenerator = new QRCodeGenerator();
+ // QRCodeData qrCodeData = qrGenerator.CreateQrCode(coupon.Id.ToString(), QRCodeGenerator.ECCLevel.Q);
+ // BitmapByteQRCode qrCode = new BitmapByteQRCode(qrCodeData);
+ // byte[] qrCodeAsBitmapByteArr = qrCode.GetGraphic(20);
+ // coupon.Image = ImageSource.FromStream(() => new MemoryStream(qrCodeAsBitmapByteArr));
+
+ // Coupons.Add(coupon);
+ //}
+ }
+ else
+ {
+ EmptyViewMessage = "No Coupons available";
+ }
+ }
+
+ [Obsolete]
+ void HandleReceivedMessages()
+ {
+ MessagingCenter.Unsubscribe(this, nameof(App));
+ MessagingCenter.Subscribe(this, nameof(App), (sender, couponDto) => {
+ Device.BeginInvokeOnMainThread(() => {
+ CouponDto redeemedcoupon = new CouponDto
+ {
+ Id = couponDto.Id,
+ Status = couponDto.Status
+ };
+ List copyCoupons = new List(Coupons);
+ Coupons.Clear();
+ foreach (var item in copyCoupons)
+ {
+ if (item.Id == redeemedcoupon.Id)
+ {
+ item.Image = ImageSource.FromFile("scanned.png");
+ }
+ Coupons.Add(item);
+ }
+
+
+
+ });
+
+
+ });
+
+ }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/HomeViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/HomeViewModel.cs
new file mode 100644
index 0000000..7b3a122
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/HomeViewModel.cs
@@ -0,0 +1,484 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+//using Android.Content.PM;
+using GMCabsDriverAssistant;
+using GMCabsDriverAssistant.Messages;
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using GMCabsDriverAssistantSolution.Models.Rydo;
+using GMCabsDriverAssistantSolution.Views;
+using Microsoft.Maui;
+using Microsoft.Maui.Controls;
+using Sentry;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ public class HomeViewModel : BaseViewModel
+ {
+ #region Constants
+
+ private const int LOCATION_CHECK_TIME_INTERVAL = 10;
+ private const int LOCATION_READ_TIMEOUT = 10;
+ private const double LOCATION_DISTANCE = 0.01;
+
+ private double lastLatitude = 0.00, lastLongitude = 0.00;
+
+ #endregion Constants
+
+ #region Fields
+ public int seconds = 180;
+ public string timerSeconds = "3:00";
+ public string pickUpAddress = "";
+ public string dropUpAddress = "";
+ private bool isVisibleAcceptBookingView = false;
+ private readonly LoginResponseDto loginResponseDto = new LoginResponseDto();
+ private bool hasUnreadNotifications;
+ private bool isBookingAvailable;
+ private CancellationTokenSource cts;
+ private List receivedBookingIDs;
+ public List availableBookingIDs = new List();
+ public bool isLocationPermitted;
+ #endregion
+
+ #region Properties
+ public bool IsVisibleAcceptBookingView
+ {
+ get => isVisibleAcceptBookingView;
+ set
+ {
+ SetProperty(ref isVisibleAcceptBookingView, value);
+ CustomTimer();
+ }
+ }
+ public string PickUpAddress
+ {
+ get => pickUpAddress;
+ set
+ {
+ SetProperty(ref pickUpAddress, value);
+ }
+ }
+ public string DropUpAddress
+ {
+ get => dropUpAddress;
+ set
+ {
+ SetProperty(ref dropUpAddress, value);
+ }
+ }
+ public bool HasUnreadNotifications
+ {
+ get => hasUnreadNotifications;
+ set => SetProperty(ref hasUnreadNotifications, value);
+ }
+ public bool IsBookingAvailable
+ {
+ get => isBookingAvailable;
+ set => SetProperty(ref isBookingAvailable, value);
+ }
+ public string TimerSeconds
+ {
+ get => timerSeconds;
+ set => SetProperty(ref timerSeconds, value);
+ }
+ public Location CurrentLocation { get; set; }
+ readonly ILocationConsent locationConsent;
+ #endregion
+
+ #region Constructor
+
+ public HomeViewModel()
+ {
+ Title = "Home";
+ GetToken();
+ locationConsent = DependencyService.Get();
+ //HandleReceivedMessages();
+ //locationConsent.GetLocationConsent();
+
+ }
+ #endregion
+
+ #region Methods
+ [Obsolete]
+ public async Task OnAppearing()
+ {
+ isLocationPermitted = Preferences.Get(SecureStorageData.IsLocationPermitted, false);
+ //SendForegroundAlarmManager();
+ if (Device.RuntimePlatform != Device.iOS)
+ {
+ if (isLocationPermitted)
+ {
+ if (!DependencyService.Resolve().IsForeGroundServiceRunning())
+ {
+ Preferences.Set("isForeground", "YES");
+ DependencyService.Resolve().StartMyForegroundService();
+ }
+ }
+ }
+ else
+ {
+ var message = new StartServiceMessage();
+ MessagingCenter.Send(message, "ServiceStarted");
+ }
+ UpdateDriverAppSelectedPermissions();
+ GetUnreadNotificationCount();
+ await GetCurrentLocation();
+ await GetBookingAvailable();
+ CheckBookingAndNotificationAvailibility();
+ }
+
+ public async void GetToken()
+ {
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ loginResponseDto.Token = Guid.Parse(token);
+ }
+
+ [Obsolete]
+ public async void GetUnreadNotificationCount()
+ {
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ var unreadNotification = await gmCabsDriverService.GetUnreadNotificationCount(token);
+ if (unreadNotification != null)
+ {
+ if (unreadNotification.StatusCode == Constant.UNAUTHORIZED_CODE)
+ {
+ GoToLoginPage();
+ }
+ else
+ {
+ if (unreadNotification.UnreadNotificationCount > 0)
+ {
+ HasUnreadNotifications = true;
+ }
+ else
+ {
+ HasUnreadNotifications = false;
+ }
+ }
+
+ }
+
+ }
+
+ [Obsolete]
+ private void GoToLoginPage()
+ {
+ Device.BeginInvokeOnMainThread(async () =>
+ {
+
+ if (Device.RuntimePlatform != Device.iOS)
+ {
+ Preferences.Set("isForeground", "NO");
+ DependencyService.Resolve().StopMyForegroundService();
+ }
+ else if (Device.RuntimePlatform == Device.iOS)
+ {
+ var message = new StopServiceMessage();
+ MessagingCenter.Send(message, "ServiceStopped");
+ }
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ Debug.WriteLine("TOKEN-------------", token);
+ var lastLatitude = Convert.ToDouble(Preferences.Get("lastLat", "0"));
+ var lastLongitude = Convert.ToDouble(Preferences.Get("lastLng", "0"));
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ await gmCabsDriverService.LogoutDriverApp(token, lastLatitude, lastLongitude);
+ SecureStorage.RemoveAll();
+ Preferences.Clear();
+ SentrySdk.ConfigureScope(scope =>
+ {
+ scope.User = null;
+ });
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}");
+ });
+ }
+
+
+ private async Task GetBookingAvailable()
+ {
+ var canAcceptBookings = Preferences.Get(SecureStorageData.CanAcceptBookings, false);
+
+ if (!canAcceptBookings || CurrentLocation == null)
+ {
+ return;
+ }
+
+ var accessToken = Preferences.Get(EftposLoginResponse.RYDO_ACCESS_TOKEN, "");
+ var driverId = Preferences.Get(LoginResponseDto.USER_CODE, "");
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+
+ availableBookingIDs = await gmCabsDriverService.GetBookingAvailableCount(accessToken, driverId, CurrentLocation.Latitude, CurrentLocation.Longitude);
+ var cachedeBookingIds = await App.Database.GetBookingIdsAsync();
+
+ if (availableBookingIDs != null && availableBookingIDs.Count > 0)
+ {
+ bool areNewBookings = false;
+ //IEnumerable newBookings = null;
+ List cachedBookings = new List();
+
+ if (cachedeBookingIds.Count == 0)
+ {
+ await App.Database.SaveBookingIdsAsync(availableBookingIDs.Select(g => g.ToString()));
+ areNewBookings = true;
+ }
+ else
+ {
+ foreach (var availableBooking in cachedeBookingIds)
+ {
+ cachedBookings.Add(Guid.Parse(availableBooking.BookingID));
+ }
+ int cachedBookingsCount = cachedBookings.Count();
+ var newBookings = availableBookingIDs.Except(cachedBookings);
+ if (newBookings.Count() > 0)
+ {
+ Console.WriteLine($"New Bookings Count: {newBookings.Count()}");
+ await App.Database.SaveBookingIdsAsync(newBookings.Select(g => g.ToString()));
+ areNewBookings = true;
+ }
+ }
+
+ IsBookingAvailable = true;
+ //if (Device.RuntimePlatform == Device.iOS)
+ //{
+ // if (areNewBookings)
+ // {
+ // var player = CrossSimpleAudioPlayer.Current;
+ // player.Load("newbooking.wav");
+ // player.Play();
+ // }
+ //}
+ }
+ else
+ {
+ IsBookingAvailable = false;
+ if (cachedeBookingIds.Count != 0)
+ {
+ foreach (var availableBooking in cachedeBookingIds)
+ {
+ await App.Database.DeleteBookingIdsAsync(availableBooking);
+ }
+
+ }
+ }
+ }
+
+ async Task GetCurrentLocation()
+ {
+ try
+ {
+ if (isLocationPermitted)
+ {
+ CurrentLocation = await Geolocation.GetLastKnownLocationAsync();
+
+ if (CurrentLocation == null)
+ {
+ var request = new GeolocationRequest(GeolocationAccuracy.Medium, TimeSpan.FromSeconds(LOCATION_READ_TIMEOUT));
+ cts = new CancellationTokenSource();
+ // CurrentLocation = await Geolocation.GetLocationAsync(request, cts.Token);
+ CurrentLocation = await Geolocation.GetLocationAsync(new GeolocationRequest
+ {
+ Timeout = TimeSpan.FromSeconds(50),
+ DesiredAccuracy = GeolocationAccuracy.Medium
+ });
+
+ }
+ }
+ }
+ catch (FeatureNotSupportedException fnsEx)
+ {
+ // Handle not supported on device exception
+ }
+ catch (FeatureNotEnabledException fneEx)
+ {
+ // Handle not enabled on device exception
+ }
+ catch (PermissionException pEx)
+ {
+ // Handle permission exception
+ }
+ catch (Exception ex)
+ {
+ // Unable to get location
+ }
+ }
+
+ public void OnDisappearing()
+ {
+ if (cts != null && !cts.IsCancellationRequested)
+ cts.Cancel();
+ }
+
+ [Obsolete]
+ private void CustomTimer()
+ {
+ Device.StartTimer(TimeSpan.FromSeconds(1), () =>
+ {
+ if (!isVisibleAcceptBookingView)
+ {
+ return false;
+ }
+ if (seconds > 0)
+ {
+ --seconds;
+ TimerSeconds = seconds / 60 + ":" + (seconds % 60 <= 9 ? "0" + seconds % 60 : "" + seconds % 60);
+ return true;
+ }
+ else
+ {
+ IsVisibleAcceptBookingView = false;
+ return false;
+ }
+
+ });
+ }
+
+ void HandleReceivedMessages()
+ {
+ //MessagingCenter.Subscribe(this, "Location", message =>
+ //{
+ // Device.BeginInvokeOnMainThread(async () =>
+ // {
+ // Console.WriteLine(message.Latitude);
+ // Console.WriteLine(message.Longitude);
+
+ // var token = Preferences.Get(SecureStorageData.Token,"");
+ // if (token != null)
+ // {
+ // GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ // LocationUpdateRequestDto locationUpdateRequestDto = new LocationUpdateRequestDto();
+ // if (lastLatitude == 0.00 && lastLongitude == 0.00)
+ // {
+ // lastLatitude = message.Latitude;
+ // lastLongitude = message.Longitude;
+ // locationUpdateRequestDto.Latitude = message.Latitude;
+ // locationUpdateRequestDto.Longitude = message.Longitude;
+ // await gmCabsDriverService.SendDriverLocation(token, locationUpdateRequestDto);
+ // }
+ // else
+ // {
+ // Location lastLocation = new Location(lastLatitude, lastLongitude);
+ // Location currentLocation = new Location(message.Latitude, message.Longitude);
+ // double kilometers = Location.CalculateDistance(lastLocation, currentLocation, DistanceUnits.Kilometers);
+ // if (kilometers > LOCATION_DISTANCE)
+ // {
+ // lastLatitude = message.Latitude;
+ // lastLongitude = message.Longitude;
+ // locationUpdateRequestDto.Latitude = message.Latitude;
+ // locationUpdateRequestDto.Longitude = message.Longitude;
+ // await gmCabsDriverService.SendDriverLocation(token, locationUpdateRequestDto);
+ // }
+ // }
+ // Preferences.Set("lastLat", message.Latitude);
+ // Preferences.Set("lastLng", message.Longitude);
+ // }
+ // });
+ //});
+ MessagingCenter.Subscribe(this, "ServiceStopped", message =>
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ // UserMessage = "Location Service has been stopped!";
+ Console.WriteLine("Location Service has been stopped!");
+ });
+ });
+ MessagingCenter.Subscribe(this, "LocationError", message =>
+ {
+ Device.BeginInvokeOnMainThread(() =>
+ {
+ // UserMessage = "There was an error updating location!";
+ Console.WriteLine("There was an error updating location!");
+ });
+ });
+ }
+ private async Task GetBookingsWithOutNotificationSound()
+ {
+ var accessToken = Preferences.Get(EftposLoginResponse.RYDO_ACCESS_TOKEN, "");
+ var driverId = Preferences.Get(LoginResponseDto.USER_CODE, "");
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ availableBookingIDs = await gmCabsDriverService.GetBookingAvailableCount(accessToken, driverId, CurrentLocation.Latitude, CurrentLocation.Longitude);
+ if (availableBookingIDs.Count == 0)
+ {
+ IsBookingAvailable = false;
+ }
+ }
+
+ [Obsolete]
+ private void CheckBookingAndNotificationAvailibility()
+ {
+ Device.StartTimer(TimeSpan.FromSeconds(LOCATION_CHECK_TIME_INTERVAL), () =>
+ {
+ var isForeground = ShareConstant.IsInForeground;
+ Task.Run(async () =>
+ {
+ //GetUnreadNotificationCount(); //For avoiding duplicate call of UnreadCount API
+ await GetBookingsWithOutNotificationSound();
+ });
+ return isForeground;
+ });
+ }
+
+ [Obsolete]
+ private void SendForegroundAlarmManager()
+ {
+ Device.StartTimer(TimeSpan.FromMinutes(Constant.TIMER_MINUTES), () =>
+ {
+ var serviceRunningStatus = DependencyService.Resolve().IsForeGroundServiceRunning();
+ if (serviceRunningStatus)
+ {
+ DependencyService.Resolve().StartMyAlarmService();
+ }
+ return serviceRunningStatus;
+ });
+ }
+
+ [Obsolete]
+ public async Task UpdateLocation()
+ {
+ await GetCurrentLocation();
+ if (CurrentLocation != null)
+ {
+ var response = await UpdateLocationOnServer(CurrentLocation.Latitude, CurrentLocation.Longitude);
+ if (response == Constant.SUCCESS_CODE)
+ {
+ await GetBookingAvailable();
+ }
+ else if (response == Constant.UNAUTHORIZED_CODE)
+ {
+ GoToLoginPage();
+ }
+ }
+ }
+
+ private async Task UpdateLocationOnServer(double currentLatitude, double currentLongitude)
+ {
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ LocationUpdateRequestDto locationUpdateRequestDto = new LocationUpdateRequestDto();
+ locationUpdateRequestDto.Latitude = currentLatitude;
+ locationUpdateRequestDto.Longitude = currentLongitude;
+ var responce = await gmCabsDriverService.SendDriverLocation(token, locationUpdateRequestDto);
+ Preferences.Set("lastLat", currentLatitude);
+ Preferences.Set("lastLng", currentLongitude);
+ return responce;
+ }
+
+ private async void UpdateDriverAppSelectedPermissions()
+ {
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ var isLocationPermitted = Preferences.Get(SecureStorageData.IsLocationPermitted, false);
+ var isBatteryOptimizationDisabled = Preferences.Get(SecureStorageData.IsBatteryOptimizationDisabled, false);
+ var driverAppSelectedPermissionsDto = new DriverAppSelectedPermissionsDto();
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ driverAppSelectedPermissionsDto.LocationSetToAlways = isLocationPermitted;
+ driverAppSelectedPermissionsDto.BatteryOptimisationDisabled = isBatteryOptimizationDisabled;
+ await gmCabsDriverService.DriverAppSelectedPermissions(token, driverAppSelectedPermissionsDto);
+ }
+ #endregion
+ }
+
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/ImeiNumberInstallViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/ImeiNumberInstallViewModel.cs
new file mode 100644
index 0000000..eff6ea5
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/ImeiNumberInstallViewModel.cs
@@ -0,0 +1,113 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ class ImeiNumberInstallViewModel : BaseViewModel
+ {
+ #region Fields
+ private string selectedImei;
+ private bool isSelectImeiDetailsVisisble = false;
+ private string selectedCarNumber;
+ private string installedImei;
+ private bool installedImeiExists;
+ #endregion
+
+ #region Properties
+ public ObservableCollection ImeiNumberLists { get; }
+ public Command SelectImei { get; }
+ public string SelectedImei
+ {
+ get => selectedImei;
+ set => SetProperty(ref selectedImei, value);
+ }
+ public bool IsSelectImeiDetailsVisisble
+ {
+ get => isSelectImeiDetailsVisisble;
+ set
+ {
+ SetProperty(ref isSelectImeiDetailsVisisble, value);
+ }
+ }
+ public string InstalledImei
+ {
+ get => installedImei;
+ set => SetProperty(ref installedImei, value);
+ }
+ public bool InstalledImeiExists
+ {
+ get => installedImeiExists;
+ set => SetProperty(ref installedImeiExists, value);
+ }
+ #endregion
+
+ #region Constructor
+ public ImeiNumberInstallViewModel()
+ {
+ Title = "Taxi Installation";
+ ImeiNumberLists = new ObservableCollection();
+ SelectImei = new Command(OnselectedImeiButtonClicked);
+ InstalledImei = Preferences.Get("imeiNumber", null);
+ if (!string.IsNullOrEmpty(InstalledImei))
+ {
+ InstalledImeiExists = true;
+ }
+ else
+ {
+ InstalledImeiExists = false;
+ InstalledImei = "NOT INSTALLED";
+ }
+ }
+ #endregion
+
+ #region Methods
+ public async void GetImeiDetails(string entry)
+ {
+ if (entry == String.Empty)
+ {
+ ImeiNumberLists.Clear();
+ }
+ else
+ {
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ var imeiLists = await gmCabsDriverService.GetAvailableImeiNumbers(entry);
+ if (imeiLists != null && imeiLists.Count > 0)
+ {
+ ImeiNumberLists.Clear();
+ foreach (var imei in imeiLists)
+ {
+ ImeiDto imeiDto = new ImeiDto();
+ imeiDto.ImeiNumber = imei.ImeiNumber;
+ imeiDto.CarNumber = imei.CarNumber;
+ ImeiNumberLists.Add(imeiDto);
+ }
+ }
+ else
+ {
+ ImeiNumberLists.Clear();
+ }
+ }
+ }
+ private void OnselectedImeiButtonClicked(ImeiDto imeiDto)
+ {
+ IsSelectImeiDetailsVisisble = true;
+ SelectedImei = imeiDto.ImeiNumber;
+ selectedCarNumber = imeiDto.CarNumber;
+ }
+ public void CompleteInstallation()
+ {
+ Preferences.Set("imeiNumber", SelectedImei);
+ Preferences.Set("carNumber", selectedCarNumber);
+ Preferences.Set("IsTablet", true);
+ //GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ //await gmCabsDriverService.CompleteInstallation(SelectedImei);
+ }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/LoginViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/LoginViewModel.cs
new file mode 100644
index 0000000..51a537f
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/LoginViewModel.cs
@@ -0,0 +1,286 @@
+//using Android.Content.PM;
+using CommunityToolkit.Mvvm.Input;
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using GMCabsDriverAssistantSolution.Models.Rydo;
+using GMCabsDriverAssistantSolution.Views;
+using Microsoft.Maui.Controls;
+using Plugin.FirebasePushNotification;
+using Sentry;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ public class LoginViewModel : BaseViewModel
+ {
+ #region Fields
+ private string phoneNumber;
+ private string message;
+ private string pin;
+ private double? lat;
+ private double? lon;
+ private string fcmToken;
+ private CancellationTokenSource cts;
+ private string installedImei;
+ private bool showSupportNumber;
+ private bool showInstalledImei;
+ private string imeiNumber;
+ private string carNumber;
+ private readonly bool isTablet;
+ #endregion
+
+ #region Properties
+ public Command LoginCommand { get; }
+ public Command AdminSetUpCommand { get; }
+ public string PhoneNumber
+ {
+ get => phoneNumber;
+ set
+ {
+ SetProperty(ref phoneNumber, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string ErrorMessage
+ {
+ get => message;
+ set => SetProperty(ref message, value);
+ }
+ public string Pin
+ {
+ get => pin;
+ set
+ {
+ SetProperty(ref pin, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string InstalledImei
+ {
+ get => installedImei;
+ set => SetProperty(ref installedImei, value);
+ }
+ public bool ShowSupportNumber
+ {
+ get => showSupportNumber;
+ set => SetProperty(ref showSupportNumber, value);
+ }
+ public bool ShowInstalledImei
+ {
+ get => showInstalledImei;
+ set => SetProperty(ref showInstalledImei, value);
+ }
+ public Command Register { get; set; }
+ public Page _page;
+ #endregion
+
+ #region Constructor
+ public LoginViewModel(Page page)
+ {
+ isTablet = Preferences.Get("IsTablet", false);
+ if (isTablet)
+ {
+ if (!DependencyService.Resolve().IsForeGroundServiceRunning())
+ {
+ Preferences.Set("isForeground", "YES");
+ DependencyService.Resolve().StartMyForegroundService();
+ }
+ }
+ LoginCommand = new Command(OnLoginClicked);
+ Register = new Command(OnRegisterClicked);
+ AdminSetUpCommand = new Command(OnAdminSetUpClicked);
+ _page = page;
+ }
+ #endregion
+
+ #region Methods
+
+ public void LoadDetails()
+ {
+ imeiNumber = Preferences.Get("imeiNumber", null);
+ carNumber = Preferences.Get("carNumber", null);
+ InstalledImei = imeiNumber != null && carNumber != null ? imeiNumber + " on Taxi " + carNumber : string.Empty;
+ if (isTablet)
+ {
+ ShowInstalledImei = true;
+ ShowSupportNumber = false;
+ }
+ else
+ {
+ ShowInstalledImei = false;
+ ShowSupportNumber = true;
+ }
+ GetCurrentLocation();
+ }
+ public async void GetCurrentLocation()
+ {
+ try
+ {
+ var request = new GeolocationRequest(GeolocationAccuracy.Medium, TimeSpan.FromSeconds(10));
+ cts = new CancellationTokenSource();
+ var location = await Geolocation.GetLocationAsync(request, cts.Token);
+
+ if (location != null)
+ {
+ lat = location.Latitude;
+ lon = location.Longitude;
+ }
+ }
+ catch (Exception ex)
+ {
+ // Unable to get location
+ }
+ }
+
+ [Obsolete]
+ private async void OnLoginClicked(object obj)
+ {
+ IsBusy = true;
+ ErrorMessage = "";
+ //var taxiNumber = Preferences.Get("taxiNumber", null);
+ imeiNumber = Preferences.Get("imeiNumber", null);
+
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ LoginRequestDto loginRequestDto = new LoginRequestDto
+ {
+ MobileNumber = phoneNumber,
+ Pin = pin,
+ Latitude = lat ?? lat,
+ Longitude = lon ?? lon,
+ FCMToken = CrossFirebasePushNotification.Current.Token,
+ //FCMToken = "cQvhFgiZSPSq7DtttjvAds:APA91bH09viaCOiSsT2T5yETAyLF6h04wBYFAhb-N1n57GGO5wBshwys-MJfQhjO5QxE648m-JerqWr2xVT3g_CdcclzSQLxOWRHd8mJ5UWj6nGb_lC9E3a3jm21jeMdjEHFosBqbQTU",
+ Imei = imeiNumber,
+ };
+ LoginResponseDto loginResponseDto = new LoginResponseDto();
+ loginRequestDto.IsTabletSession = isTablet;
+ loginResponseDto = await gmCabsDriverService.Login(loginRequestDto);
+
+ if (loginResponseDto.Token == Guid.Empty)
+ {
+ IsBusy = false;
+ if (!string.IsNullOrEmpty(loginResponseDto.LoginResponseMessage))
+ {
+ ErrorMessage = loginResponseDto.LoginResponseMessage;
+ }
+ else
+ {
+ ErrorMessage = "Invalid login. Please retry";
+ }
+ //_page.Navigation.ShowPopup(new ErrorPopup(ErrorMessage));
+ }
+ else if (!loginRequestDto.IsTabletSession && loginResponseDto.IsTabletSession)
+ {
+ IsBusy = false;
+ string errorMessage = "Login is already done with the same credential in a tablet, Cannot Login now";
+ //_page.Navigation.ShowPopup(new ErrorPopup(errorMessage));
+ }
+ else
+ {
+ Preferences.Set("FcmToken", loginRequestDto.FCMToken.ToString());
+ Preferences.Set(SecureStorageData.Token, loginResponseDto.Token.ToString());
+ Preferences.Set(SecureStorageData.DriverName, loginResponseDto.DriverName.ToString());
+ Preferences.Set("DriverMobileNumber", loginResponseDto.DriverMobileNumber.ToString());
+
+ if (Device.RuntimePlatform == Device.Android && isTablet && !string.IsNullOrWhiteSpace(imeiNumber) && !string.IsNullOrWhiteSpace(carNumber))
+ {
+
+ loginResponseDto.CanAcceptBookings = true;
+ loginResponseDto.CanUpdateLicence = false;
+ loginResponseDto.CanScanVouchers = false;
+ loginResponseDto.CanViewCoupons = false;
+ loginResponseDto.CanViewSettings = false;
+ loginResponseDto.CanViewHome = false;
+ loginResponseDto.CanViewJobHistory = true;
+ Preferences.Set(SecureStorageData.CanAcceptBookings, loginResponseDto.CanAcceptBookings);
+ Preferences.Set(SecureStorageData.CanUpdateLicence, loginResponseDto.CanUpdateLicence);
+ Preferences.Set(SecureStorageData.CanScanVouchers, loginResponseDto.CanScanVouchers);
+ Preferences.Set(SecureStorageData.CanViewCoupons, loginResponseDto.CanViewCoupons);
+ Preferences.Set(SecureStorageData.CanViewSettings, loginResponseDto.CanViewSettings);
+ Preferences.Set(SecureStorageData.CanViewHome, loginResponseDto.CanViewHome);
+ Preferences.Set(SecureStorageData.CanViewJobHistory, loginResponseDto.CanViewJobHistory);
+ }
+ else
+ {
+ loginResponseDto.CanViewJobHistory = false;
+ loginResponseDto.CanViewCoupons = true;
+ loginResponseDto.CanViewSettings = true;
+ Preferences.Set(SecureStorageData.CanAcceptBookings, loginResponseDto.CanAcceptBookings);
+ Preferences.Set(SecureStorageData.CanUpdateLicence, loginResponseDto.CanUpdateLicence);
+ Preferences.Set(SecureStorageData.CanScanVouchers, loginResponseDto.CanScanVouchers);
+ Preferences.Set(SecureStorageData.CanViewCoupons, loginResponseDto.CanViewCoupons);
+ Preferences.Set(SecureStorageData.CanViewSettings, loginResponseDto.CanViewSettings);
+ Preferences.Set(SecureStorageData.CanViewHome, loginResponseDto.CanViewHome);
+ Preferences.Set(SecureStorageData.CanViewJobHistory, loginResponseDto.CanViewJobHistory);
+ }
+ MessagingCenter.Send(this, "LoginSuccessful", loginResponseDto);
+ Preferences.Set("UserCode", loginResponseDto.UserCode.ToString());
+ if (loginResponseDto.UserCode != Guid.Empty)
+ {
+ Preferences.Set(LoginResponseDto.USER_CODE, loginResponseDto.UserCode.ToString());
+
+ var eftposLoginRequest = new EftposLoginRequest()
+ {
+ DriverId = loginResponseDto.UserCode,
+ MobileNumber = loginResponseDto.DriverMobileNumber
+ };
+ var eftposLoginResponse = await gmCabsDriverService.EftposLogin(eftposLoginRequest);
+
+ Preferences.Set(EftposLoginResponse.RYDO_ACCESS_TOKEN, eftposLoginResponse.AccessToken);
+ Preferences.Set(EftposLoginResponse.RYDO_TOKEN_TYPE, eftposLoginResponse.TokenType);
+ var driverRatingDetails = await gmCabsDriverService.GetDriverRatings(eftposLoginResponse.AccessToken, loginResponseDto.UserCode.ToString(), loginResponseDto.DriverMobileNumber);
+ if (driverRatingDetails != null)
+ {
+ Preferences.Set("DriverRating", driverRatingDetails.Rating.ToString());
+ }
+ }
+ //SentrySdk.ConfigureScope(scope =>
+ //{
+ // scope.User = new User
+ // {
+ // Id = loginResponseDto.UserCode.ToString()
+ // };
+ //});
+ PhoneNumber = "";
+ Pin = "";
+ if (Device.RuntimePlatform == Device.Android && isTablet && !string.IsNullOrWhiteSpace(imeiNumber) && !string.IsNullOrWhiteSpace(carNumber))
+ {
+ if (!string.IsNullOrEmpty(loginResponseDto.LoginResponseMessage))
+ {
+ IsBusy = false;
+ ErrorMessage = loginResponseDto.LoginResponseMessage;
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}");
+ }
+ else
+ {
+ //await Shell.Current.GoToAsync($"//{nameof(HomePageTablet)}?{nameof(HomePageTabletViewModel.IsBookingConfirmed)}={false}");
+ IsBusy = false;
+ }
+ }
+ else
+ {
+ IsBusy = false;
+ await Shell.Current.GoToAsync($"//{nameof(HomePage)}");
+ //await _page.Navigation.PushAsync(new HomePage());
+ //await Shell.Current.GoToAsync(nameof(HomePage));
+ //await Shell.Current.GoToAsync(nameof(NewPage1));
+ }
+ }
+ }
+ private async void OnRegisterClicked(object obj)
+ {
+ ErrorMessage = "";
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}/{nameof(UserRegistrationGenerateOtpPage)}");
+ }
+ private async void OnAdminSetUpClicked(object obj)
+ {
+ ErrorMessage = "";
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}/{nameof(AdminPasswordPage)}");
+ }
+ }
+ #endregion
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/TaxiInstallViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/TaxiInstallViewModel.cs
new file mode 100644
index 0000000..a31030d
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/TaxiInstallViewModel.cs
@@ -0,0 +1,80 @@
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistantSolution.Views;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ class TaxiInstallViewModel : BaseViewModel
+ {
+ #region Fields
+ private string taxiNumber;
+ private string message;
+ #endregion
+
+ #region Properties
+ public Command SaveCommand { get; }
+ public Command BackCommand { get; }
+ public string TaxiNumber
+ {
+ get => taxiNumber;
+ set
+ {
+ SetProperty(ref taxiNumber, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string ErrorMessage
+ {
+ get => message;
+ set => SetProperty(ref message, value);
+ }
+
+ #endregion
+
+ #region Constructor
+ public TaxiInstallViewModel()
+ {
+ SaveCommand = new Command(OnSaveClicked);
+ BackCommand = new Command(OnBackClicked);
+ }
+ #endregion
+
+ #region Methods
+ private async void OnSaveClicked(object obj)
+ {
+ IsBusy = true;
+ ErrorMessage = "";
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ if (string.IsNullOrWhiteSpace(TaxiNumber))
+ {
+ IsBusy = false;
+ ErrorMessage = "Taxi Number required";
+ return;
+ }
+ var isValidTaxinumberInstallation = await gmCabsDriverService.ValidateTaxiNumberInstallation(TaxiNumber);
+ if (isValidTaxinumberInstallation)
+ {
+ Preferences.Set("taxiNumber", TaxiNumber.ToString());
+ IsBusy = false;
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}/{nameof(AdminPasswordPage)}/{nameof(TaxiInstallPage)}/{nameof(InstallCompletePage)}");
+ }
+ else
+ {
+ IsBusy = false;
+ ErrorMessage = "Taxi number not valid";
+ }
+ }
+ private async void OnBackClicked(object obj)
+ {
+ ErrorMessage = "";
+ await Shell.Current.GoToAsync("..");
+ }
+ #endregion
+
+
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/UserRegistrationGenerateOtpViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/UserRegistrationGenerateOtpViewModel.cs
new file mode 100644
index 0000000..74610fb
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/UserRegistrationGenerateOtpViewModel.cs
@@ -0,0 +1,82 @@
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistantSolution.Views;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ public class UserRegistrationGenerateOtpViewModel : BaseViewModel
+ {
+ #region Fields
+ private string phoneNumber;
+ private string errorMessage;
+ #endregion
+
+ #region Properties
+ public string PhoneNumber
+ {
+ get => phoneNumber;
+ set
+ {
+ SetProperty(ref phoneNumber, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string ErrorMessage
+ {
+ get => errorMessage;
+ set => SetProperty(ref errorMessage, value);
+ }
+ public Command Register { get; set; }
+ public Command Back { get; set; }
+ #endregion
+
+ #region Constructor
+ public UserRegistrationGenerateOtpViewModel()
+ {
+ Register = new Command(OnRegisterClicked);
+ Back = new Command(OnBackClicked);
+#if DEBUG
+ //PhoneNumber = "0411111119";
+#endif
+ }
+
+ #endregion
+
+ #region Methods
+ private async void OnRegisterClicked(object obj)
+ {
+ ErrorMessage = "";
+
+ if (string.IsNullOrWhiteSpace(PhoneNumber))
+ {
+ ErrorMessage = "Mobile required for Registration";
+ return;
+ }
+
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ var isOtpSent = await gmCabsDriverService.GenerateOtp(PhoneNumber);
+ if (!isOtpSent)
+ {
+ ErrorMessage = "";
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}/{nameof(UserRegistrationGenerateOtpPage)}/{nameof(UserSignUpPage)}?{nameof(UserRegistrationVerifyOtpViewModel.PhoneNumber)}={PhoneNumber}");
+ }
+ else
+ {
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}/{nameof(UserRegistrationGenerateOtpPage)}/{nameof(UserRegistrationVerifyOtpPage)}?{nameof(UserRegistrationVerifyOtpViewModel.PhoneNumber)}={PhoneNumber}");
+ }
+
+ }
+
+
+
+ private async void OnBackClicked(object obj)
+ {
+ await Shell.Current.GoToAsync("..");
+ }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/UserRegistrationUpdateDriverPinViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/UserRegistrationUpdateDriverPinViewModel.cs
new file mode 100644
index 0000000..eb2d159
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/UserRegistrationUpdateDriverPinViewModel.cs
@@ -0,0 +1,105 @@
+using GMCabsDriverAssistant.Services;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ [QueryProperty(nameof(PhoneNumber), nameof(PhoneNumber))]
+ public class UserRegistrationUpdateDriverPinViewModel : BaseViewModel
+ {
+ #region Fields
+ private string phoneNumber;
+ private string pin;
+ private string confirmPin;
+ private string errorMessage;
+ #endregion
+
+ #region Properties
+ public string PhoneNumber
+ {
+ get => phoneNumber;
+ set => phoneNumber = value;
+ }
+ public string Pin
+ {
+ get => pin;
+ set
+ {
+ SetProperty(ref pin, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string ConfirmPin
+ {
+ get => confirmPin;
+ set
+ {
+ SetProperty(ref confirmPin, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string ErrorMessage
+ {
+ get => errorMessage;
+ set => SetProperty(ref errorMessage, value);
+ }
+ public Command Register { get; set; }
+ public Command Back { get; set; }
+
+ #endregion
+
+ #region Constructor
+ public UserRegistrationUpdateDriverPinViewModel()
+ {
+ Register = new Command(OnRegisterClicked);
+ Back = new Command(OnBackClicked);
+ }
+
+ #endregion
+
+ #region Methods
+
+ private async void OnRegisterClicked(object obj)
+ {
+ ErrorMessage = "";
+
+ if (string.IsNullOrWhiteSpace(Pin))
+ {
+ ErrorMessage = "Pin is not entered";
+ return;
+ }
+
+ if (string.IsNullOrWhiteSpace(ConfirmPin))
+ {
+ ErrorMessage = "Confirm Pin is not entered";
+ return;
+ }
+
+ if (Pin != ConfirmPin)
+ {
+ ErrorMessage = "Pin and Confirm Pin does not match";
+ return;
+ }
+
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+
+ var isDriverPinUpdated = await gmCabsDriverService.UpdateDriverPin(PhoneNumber, Convert.ToInt32(Pin));
+ if (!isDriverPinUpdated)
+ {
+ ErrorMessage = "Pin could be saved. Please try again.";
+ return;
+ }
+
+ await Shell.Current.GoToAsync($"../../..");
+ }
+
+ private async void OnBackClicked(object obj)
+ {
+ await Shell.Current.GoToAsync("..");
+ }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/UserRegistrationVerifyOtpViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/UserRegistrationVerifyOtpViewModel.cs
new file mode 100644
index 0000000..30526f8
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/UserRegistrationVerifyOtpViewModel.cs
@@ -0,0 +1,113 @@
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistantSolution.Views;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ [QueryProperty(nameof(PhoneNumber), nameof(PhoneNumber))]
+ public class UserRegistrationVerifyOtpViewModel : BaseViewModel
+ {
+ #region Fields
+ private string phoneNumber;
+ private string step1;
+ private string step2;
+ private string step3;
+ private string step4;
+ private string errorMessage;
+ #endregion
+
+ #region Properties
+ public string PhoneNumber
+ {
+ get => phoneNumber;
+ set => phoneNumber = value;
+ }
+ public string Step1
+ {
+ get => step1;
+ set
+ {
+ SetProperty(ref step1, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string Step2
+ {
+ get => step2;
+ set
+ {
+ SetProperty(ref step2, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string Step3
+ {
+ get => step3;
+ set
+ {
+ SetProperty(ref step3, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string Step4
+ {
+ get => step4;
+ set
+ {
+ SetProperty(ref step4, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string ErrorMessage
+ {
+ get => errorMessage;
+ set => SetProperty(ref errorMessage, value);
+ }
+ public Command VerifyOtp { get; set; }
+ public Command Back { get; set; }
+
+ #endregion
+
+ #region Constructor
+ public UserRegistrationVerifyOtpViewModel()
+ {
+ VerifyOtp = new Command(OnVerifyOtpClicked);
+ Back = new Command(OnBackClicked);
+ }
+ #endregion
+
+ #region Methods
+ private async void OnVerifyOtpClicked(object obj)
+ {
+ ErrorMessage = "";
+
+ if (string.IsNullOrWhiteSpace(Step1) || string.IsNullOrWhiteSpace(Step2) || string.IsNullOrWhiteSpace(Step3) || string.IsNullOrWhiteSpace(Step4))
+ {
+ ErrorMessage = "OTP required for Registration";
+ return;
+ }
+
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+
+ var otp = Step1 + Step2 + Step3 + Step4;
+ var isOtpVerified = await gmCabsDriverService.VerifyOtp(PhoneNumber, otp);
+ if (!isOtpVerified)
+ {
+ ErrorMessage = "OTP is incorrect";
+ return;
+ }
+
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}/{nameof(UserRegistrationGenerateOtpPage)}/{nameof(UserRegistrationVerifyOtpPage)}/{nameof(UserRegistrationUpdateDriverPinPage)}?{nameof(UserRegistrationUpdateDriverPinViewModel.PhoneNumber)}={phoneNumber}");
+ }
+
+ private async void OnBackClicked(object obj)
+ {
+ await Shell.Current.GoToAsync("..");
+ }
+ #endregion
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/ViewModels/UserSignUpViewModel.cs b/GMCabsDriverAssistantSolution/ViewModels/UserSignUpViewModel.cs
new file mode 100644
index 0000000..944f1bb
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/ViewModels/UserSignUpViewModel.cs
@@ -0,0 +1,154 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistantSolution.Views;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GMCabsDriverAssistantSolution.ViewModels
+{
+ [QueryProperty(nameof(PhoneNumber), nameof(PhoneNumber))]
+ public class UserSignUpViewModel : BaseViewModel
+ {
+ #region Fields
+ private string driverslicence;
+ private string password;
+ private string firstname;
+ private string lastname;
+ private string email;
+ private string message;
+ private string phoneNumber;
+ #endregion
+ #region Properties
+ public string DriverLicence
+ {
+ get => driverslicence;
+ set
+ {
+ SetProperty(ref driverslicence, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string Password
+ {
+ get => password;
+ set
+ {
+ SetProperty(ref password, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string FirstName
+ {
+ get => firstname;
+ set
+ {
+ SetProperty(ref firstname, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string LastName
+ {
+ get => lastname;
+ set
+ {
+ SetProperty(ref lastname, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string Email
+ {
+ get => email;
+ set
+ {
+ SetProperty(ref email, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+ public string ErrorMessage
+ {
+ get => message;
+ set => SetProperty(ref message, value);
+ }
+ public Command SignUpCommand { get; }
+ public string PhoneNumber
+ {
+ get => phoneNumber;
+ set
+ {
+ SetProperty(ref phoneNumber, value);
+ ErrorMessage = string.Empty;
+ }
+ }
+
+ #endregion
+ #region Constructor
+ public UserSignUpViewModel()
+ {
+ SignUpCommand = new Command(OnSignUpClicked);
+#if DEBUG
+#endif
+ }
+ #endregion
+ #region Methods
+ private async void OnSignUpClicked(object obj)
+ {
+ CreateLightDriverRequest createLightDriverRequest = new CreateLightDriverRequest();
+ ErrorMessage = "";
+ if (string.IsNullOrWhiteSpace(DriverLicence))
+ {
+ ErrorMessage = "Driver Licence required for Sign-Up";
+ return;
+ }
+ if (string.IsNullOrWhiteSpace(FirstName))
+ {
+ ErrorMessage = "First Name required for Sign-Up";
+ return;
+ }
+ if (string.IsNullOrWhiteSpace(LastName))
+ {
+ ErrorMessage = "Last Name required for Sign-Up";
+ return;
+ }
+ if (string.IsNullOrWhiteSpace(PhoneNumber))
+ {
+ ErrorMessage = "Mobile required for Sign-Up";
+ return;
+ }
+ if (string.IsNullOrWhiteSpace(Password))
+ {
+ ErrorMessage = "Password required for Sign-Up";
+ return;
+ }
+ if (string.IsNullOrWhiteSpace(Email))
+ {
+ ErrorMessage = "Email required for Sign-Up";
+ return;
+ }
+ IsBusy = true;
+ createLightDriverRequest.DriverLicence = DriverLicence;
+ createLightDriverRequest.FirstName = FirstName;
+ createLightDriverRequest.LastName = LastName;
+ createLightDriverRequest.Password = Password;
+ createLightDriverRequest.Email = Email;
+ createLightDriverRequest.MobileNumber = PhoneNumber;
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ bool result = await gmCabsDriverService.CreateLightDriver(createLightDriverRequest);
+ if (result)
+ {
+ IsBusy = false;
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}/{nameof(UserSignUpPage)}/{nameof(UserRegistrationVerifyOtpPage)}?{nameof(UserSignUpViewModel.PhoneNumber)}={PhoneNumber}");
+ }
+ else
+ {
+ IsBusy = false;
+ ErrorMessage = "Sign Up falied";
+ return;
+ }
+ }
+ #endregion
+
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Views/AcceptedFutureBookingsPage.xaml b/GMCabsDriverAssistantSolution/Views/AcceptedFutureBookingsPage.xaml
new file mode 100644
index 0000000..b673c0a
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/AcceptedFutureBookingsPage.xaml
@@ -0,0 +1,111 @@
+
+
+
+
+ #96d1ff
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/AcceptedFutureBookingsPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/AcceptedFutureBookingsPage.xaml.cs
new file mode 100644
index 0000000..e9b2789
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/AcceptedFutureBookingsPage.xaml.cs
@@ -0,0 +1,25 @@
+using GMCabsDriverAssistantSolution.ViewModels;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class AcceptedFutureBookingsPage : ContentPage
+{
+ #region Fields
+ private readonly AcceptedFutureBookingsViewModel _viewModel;
+ #endregion
+
+ #region Properties
+ #endregion
+
+ public AcceptedFutureBookingsPage()
+ {
+ InitializeComponent();
+ BindingContext = _viewModel = new AcceptedFutureBookingsViewModel();
+ }
+
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+ _viewModel.OnAppearing();
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/AdminPasswordPage.xaml b/GMCabsDriverAssistantSolution/Views/AdminPasswordPage.xaml
new file mode 100644
index 0000000..60f7df3
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/AdminPasswordPage.xaml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 20
+ 20,60
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/AdminPasswordPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/AdminPasswordPage.xaml.cs
new file mode 100644
index 0000000..9c41059
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/AdminPasswordPage.xaml.cs
@@ -0,0 +1,9 @@
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class AdminPasswordPage : ContentPage
+{
+ public AdminPasswordPage()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/CouponHistoryPage.xaml b/GMCabsDriverAssistantSolution/Views/CouponHistoryPage.xaml
new file mode 100644
index 0000000..18d3410
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/CouponHistoryPage.xaml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+ #96d1ff
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/CouponHistoryPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/CouponHistoryPage.xaml.cs
new file mode 100644
index 0000000..e313416
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/CouponHistoryPage.xaml.cs
@@ -0,0 +1,20 @@
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class CouponHistoryPage : ContentPage
+{
+ #region Fields
+ #endregion
+
+ #region Properties
+ #endregion
+
+ #region Constructor
+ public CouponHistoryPage()
+ {
+ InitializeComponent();
+ }
+ #endregion
+
+ #region Methods
+ #endregion
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/CouponsPage.xaml b/GMCabsDriverAssistantSolution/Views/CouponsPage.xaml
new file mode 100644
index 0000000..267c506
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/CouponsPage.xaml
@@ -0,0 +1,105 @@
+
+
+
+
+ #96d1ff
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/CouponsPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/CouponsPage.xaml.cs
new file mode 100644
index 0000000..678936c
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/CouponsPage.xaml.cs
@@ -0,0 +1,35 @@
+using GMCabsDriverAssistantSolution.ViewModels;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+[XamlCompilation(XamlCompilationOptions.Compile)]
+public partial class CouponsPage : ContentPage
+{
+ #region Fields
+ private readonly CouponsViewModel _viewModel;
+ #endregion
+
+ #region Properties
+ #endregion
+
+ #region Constructor
+ [Obsolete]
+ public CouponsPage()
+ {
+ InitializeComponent();
+ BindingContext = _viewModel = new CouponsViewModel();
+ }
+ #endregion
+
+ #region Methods
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+ _viewModel.OnAppearing();
+ }
+ private async void OnCouponHistoryViewClicked(object sender, EventArgs e)
+ {
+ //await Navigation.PushAsync(new CouponHistoryPage(), true);
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/CouponsV2Page.xaml b/GMCabsDriverAssistantSolution/Views/CouponsV2Page.xaml
new file mode 100644
index 0000000..b510439
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/CouponsV2Page.xaml
@@ -0,0 +1,103 @@
+
+
+
+
+ #96d1ff
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/CouponsV2Page.xaml.cs b/GMCabsDriverAssistantSolution/Views/CouponsV2Page.xaml.cs
new file mode 100644
index 0000000..45f0c88
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/CouponsV2Page.xaml.cs
@@ -0,0 +1,44 @@
+using static Microsoft.Maui.Controls.Button.ButtonContentLayout;
+using static Microsoft.Maui.Controls.Button;
+using GMCabsDriverAssistantSolution.ViewModels;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class CouponsV2Page : ContentPage
+{
+ #region Fields
+ private readonly CouponsV2ViewModel _viewModel;
+ #endregion
+ #region Constructor
+ [Obsolete]
+ public CouponsV2Page()
+ {
+ InitializeComponent();
+ BindingContext = _viewModel = new CouponsV2ViewModel(this);
+ if (Device.RuntimePlatform == Device.iOS)
+ {
+ BackButton.ContentLayout = new ButtonContentLayout(ImagePosition.Left, 10);
+ NextButton.ContentLayout = new ButtonContentLayout(ImagePosition.Right, 10);
+ }
+ else if (Device.RuntimePlatform == Device.Android)
+ {
+ BackButton.ContentLayout = new ButtonContentLayout(ImagePosition.Left, -100);
+ NextButton.ContentLayout = new ButtonContentLayout(ImagePosition.Right, -100);
+ }
+
+ }
+ #endregion
+
+ #region Methods
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+ _viewModel.OnAppearing();
+ }
+ private async void OnCouponHistoryViewClicked(object sender, EventArgs e)
+ {
+ await Navigation.PushAsync(new CouponHistoryPage(), true);
+ }
+ #endregion
+
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/HomePage.xaml b/GMCabsDriverAssistantSolution/Views/HomePage.xaml
new file mode 100644
index 0000000..239cd02
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/HomePage.xaml
@@ -0,0 +1,146 @@
+
+
+
+
+ #96d1ff
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/HomePage.xaml.cs b/GMCabsDriverAssistantSolution/Views/HomePage.xaml.cs
new file mode 100644
index 0000000..d28b332
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/HomePage.xaml.cs
@@ -0,0 +1,254 @@
+using GMCabsDriverAssistant.Messages;
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using GMCabsDriverAssistantSolution.Models.Rydo;
+using GMCabsDriverAssistantSolution.ViewModels;
+using Sentry;
+using System.Diagnostics;
+using System.Text.Json;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+[XamlCompilation(XamlCompilationOptions.Compile)]
+public partial class HomePage : ContentPage
+{
+ #region Fields
+ private readonly HomeViewModel _viewModel;
+ bool isLocationPermitted, isBatteryOptimizationDisabled;
+ #endregion
+
+ #region Properties
+ public double CurrentLat { get; set; }
+ public double CurrentLng { get; set; }
+ #endregion
+
+ #region Constructor
+ [Obsolete]
+ public HomePage()
+ {
+ //SentrySdk.CaptureMessage(nameof(HomePage));
+
+ InitializeComponent();
+ BindingContext = _viewModel = new HomeViewModel();
+
+ MessagingCenter.Unsubscribe(this, nameof(App));
+ MessagingCenter.Subscribe(this, nameof(App), async (sender, args) =>
+ {
+ Debug.WriteLine($"args: {args}");
+ if (args == "DriverAlertNotification")
+ {
+ await _viewModel.UpdateLocation();
+ }
+ else
+ {
+ await _viewModel.OnAppearing();
+ }
+
+
+ });
+
+ //handle canceling of an accepted booking
+ MessagingCenter.Unsubscribe(this, nameof(App));
+ MessagingCenter.Subscribe(this, nameof(App), async (sender, args) =>
+ {
+ await Navigation.PopToRootAsync();
+ //await Shell.Current.GoToAsync($"{nameof(CancelledBookingPage)}?{nameof(CancelledBookingViewModel.PickUpAddress)}={args.PickUPAddress}&{nameof(CancelledBookingViewModel.DropUpAddress)}={args.DropUpAddress}");
+ _viewModel.IsVisibleAcceptBookingView = false;
+ });
+ //MessagingCenter.Unsubscribe(this, nameof(AcceptBookingPage));
+ //MessagingCenter.Subscribe(this, nameof(AcceptBookingPage), (sender, args) =>
+ //{
+ // _viewModel.seconds = args.PendingSeconds;
+ // _viewModel.PickUpAddress = args.PickUPAddress;
+ // _viewModel.DropUpAddress = args.DropUpAddress;
+ // if (_viewModel.seconds > 0)
+ // {
+ // _viewModel.IsVisibleAcceptBookingView = true;
+ // }
+ //});
+
+ // handle clearing of an accepted booking
+ MessagingCenter.Unsubscribe(this, "ClearAcceptance");
+ MessagingCenter.Subscribe(this, "ClearAcceptance", async (sender, args) =>
+ {
+ await Navigation.PopToRootAsync();
+ _viewModel.IsVisibleAcceptBookingView = false;
+ _viewModel.seconds = 0;
+ });
+ //MessagingCenter.Unsubscribe(this, "ClearAcceptance");
+ //MessagingCenter.Subscribe(this, "ClearAcceptance", async (sender, args) =>
+ //{
+ // await Navigation.PopToRootAsync();
+ // await Shell.Current.GoToAsync($"{nameof(HomePage)}");
+ // _viewModel.IsVisibleAcceptBookingView = false;
+ // _viewModel.seconds = 0;
+ //});
+
+ // Used to handle notification by using MessagingCenter same is tablet based notification system
+ MessagingCenter.Subscribe(this, nameof(App), (sender, args) =>
+ {
+ _viewModel.GetUnreadNotificationCount();
+ });
+ MessagingCenter.Subscribe(this, nameof(App), async (sender, notification) =>
+ {
+ _viewModel.GetUnreadNotificationCount();
+ });
+ }
+
+ #endregion
+
+ #region Events
+ private void SettingsRequired_Tapped(object sender, EventArgs e)
+ {
+ // Navigation.ShowPopup(new AppPermissiontSetDialogPage(this, Constant.FROM_HOME_PAGE));
+ }
+ #endregion
+
+ #region Methods
+ [Obsolete]
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+ //CheckAppPermissionStatus();
+ isLocationPermitted = Preferences.Get(SecureStorageData.IsLocationPermitted, false);
+ isBatteryOptimizationDisabled = Preferences.Get(SecureStorageData.IsBatteryOptimizationDisabled, false);
+ IsSettingRequired();
+ GoToLoginPage();
+ Task.Run(async () =>
+ {
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ await _viewModel.OnAppearing();
+ DisplayBookingOrNotification(_viewModel.HasUnreadNotifications, _viewModel.IsBookingAvailable, _viewModel.availableBookingIDs);
+ });
+ }
+
+ [Obsolete]
+ private async void CheckAppPermissionStatus()
+ {
+ var status = await Permissions.CheckStatusAsync();
+ if (status == PermissionStatus.Granted)
+ {
+ Preferences.Set(SecureStorageData.IsLocationPermitted, true);
+ }
+ else
+ {
+ Preferences.Set(SecureStorageData.IsLocationPermitted, false);
+ }
+ if (Device.RuntimePlatform == Device.Android)
+ {
+ if (DependencyService.Get().CheckIsIgnoringBatteryOptimizations())
+ {
+ Preferences.Set(SecureStorageData.IsBatteryOptimizationDisabled, true);
+ }
+ else
+ {
+ Preferences.Set(SecureStorageData.IsBatteryOptimizationDisabled, false);
+ }
+ }
+ }
+
+ private async void GoToLoginPage()
+ {
+ ValidateTokenResponseDto validateTokenResponseDto = new ValidateTokenResponseDto();
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ var fcmToken = Preferences.Get("FcmToken", "");
+ validateTokenResponseDto = await gmCabsDriverService.ValidateAuthToken(token, fcmToken);
+ if (!validateTokenResponseDto.Result)
+ {
+ var message = new StopServiceMessage();
+ MessagingCenter.Send(message, "ServiceStopped");
+ var lastLatitude = Convert.ToDouble(Preferences.Get("lastLat", "0"));
+ var lastLongitude = Convert.ToDouble(Preferences.Get("lastLng", "0"));
+ await gmCabsDriverService.LogoutDriverApp(token, lastLatitude, lastLongitude);
+ //Navigation.ShowPopup(new LoginErrorAlertDialogPage());
+ }
+ }
+
+ protected override void OnDisappearing()
+ {
+ base.OnDisappearing();
+ _viewModel.OnDisappearing();
+ }
+
+ private async void OnNotificationViewClicked(object sender, EventArgs e)
+ {
+ // await Navigation.PushAsync(new NotificationsPage());
+ }
+ private async void OnBookingViewClicked(object sender, EventArgs e)
+ {
+ // await Navigation.PushAsync(new BookingsPage(_viewModel.CurrentLocation.Latitude, _viewModel.CurrentLocation.Longitude));
+ }
+
+ [Obsolete]
+ private async void DisplayBookingOrNotification(bool HasUnreadNotifications, bool IsBookingAvailable, List availableBookingIDs)
+ {
+ if (isLocationPermitted)
+ {
+ var currentLocation = Geolocation.GetLastKnownLocationAsync();
+ CurrentLat = currentLocation.Result.Latitude;
+ CurrentLng = currentLocation.Result.Longitude;
+ var isInitLaunched = Preferences.Get(SecureStorageData.InitLaunched, "");
+ if (String.IsNullOrEmpty(isInitLaunched))
+ {
+ Preferences.Set(SecureStorageData.InitLaunched, "1");
+ if (HasUnreadNotifications && !IsBookingAvailable)
+ {
+ //open notification page
+ //Device.BeginInvokeOnMainThread(() =>
+ //{
+ // Navigation.PushAsync(new NotificationsPage());
+ //});
+ }
+ else if (!HasUnreadNotifications && IsBookingAvailable && availableBookingIDs != null && availableBookingIDs.Count == 1)
+ {
+ string bookingJson = "";
+ string rydoAccessToken = Preferences.Get(EftposLoginResponse.RYDO_ACCESS_TOKEN, "");
+ Guid driverId = Guid.Parse(Preferences.Get(LoginResponseDto.USER_CODE, ""));
+
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ var bookings = await gmCabsDriverService.GetBookings(rydoAccessToken, driverId, CurrentLat, CurrentLng);
+ if (bookings.Count > 0)
+ {
+ if (bookings.Exists(x => x.BookingId == availableBookingIDs.First()))
+ {
+ bookingJson = JsonSerializer.Serialize(bookings.Single(x => x.BookingId == availableBookingIDs.First()));
+ }
+ else
+ {
+ bookingJson = JsonSerializer.Serialize(bookings.First());
+ }
+
+ Device.BeginInvokeOnMainThread(async () =>
+ {
+ //await Shell.Current.GoToAsync($"{nameof(BookingDetailsPage)}?{nameof(BookingDetailViewModel.BookingJson)}={bookingJson}");
+ });
+ }
+ }
+ }
+ }
+ }
+
+ [Obsolete]
+ private void IsSettingRequired()
+ {
+ if (isLocationPermitted && isBatteryOptimizationDisabled)
+ {
+ SettingsRequired.IsVisible = false;
+ }
+ else
+ {
+ if (Device.RuntimePlatform == Device.iOS && isLocationPermitted)
+ {
+ SettingsRequired.IsVisible = false;
+ }
+ else
+ {
+ SettingsRequired.IsVisible = true;
+ }
+ }
+ }
+ #endregion
+
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/ImeiNumberInstallPage.xaml b/GMCabsDriverAssistantSolution/Views/ImeiNumberInstallPage.xaml
new file mode 100644
index 0000000..ec076c8
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/ImeiNumberInstallPage.xaml
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 20
+ 20,60
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/ImeiNumberInstallPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/ImeiNumberInstallPage.xaml.cs
new file mode 100644
index 0000000..b833022
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/ImeiNumberInstallPage.xaml.cs
@@ -0,0 +1,39 @@
+using GMCabsDriverAssistantSolution.ViewModels;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class ImeiNumberInstallPage : ContentPage
+{
+ #region Fields
+ private readonly ImeiNumberInstallViewModel _viewModel;
+ #endregion
+
+ #region Constructor
+ public ImeiNumberInstallPage()
+ {
+ InitializeComponent();
+ BindingContext = _viewModel = new ImeiNumberInstallViewModel();
+ }
+ #endregion
+
+ #region System Events
+ private void EntryTextChanged(object sender, TextChangedEventArgs e)
+ {
+ _viewModel.GetImeiDetails(e.NewTextValue);
+ }
+
+ private void CompleteImeiInstallation_Clicked(object sender, EventArgs e)
+ {
+ _viewModel.CompleteInstallation();
+ (App.Current as App).MainPage = new AppShell();
+ }
+ #endregion
+
+ private void ClearImeiButton_Clicked(object sender, EventArgs e)
+ {
+ Preferences.Set("imeiNumber", null);
+ _viewModel.InstalledImeiExists = false;
+ _viewModel.InstalledImei = "NOT INSTALLED";
+ (App.Current as App).MainPage = new AppShell();
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/InstallCompletePage.xaml b/GMCabsDriverAssistantSolution/Views/InstallCompletePage.xaml
new file mode 100644
index 0000000..a6e3271
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/InstallCompletePage.xaml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 20
+ 20,60
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/InstallCompletePage.xaml.cs b/GMCabsDriverAssistantSolution/Views/InstallCompletePage.xaml.cs
new file mode 100644
index 0000000..222103b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/InstallCompletePage.xaml.cs
@@ -0,0 +1,16 @@
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class InstallCompletePage : ContentPage
+{
+ public InstallCompletePage()
+ {
+ InitializeComponent();
+ }
+
+ private async void Continue_Clicked(object sender, EventArgs e)
+ {
+
+ (App.Current as App).MainPage = new AppShell();
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}");
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/LoginPage.xaml b/GMCabsDriverAssistantSolution/Views/LoginPage.xaml
new file mode 100644
index 0000000..f125925
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/LoginPage.xaml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+ 20
+ 20,60
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/LoginPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/LoginPage.xaml.cs
new file mode 100644
index 0000000..5f03186
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/LoginPage.xaml.cs
@@ -0,0 +1,31 @@
+using GMCabsDriverAssistantSolution.ViewModels;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class LoginPage : ContentPage
+{
+ #region Fields
+ private readonly LoginViewModel _viewModel;
+ #endregion
+
+ #region Properties
+ #endregion
+
+ #region Constructor
+ public LoginPage()
+ {
+ InitializeComponent();
+ BindingContext = _viewModel = new LoginViewModel(this);
+ }
+ #endregion
+
+ #region Methods
+ protected async override void OnAppearing()
+ {
+ base.OnAppearing();
+ _viewModel.LoadDetails();
+ var status = await Permissions.CheckStatusAsync();
+
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/NewPage1.xaml b/GMCabsDriverAssistantSolution/Views/NewPage1.xaml
new file mode 100644
index 0000000..f7d7c3c
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/NewPage1.xaml
@@ -0,0 +1,147 @@
+
+
+
+
+ #96d1ff
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/NewPage1.xaml.cs b/GMCabsDriverAssistantSolution/Views/NewPage1.xaml.cs
new file mode 100644
index 0000000..332a463
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/NewPage1.xaml.cs
@@ -0,0 +1,188 @@
+using GMCabsDriverAssistant.Messages;
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using GMCabsDriverAssistantSolution.ViewModels;
+using System.Diagnostics;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class NewPage1 : ContentPage
+{
+
+ #region Fields
+ private readonly HomeViewModel _viewModel;
+ bool isLocationPermitted, isBatteryOptimizationDisabled;
+ #endregion
+
+ #region Properties
+ public double CurrentLat { get; set; }
+ public double CurrentLng { get; set; }
+ #endregion
+
+ #region Constructor
+ public NewPage1()
+ {
+ //SentrySdk.CaptureMessage(nameof(HomePage));
+
+ InitializeComponent();
+ BindingContext = _viewModel = new HomeViewModel();
+
+ MessagingCenter.Unsubscribe(this, nameof(App));
+ MessagingCenter.Subscribe(this, nameof(App), async (sender, args) =>
+ {
+ Debug.WriteLine($"args: {args}");
+ if (args == "DriverAlertNotification")
+ {
+ await _viewModel.UpdateLocation();
+ }
+ else
+ {
+ await _viewModel.OnAppearing();
+ }
+ });
+
+
+ //handle canceling of an accepted booking
+ MessagingCenter.Unsubscribe(this, nameof(App));
+ MessagingCenter.Subscribe(this, nameof(App), async (sender, args) =>
+ {
+ await Navigation.PopToRootAsync();
+ //await Shell.Current.GoToAsync($"{nameof(CancelledBookingPage)}?{nameof(CancelledBookingViewModel.PickUpAddress)}={args.PickUPAddress}&{nameof(CancelledBookingViewModel.DropUpAddress)}={args.DropUpAddress}");
+ _viewModel.IsVisibleAcceptBookingView = false;
+ });
+ //MessagingCenter.Unsubscribe(this, nameof(AcceptBookingPage));
+ //MessagingCenter.Subscribe(this, nameof(AcceptBookingPage), (sender, args) =>
+ //{
+ // _viewModel.seconds = args.PendingSeconds;
+ // _viewModel.PickUpAddress = args.PickUPAddress;
+ // _viewModel.DropUpAddress = args.DropUpAddress;
+ // if (_viewModel.seconds > 0)
+ // {
+ // _viewModel.IsVisibleAcceptBookingView = true;
+ // }
+ //});
+
+ // handle clearing of an accepted booking
+ MessagingCenter.Unsubscribe(this, "ClearAcceptance");
+ MessagingCenter.Subscribe(this, "ClearAcceptance", async (sender, args) =>
+ {
+ await Navigation.PopToRootAsync();
+ _viewModel.IsVisibleAcceptBookingView = false;
+ _viewModel.seconds = 0;
+ });
+ //MessagingCenter.Unsubscribe(this, "ClearAcceptance");
+ //MessagingCenter.Subscribe(this, "ClearAcceptance", async (sender, args) =>
+ //{
+ // await Navigation.PopToRootAsync();
+ // await Shell.Current.GoToAsync($"{nameof(HomePage)}");
+ // _viewModel.IsVisibleAcceptBookingView = false;
+ // _viewModel.seconds = 0;
+ //});
+
+ // Used to handle notification by using MessagingCenter same is tablet based notification system
+ MessagingCenter.Subscribe(this, nameof(App), (sender, args) =>
+ {
+ _viewModel.GetUnreadNotificationCount();
+ });
+ MessagingCenter.Subscribe(this, nameof(App), async (sender, notification) =>
+ {
+ _viewModel.GetUnreadNotificationCount();
+ });
+ }
+ #endregion
+
+ #region Events
+ private void SettingsRequired_Tapped(object sender, EventArgs e)
+ {
+ // Navigation.ShowPopup(new AppPermissiontSetDialogPage(this, Constant.FROM_HOME_PAGE));
+ }
+ #endregion
+
+ #region Methods
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+ //CheckAppPermissionStatus();
+ isLocationPermitted = Preferences.Get(SecureStorageData.IsLocationPermitted, false);
+ isBatteryOptimizationDisabled = Preferences.Get(SecureStorageData.IsBatteryOptimizationDisabled, false);
+ IsSettingRequired();
+ //GoToLoginPage();
+ Task.Run(async () =>
+ {
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ await _viewModel.OnAppearing();
+ //DisplayBookingOrNotification(_viewModel.HasUnreadNotifications, _viewModel.IsBookingAvailable, _viewModel.availableBookingIDs);
+ });
+ }
+ private async void GoToLoginPage()
+ {
+ ValidateTokenResponseDto validateTokenResponseDto = new ValidateTokenResponseDto();
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ var fcmToken = Preferences.Get("FcmToken", "");
+ validateTokenResponseDto = await gmCabsDriverService.ValidateAuthToken(token, fcmToken);
+ if (!validateTokenResponseDto.Result)
+ {
+ var message = new StopServiceMessage();
+ MessagingCenter.Send(message, "ServiceStopped");
+ var lastLatitude = Convert.ToDouble(Preferences.Get("lastLat", "0"));
+ var lastLongitude = Convert.ToDouble(Preferences.Get("lastLng", "0"));
+ await gmCabsDriverService.LogoutDriverApp(token, lastLatitude, lastLongitude);
+ //Navigation.ShowPopup(new LoginErrorAlertDialogPage());
+ }
+ }
+
+ private async void CheckAppPermissionStatus()
+ {
+ var status = await Permissions.CheckStatusAsync();
+ if (status == PermissionStatus.Granted)
+ {
+ Preferences.Set(SecureStorageData.IsLocationPermitted, true);
+ }
+ else
+ {
+ Preferences.Set(SecureStorageData.IsLocationPermitted, false);
+ }
+ if (Device.RuntimePlatform == Device.Android)
+ {
+ if (DependencyService.Get().CheckIsIgnoringBatteryOptimizations())
+ {
+ Preferences.Set(SecureStorageData.IsBatteryOptimizationDisabled, true);
+ }
+ else
+ {
+ Preferences.Set(SecureStorageData.IsBatteryOptimizationDisabled, false);
+ }
+ }
+ }
+ private void IsSettingRequired()
+ {
+ if (isLocationPermitted && isBatteryOptimizationDisabled)
+ {
+ SettingsRequired.IsVisible = false;
+ }
+ else
+ {
+ if (Device.RuntimePlatform == Device.iOS && isLocationPermitted)
+ {
+ SettingsRequired.IsVisible = false;
+ }
+ else
+ {
+ SettingsRequired.IsVisible = true;
+ }
+ }
+ }
+ private async void OnBookingViewClicked(object sender, EventArgs e)
+ {
+ // await Navigation.PushAsync(new BookingsPage(_viewModel.CurrentLocation.Latitude, _viewModel.CurrentLocation.Longitude));
+ await DisplayAlert("Success", "Booking view clicked","OK");
+ }
+ private async void OnNotificationViewClicked(object sender, EventArgs e)
+ {
+ // await Navigation.PushAsync(new NotificationsPage());
+ await DisplayAlert("Success", "Notification view clicked", "OK");
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/ScanDrivingLicencePage.xaml b/GMCabsDriverAssistantSolution/Views/ScanDrivingLicencePage.xaml
new file mode 100644
index 0000000..9f86a36
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/ScanDrivingLicencePage.xaml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/ScanDrivingLicencePage.xaml.cs b/GMCabsDriverAssistantSolution/Views/ScanDrivingLicencePage.xaml.cs
new file mode 100644
index 0000000..01140bb
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/ScanDrivingLicencePage.xaml.cs
@@ -0,0 +1,105 @@
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class ScanDrivingLicencePage : ContentPage
+{
+ //private FileResult drivingLicencePhoto;
+ private string drivingLicencePhoto;
+ private Stream _stream;
+ private GMCabsDriverService _service;
+
+ public ScanDrivingLicencePage()
+ {
+ InitializeComponent();
+ _service = new GMCabsDriverService();
+ }
+
+ private void ScanDrivingLicence_Clicked(object sender, EventArgs e)
+ {
+ try
+ {
+ if (MediaPicker.IsCaptureSupported)
+ {
+ //string action = await DisplayActionSheet("Scan Driving licence?", "Cancel", null , "Capture Photo", "From Gallery");
+ //if (action == "Cancel")
+ //{
+ // return;
+ //}
+ //drivingLicencePhoto = action == "Capture Photo"? await MediaPicker.CapturePhotoAsync() : await MediaPicker.PickPhotoAsync();
+
+ //new ImageCropper()
+ //{
+ // PageTitle = "Crop Photo",
+ // AspectRatioX = 3,
+ // AspectRatioY = 2,
+ // CropShape = ImageCropper.CropShapeType.Rectangle,
+ // SelectSourceTitle = "Select source",
+ // TakePhotoTitle = "Capture Photo",
+ // PhotoLibraryTitle = "From Gallery",
+ // Success = (imageFile) =>
+ // {
+ // Device.BeginInvokeOnMainThread(() =>
+ // {
+ // resultImage.Source = ImageSource.FromFile(imageFile);
+ // if (resultImage.Source != null)
+ // {
+ // drivingLicencePhoto = imageFile;
+ // BtnUpdateProfile.IsEnabled = true;
+ // }
+ // });
+ // }
+ //}.Show(this);
+
+
+ //if (drivingLicencePhoto != null)
+ //{
+ // _stream = await drivingLicencePhoto.OpenReadAsync();
+
+ // resultImage.Source = ImageSource.FromStream(() => _stream);
+
+ // if (resultImage.Source != null)
+ // {
+ // BtnUpdateProfile.IsEnabled = true;
+ // }
+ //}
+ }
+ }
+ catch (Exception ex) { }
+ }
+ private async void BtnUpdateProfile_Clicked(object sender, EventArgs e)
+ {
+ if (drivingLicencePhoto == null)
+ {
+ return;
+ }
+
+ string appToken = Preferences.Get(SecureStorageData.Token, "");
+
+ var content = new MultipartFormDataContent();
+ string[] res = drivingLicencePhoto.Split('/');
+ if (res.Length > 0)
+ {
+ string fileName = res[res.Length - 1];
+ content.Add(new StreamContent(System.IO.File.OpenRead(drivingLicencePhoto)), "files", fileName);
+ var status = await _service.UpdateProfile(appToken, content);
+ await DisplayAlert("Update Profile", status ? "Profile updated successful" : "Profile update failed", "OK");
+ if (status)
+ {
+ await Shell.Current.GoToAsync("..");
+ }
+ else
+ {
+ BtnUpdateProfile.IsEnabled = false;
+ resultImage.Source = null;
+ }
+ }
+
+
+ }
+ private async void BtnPageBack_Clicked(object sender, EventArgs e)
+ {
+ await Shell.Current.GoToAsync($"//{nameof(HomePage)}");
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Views/ScanVoucherPage.xaml b/GMCabsDriverAssistantSolution/Views/ScanVoucherPage.xaml
new file mode 100644
index 0000000..3ec92ae
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/ScanVoucherPage.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/ScanVoucherPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/ScanVoucherPage.xaml.cs
new file mode 100644
index 0000000..5d7f10c
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/ScanVoucherPage.xaml.cs
@@ -0,0 +1,9 @@
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class ScanVoucherPage : ContentPage
+{
+ public ScanVoucherPage()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/SettingsPage.xaml b/GMCabsDriverAssistantSolution/Views/SettingsPage.xaml
new file mode 100644
index 0000000..6e3ac53
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/SettingsPage.xaml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+ 20
+ 20,60
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/SettingsPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/SettingsPage.xaml.cs
new file mode 100644
index 0000000..af31704
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/SettingsPage.xaml.cs
@@ -0,0 +1,57 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using System.Diagnostics;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class SettingsPage : ContentPage
+{
+
+
+ public SettingsPage()
+ {
+ InitializeComponent();
+
+ //if (!Preferences.ContainsKey(Constants.VoucherScanUseFrontCamera))
+ //{
+ // Preferences.Set(Constants.VoucherScanUseFrontCamera, true);
+ //}
+ IsHideVoucherScanSettings();
+ SwitchVoucherScanUseFrontCamera.On = Preferences.Get("VoucherScanUseFrontCamera", true);
+ SwitchSilentMode.On = Preferences.Get("IsSilentMode", false);
+ }
+
+ private void SwitchVoucherScanUseFrontCamera_OnChanged(object sender, ToggledEventArgs e)
+ {
+ Preferences.Set("VoucherScanUseFrontCamera", e.Value);
+ }
+
+ private async void IsHideVoucherScanSettings()
+ {
+ var isVisibleVoucherScan = Preferences.Get(SecureStorageData.CanScanVouchers, false);
+ if (Convert.ToBoolean(isVisibleVoucherScan) == false)
+ {
+ Settings.Root.Remove(VoucherScanSettings);
+ }
+
+ }
+
+ private async void SilentModeSwitch_OnChanged(object sender, ToggledEventArgs e)
+ {
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ Debug.WriteLine(e.Value);
+ Preferences.Set("IsSilentMode", e.Value);
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ SilentModeSettingRequest silentModeSettingRequest = new SilentModeSettingRequest
+ {
+ IsSilentModeEnabled = e.Value
+ };
+ await gmCabsDriverService.UpdateSilentModeSetting(token, silentModeSettingRequest);
+ }
+
+ private void CloseButton_Clicked(object sender, EventArgs e)
+ {
+ //Navigation.ShowPopup(new CloseAccountDialogPage(this));
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Views/SplashPage.xaml b/GMCabsDriverAssistantSolution/Views/SplashPage.xaml
new file mode 100644
index 0000000..613dd06
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/SplashPage.xaml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+ 20
+ 20,60
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/SplashPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/SplashPage.xaml.cs
new file mode 100644
index 0000000..04622f7
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/SplashPage.xaml.cs
@@ -0,0 +1,111 @@
+using GMCabsDriverAssistant.Models;
+using GMCabsDriverAssistant.Services;
+using GMCabsDriverAssistant.Utils;
+using Plugin.FirebasePushNotification;
+using Sentry;
+
+namespace GMCabsDriverAssistantSolution.Views;
+
+[XamlCompilation(XamlCompilationOptions.Compile)]
+public partial class SplashPage : ContentPage
+{
+ public SplashPage()
+ {
+ InitializeComponent();
+ }
+
+ [Obsolete]
+ protected async override void OnAppearing()
+ {
+ base.OnAppearing();
+
+ var checkFcmToken = Preferences.Get("FcmToken", "");
+ var token = Preferences.Get(SecureStorageData.Token, "");
+ if (Device.RuntimePlatform != Device.iOS)
+ {
+ DependencyService.Resolve().ManageNotificationChannelService();
+ }
+
+ if (string.IsNullOrWhiteSpace(checkFcmToken) || string.IsNullOrWhiteSpace(token))
+ {
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}");
+ }
+ else
+ {
+ var userCode = Preferences.Get("UserCode", null);
+ if (!string.IsNullOrWhiteSpace(userCode))
+ {
+ SentrySdk.ConfigureScope(scope =>
+ {
+ scope.User = new User
+ {
+ Id = userCode.ToString()
+ };
+ });
+ }
+ GMCabsDriverService gmCabsDriverService = new GMCabsDriverService();
+ var imeiNumber = Preferences.Get("imeiNumber", null);
+ var carNumber = Preferences.Get("carNumber", null);
+ var fcmToken = CrossFirebasePushNotification.Current.Token;
+ ValidateTokenResponseDto validateTokenResponseDto = new ValidateTokenResponseDto();
+ validateTokenResponseDto = await gmCabsDriverService.ValidateAuthToken(token, fcmToken);
+ var isTablet = Preferences.Get("IsTablet", false);
+ if (Device.RuntimePlatform == Device.Android && isTablet && !string.IsNullOrWhiteSpace(imeiNumber) && !string.IsNullOrWhiteSpace(carNumber))
+ {
+ validateTokenResponseDto.CanAcceptBookings = true;
+ validateTokenResponseDto.CanUpdateLicence = false;
+ validateTokenResponseDto.CanScanVouchers = false;
+ validateTokenResponseDto.CanViewCoupons = false;
+ validateTokenResponseDto.CanViewSettings = false;
+ validateTokenResponseDto.CanViewHome = false;
+ validateTokenResponseDto.CanViewJobHistory = true;
+ Preferences.Set(SecureStorageData.CanAcceptBookings, validateTokenResponseDto.CanAcceptBookings);
+ Preferences.Set(SecureStorageData.CanUpdateLicence, validateTokenResponseDto.CanUpdateLicence);
+ Preferences.Set(SecureStorageData.CanScanVouchers, validateTokenResponseDto.CanScanVouchers);
+ Preferences.Set(SecureStorageData.CanViewCoupons, validateTokenResponseDto.CanViewCoupons);
+ Preferences.Set(SecureStorageData.CanViewSettings, validateTokenResponseDto.CanViewSettings);
+ Preferences.Set(SecureStorageData.CanViewHome, validateTokenResponseDto.CanViewHome);
+ Preferences.Set(SecureStorageData.CanViewJobHistory, validateTokenResponseDto.CanViewJobHistory);
+ }
+ else
+ {
+ //validateTokenResponseDto.CanAcceptBookings = true;
+ //validateTokenResponseDto.CanUpdateLicence = true;
+ //validateTokenResponseDto.CanScanVouchers = true;
+ //validateTokenResponseDto.CanViewCoupons = true;
+ //validateTokenResponseDto.CanViewSettings = true;
+ //validateTokenResponseDto.CanViewHome = true;
+ //validateTokenResponseDto.CanViewJobHistory = false;
+ Preferences.Set(SecureStorageData.CanAcceptBookings, validateTokenResponseDto.CanAcceptBookings);
+ Preferences.Set(SecureStorageData.CanUpdateLicence, validateTokenResponseDto.CanUpdateLicence);
+ Preferences.Set(SecureStorageData.CanScanVouchers, validateTokenResponseDto.CanScanVouchers);
+ Preferences.Set(SecureStorageData.CanViewCoupons, validateTokenResponseDto.CanViewCoupons);
+ Preferences.Set(SecureStorageData.CanViewSettings, validateTokenResponseDto.CanViewSettings);
+ Preferences.Set(SecureStorageData.CanViewHome, validateTokenResponseDto.CanViewHome);
+ Preferences.Set(SecureStorageData.CanViewJobHistory, validateTokenResponseDto.CanViewJobHistory);
+ }
+ if (validateTokenResponseDto.Result)
+ {
+ Preferences.Set("FcmToken", fcmToken.ToString());
+ if (Device.RuntimePlatform == Device.Android && isTablet && !string.IsNullOrWhiteSpace(imeiNumber) && !string.IsNullOrWhiteSpace(carNumber))
+ {
+ //await Shell.Current.GoToAsync($"//{nameof(HomePageTablet)}?{nameof(HomePageTabletViewModel.IsBookingConfirmed)}={false}");
+ IsBusy = false;
+ }
+ else
+ {
+ IsBusy = false;
+ await Shell.Current.GoToAsync($"//{nameof(HomePage)}");
+ //await Shell.Current.GoToAsync(nameof(HomePage));
+ }
+ }
+ else
+ {
+ var lastLatitude = Convert.ToDouble(Preferences.Get("lastLat", "0"));
+ var lastLongitude = Convert.ToDouble(Preferences.Get("lastLng", "0"));
+ await gmCabsDriverService.LogoutDriverApp(token, lastLatitude, lastLongitude);
+ await Shell.Current.GoToAsync($"//{nameof(LoginPage)}");
+ }
+ }
+ }
+}
diff --git a/GMCabsDriverAssistantSolution/Views/TaxiInstallPage.xaml b/GMCabsDriverAssistantSolution/Views/TaxiInstallPage.xaml
new file mode 100644
index 0000000..13c00f5
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/TaxiInstallPage.xaml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 20
+ 20,60
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/TaxiInstallPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/TaxiInstallPage.xaml.cs
new file mode 100644
index 0000000..3f156a9
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/TaxiInstallPage.xaml.cs
@@ -0,0 +1,9 @@
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class TaxiInstallPage : ContentPage
+{
+ public TaxiInstallPage()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/UserRegistrationGenerateOtpPage.xaml b/GMCabsDriverAssistantSolution/Views/UserRegistrationGenerateOtpPage.xaml
new file mode 100644
index 0000000..c0d6d3b
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/UserRegistrationGenerateOtpPage.xaml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/UserRegistrationGenerateOtpPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/UserRegistrationGenerateOtpPage.xaml.cs
new file mode 100644
index 0000000..a4dfbf1
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/UserRegistrationGenerateOtpPage.xaml.cs
@@ -0,0 +1,20 @@
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class UserRegistrationGenerateOtpPage : ContentPage
+{
+ #region Fields
+ #endregion
+
+ #region Properties
+ #endregion
+
+ #region Constructor
+ public UserRegistrationGenerateOtpPage()
+ {
+ InitializeComponent();
+ }
+ #endregion
+
+ #region Methods
+ #endregion
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/UserRegistrationUpdateDriverPinPage.xaml b/GMCabsDriverAssistantSolution/Views/UserRegistrationUpdateDriverPinPage.xaml
new file mode 100644
index 0000000..7628f49
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/UserRegistrationUpdateDriverPinPage.xaml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/UserRegistrationUpdateDriverPinPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/UserRegistrationUpdateDriverPinPage.xaml.cs
new file mode 100644
index 0000000..f997dc7
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/UserRegistrationUpdateDriverPinPage.xaml.cs
@@ -0,0 +1,9 @@
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class UserRegistrationUpdateDriverPinPage : ContentPage
+{
+ public UserRegistrationUpdateDriverPinPage()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/UserRegistrationVerifyOtpPage.xaml b/GMCabsDriverAssistantSolution/Views/UserRegistrationVerifyOtpPage.xaml
new file mode 100644
index 0000000..25d4bf9
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/UserRegistrationVerifyOtpPage.xaml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/UserRegistrationVerifyOtpPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/UserRegistrationVerifyOtpPage.xaml.cs
new file mode 100644
index 0000000..fa96776
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/UserRegistrationVerifyOtpPage.xaml.cs
@@ -0,0 +1,84 @@
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class UserRegistrationVerifyOtpPage : ContentPage
+{
+ public UserRegistrationVerifyOtpPage()
+ {
+ InitializeComponent();
+ step1.Focus();
+ step2.IsEnabled = false;
+ step3.IsEnabled = false;
+ step4.IsEnabled = false;
+ }
+
+ private void step1_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (e.NewTextValue.Length == 1)
+ {
+ if (string.IsNullOrEmpty(step2.Text))
+ {
+ step2.IsEnabled = true;
+ step2.Focus();
+ }
+ }
+ }
+
+ private void step2_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (e.NewTextValue.Length == 1)
+ {
+ if (string.IsNullOrEmpty(step3.Text))
+ {
+ step3.Focus();
+ step3.IsEnabled = true;
+ }
+ }
+
+ if (e.NewTextValue.Length == 0)
+ {
+ step2.OnBackspace += EntryBackspaceEventHandler2;
+
+ }
+ }
+
+ public void EntryBackspaceEventHandler2(object sender, EventArgs e)
+ {
+ step1.Focus();
+ step1.Text = string.Empty;
+ }
+
+ public void EntryBackspaceEventHandler3(object sender, EventArgs e)
+ {
+ step2.Focus();
+ step2.Text = string.Empty;
+ }
+
+ public void EntryBackspaceEventHandler4(object sender, EventArgs e)
+ {
+ step3.Focus();
+ step3.Text = string.Empty;
+ }
+
+ private void step3_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (e.NewTextValue.Length == 1)
+ {
+ step4.Focus();
+ step4.IsEnabled = true;
+ }
+
+ if (e.NewTextValue.Length == 0)
+ {
+ step3.OnBackspace += EntryBackspaceEventHandler3;
+
+ }
+ }
+
+ private void step4_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (e.NewTextValue.Length == 0)
+ {
+ step4.OnBackspace += EntryBackspaceEventHandler4;
+ }
+ }
+}
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/UserSignUpPage.xaml b/GMCabsDriverAssistantSolution/Views/UserSignUpPage.xaml
new file mode 100644
index 0000000..d717e88
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/UserSignUpPage.xaml
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 20
+ 20,60
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GMCabsDriverAssistantSolution/Views/UserSignUpPage.xaml.cs b/GMCabsDriverAssistantSolution/Views/UserSignUpPage.xaml.cs
new file mode 100644
index 0000000..865e001
--- /dev/null
+++ b/GMCabsDriverAssistantSolution/Views/UserSignUpPage.xaml.cs
@@ -0,0 +1,9 @@
+namespace GMCabsDriverAssistantSolution.Views;
+
+public partial class UserSignUpPage : ContentPage
+{
+ public UserSignUpPage()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file