Update order system with new gRPC services and wallet integration

This commit is contained in:
masoodafar-web
2025-11-28 05:12:55 +03:30
parent 973beb9e2f
commit d8e1fe77b3
20 changed files with 502 additions and 209 deletions
+18 -3
View File
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components;
using FrontOffice.Main.Utilities;
using System.Linq;
namespace FrontOffice.Main.Pages.Store;
@@ -14,14 +15,28 @@ public partial class Cart : ComponentBase, IDisposable
CartService.OnChange += StateHasChanged;
}
private async Task IncrementQty(long productId)
{
var item = CartData.Items.FirstOrDefault(i => i.ProductId == productId);
if (item is null) return;
await CartService.UpdateQuantity(productId, item.Quantity + 1);
}
private async Task DecrementQty(long productId)
{
var item = CartData.Items.FirstOrDefault(i => i.ProductId == productId);
if (item is null) return;
await CartService.UpdateQuantity(productId, item.Quantity - 1);
}
private async Task ChangeQty(long productId, int value)
{
await CartService.UpdateQuantity(productId, value);
}
private async Task Remove(long productId)
private async Task Remove(long cartId)
{
await CartService.Remove(productId);
await CartService.Remove(cartId);
}
private void ProceedCheckout()
@@ -29,7 +44,7 @@ public partial class Cart : ComponentBase, IDisposable
Navigation.NavigateTo(RouteConstants.Store.CheckoutSummary);
}
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
private static string FormatPrice(long price) => string.Format("{0:N0} ", price);
public void Dispose()
{