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

View File

@@ -1,3 +1,4 @@
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
using FrontOffice.Main.Utilities;
using Microsoft.AspNetCore.Components;
@@ -7,7 +8,7 @@ public partial class Orders : ComponentBase
{
[Inject] private OrderService OrderService { get; set; } = default!;
private List<Order> _orders = new();
private List<GetUserOrderResponse> _orders = new();
private bool _loading;
protected override async Task OnInitializedAsync()
@@ -18,10 +19,17 @@ public partial class Orders : ComponentBase
}
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
private static string GetStatusText(OrderStatus status) => status switch
private string GetStatusText(PaymentStatus contextPaymentStatus)
{
OrderStatus.Paid => "پرداخت‌شده",
_ => "در انتظار",
};
return contextPaymentStatus switch
{
PaymentStatus.Pending => "در انتظار پرداخت",
PaymentStatus.Success => "پرداخت شده",
PaymentStatus.Reject => "پرداخت ناموفق",
_ => "نامشخص",
};
}
}