diff --git a/.DS_Store b/.DS_Store index 964d305..28f106b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/gehGassiApp/.DS_Store b/gehGassiApp/.DS_Store new file mode 100644 index 0000000..28f106b Binary files /dev/null and b/gehGassiApp/.DS_Store differ diff --git a/gehGassiApp/gehGassiApp.Core/Interfaces/IPublicWalkRequestService.cs b/gehGassiApp/gehGassiApp.Core/Interfaces/IPublicWalkRequestService.cs index 4f19616..a4ea1d9 100644 --- a/gehGassiApp/gehGassiApp.Core/Interfaces/IPublicWalkRequestService.cs +++ b/gehGassiApp/gehGassiApp.Core/Interfaces/IPublicWalkRequestService.cs @@ -163,9 +163,10 @@ namespace gehGassiApp.Core.Interfaces /// Id der öffentlichen Anfrage /// Id des akzeptierten Angebotes /// Id des Hundebesitzers + /// Zahlungsart für den Walk /// Aktuelles Accesstoken /// CancellationToken /// Erstellter Walk wenn erfolgreich, false sonst - Task AcceptResponseAsync(string publicWalkRequestId, string publicWalkResponseId, string appUserId, string accessToken, CancellationToken token); + Task AcceptResponseAsync(string publicWalkRequestId, string publicWalkResponseId, string appUserId, WalkPaymentType? paymentType, string accessToken, CancellationToken token); } } diff --git a/gehGassiApp/gehGassiApp.Core/Services/PublicWalkRequestService.cs b/gehGassiApp/gehGassiApp.Core/Services/PublicWalkRequestService.cs index 5ac7e18..38c6acf 100644 --- a/gehGassiApp/gehGassiApp.Core/Services/PublicWalkRequestService.cs +++ b/gehGassiApp/gehGassiApp.Core/Services/PublicWalkRequestService.cs @@ -487,16 +487,18 @@ namespace gehGassiApp.Core.Services /// Id der öffentlichen Anfrage /// Id des akzeptierten Angebotes /// Id des Hundebesitzers + /// Zahlungsart für den Walk /// Aktuelles Accesstoken /// CancellationToken /// Erstellter Walk wenn erfolgreich, false sonst - public async Task AcceptResponseAsync(string publicWalkRequestId, string publicWalkResponseId, string appUserId, string accessToken, CancellationToken token) + public async Task AcceptResponseAsync(string publicWalkRequestId, string publicWalkResponseId, string appUserId, WalkPaymentType? paymentType, string accessToken, CancellationToken token) { var dto = new PublicWalkRequestAcceptDto() { PublicWalkRequestId = publicWalkRequestId, PublicWalkResponseId = publicWalkResponseId, DogOwnerId = appUserId, + PaymentType = paymentType.HasValue ? (WalkPaymentTypeDto)paymentType.Value : null, UpdatedAt = DateTimeOffset.UtcNow }; diff --git a/gehGassiApp/gehGassiApp/.DS_Store b/gehGassiApp/gehGassiApp/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/gehGassiApp/gehGassiApp/.DS_Store differ diff --git a/gehGassiApp/gehGassiApp/Resources/Images/cashonly.svg b/gehGassiApp/gehGassiApp/Resources/Images/cashonly.svg new file mode 100644 index 0000000..63d8404 --- /dev/null +++ b/gehGassiApp/gehGassiApp/Resources/Images/cashonly.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/gehGassiApp/gehGassiApp/ViewModels/Popups/PaymentInfoPopupViewModel.cs b/gehGassiApp/gehGassiApp/ViewModels/Popups/PaymentInfoPopupViewModel.cs index 1efd047..7d3ae74 100644 --- a/gehGassiApp/gehGassiApp/ViewModels/Popups/PaymentInfoPopupViewModel.cs +++ b/gehGassiApp/gehGassiApp/ViewModels/Popups/PaymentInfoPopupViewModel.cs @@ -6,50 +6,21 @@ namespace gehGassiApp.ViewModels.Popups { /// /// ViewModel für das Zahlungshinweis-Popup - /// - /// Verwendung: - /// // Prüfen ob bereits angezeigt - /// if (!PaymentInfoPopupViewModel.HasInfoBeenShown()) - /// { - /// var popup = new PaymentInfoPopup(); - /// await Shell.Current.CurrentPage.ShowPopupAsync(popup); - /// } /// public partial class PaymentInfoPopupViewModel : ObservableObject { private readonly Popup _popup; - private const string PAYMENT_INFO_SHOWN_KEY = "payment_info_july_shown_2025"; public PaymentInfoPopupViewModel(Popup popup) { _popup = popup; } - - /// - /// Prüft, ob der Zahlungshinweis bereits angezeigt wurde - /// - public static bool HasInfoBeenShown() - { - return Preferences.Get(PAYMENT_INFO_SHOWN_KEY, false); - } - - /// - /// Markiert den Hinweis als angezeigt - /// - private static void MarkInfoAsShown() - { - Preferences.Set(PAYMENT_INFO_SHOWN_KEY, true); - } - /// /// User hat den Hinweis zur Kenntnis genommen /// [RelayCommand] private async Task Acknowledge() { - // Hinweis als angezeigt markieren - MarkInfoAsShown(); - // Popup schließen await _popup.CloseAsync(true); } diff --git a/gehGassiApp/gehGassiApp/ViewModels/Walks/BookWalkViewModel.cs b/gehGassiApp/gehGassiApp/ViewModels/Walks/BookWalkViewModel.cs index 37747f9..a41ec34 100644 --- a/gehGassiApp/gehGassiApp/ViewModels/Walks/BookWalkViewModel.cs +++ b/gehGassiApp/gehGassiApp/ViewModels/Walks/BookWalkViewModel.cs @@ -2,6 +2,7 @@ using System.Text.Json; using System.Web; using CommunityToolkit.Maui.Core.Extensions; +using CommunityToolkit.Maui.Views; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Messaging; @@ -615,6 +616,10 @@ namespace gehGassiApp.ViewModels.Walks var helpStartDate = new DateTimeOffset(StartDate.Year, StartDate.Month, StartDate.Day, StartTime.Hours, StartTime.Minutes, StartTime.Seconds, DateTimeOffset.Now.Offset); var helpEndDate = new DateTimeOffset(EndDate.Year, EndDate.Month, EndDate.Day, EndTime.Hours, EndTime.Minutes, EndTime.Seconds, DateTimeOffset.Now.Offset); + // PaymentType auswählen + var paymentPopup = new Views.Popups.PaymentInfoPopup(); + var paymentResult = await Shell.Current.CurrentPage.ShowPopupAsync(paymentPopup); + var walkCreateDto = new WalkCreateDto() { Type = WalkTypeDto.Scheduled, @@ -628,7 +633,8 @@ namespace gehGassiApp.ViewModels.Walks PickupAddress = PickupAddress.ToDto(), ReturnAddress = ReturnAddress.ToDto(), Price = Price, - Info = Info + Info = Info, + PaymentType = paymentResult is true ? WalkPaymentTypeDto.Cash : null }; #region Pickupaddress @@ -723,6 +729,10 @@ namespace gehGassiApp.ViewModels.Walks var helpStartDate = new DateTimeOffset(StartDate.Year, StartDate.Month, StartDate.Day, StartTime.Hours, StartTime.Minutes, StartTime.Seconds, DateTimeOffset.Now.Offset); var helpEndDate = new DateTimeOffset(EndDate.Year, EndDate.Month, EndDate.Day, EndTime.Hours, EndTime.Minutes, EndTime.Seconds, DateTimeOffset.Now.Offset); + // PaymentType auswählen + var paymentPopup = new Views.Popups.PaymentInfoPopup(); + var paymentResult = await Shell.Current.CurrentPage.ShowPopupAsync(paymentPopup); + var walkCreateDto = new WalkCreateDto() { Type = WalkTypeDto.Direct, @@ -736,7 +746,8 @@ namespace gehGassiApp.ViewModels.Walks PickupAddress = PickupAddress.ToDto(), ReturnAddress = ReturnAddress.ToDto(), Price = Price, - Info = Info + Info = Info, + PaymentType = paymentResult is true ? WalkPaymentTypeDto.Cash : null }; #region Pickupaddress diff --git a/gehGassiApp/gehGassiApp/ViewModels/Walks/PublicWalkResponseShowViewModel.cs b/gehGassiApp/gehGassiApp/ViewModels/Walks/PublicWalkResponseShowViewModel.cs index ebfae29..34a22be 100644 --- a/gehGassiApp/gehGassiApp/ViewModels/Walks/PublicWalkResponseShowViewModel.cs +++ b/gehGassiApp/gehGassiApp/ViewModels/Walks/PublicWalkResponseShowViewModel.cs @@ -1,5 +1,6 @@ using System.Web; using CommunityToolkit.Maui.Core; +using CommunityToolkit.Maui.Views; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Messaging; @@ -120,9 +121,22 @@ namespace gehGassiApp.ViewModels.Walks return; } + // PaymentInfoPopup anzeigen um PaymentType zu bestimmen + var paymentInfoPopup = new Views.Popups.PaymentInfoPopup(); + var popupResult = await Shell.Current.CurrentPage.ShowPopupAsync(paymentInfoPopup); + + // Wenn das Popup geschlossen wurde ohne "Alles klar" zu klicken, abbrechen + if (popupResult == null || !(bool)popupResult) + { + return; + } + + // Popup Result = true bedeutet Cash Payment + var paymentType = WalkPaymentType.Cash; + IsSaving = true; using var cts = new CancellationTokenSource(Core.Common.Constants.CreateTimeout); - var createdWalk = await _publicWalkRequestService.AcceptResponseAsync(_requestId, PublicWalkResponse.Id, App.CurrentAppUser.Id, App.CurrentUser.AccessToken, cts.Token); + var createdWalk = await _publicWalkRequestService.AcceptResponseAsync(_requestId, PublicWalkResponse.Id, App.CurrentAppUser.Id, paymentType, App.CurrentUser.AccessToken, cts.Token); if (createdWalk != null) { WeakReferenceMessenger.Default.Send(new RefreshViewModelMessage(Core.Messaging.Messages.Refresh_PublicWalkRequestDetails)); diff --git a/gehGassiApp/gehGassiApp/Views/Popups/PaymentInfoPopup.xaml b/gehGassiApp/gehGassiApp/Views/Popups/PaymentInfoPopup.xaml index fe318b5..f10e822 100644 --- a/gehGassiApp/gehGassiApp/Views/Popups/PaymentInfoPopup.xaml +++ b/gehGassiApp/gehGassiApp/Views/Popups/PaymentInfoPopup.xaml @@ -5,13 +5,14 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:res="clr-namespace:gehGassiApp.Resources" xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" - CanBeDismissedByTappingOutsideOfPopup="True" + CanBeDismissedByTappingOutsideOfPopup="False" Color="Transparent"> @@ -19,79 +20,69 @@ - - - - - + + Grid.Row="0" + Padding="20,30,20,20" + Spacing="20"> - + + + +