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;
@@ -9,7 +10,7 @@ public partial class OrderDetail : ComponentBase
[Parameter] public long id { get; set; }
private Order? _order;
private GetUserOrderResponse? _order;
private bool _loading;
protected override async Task OnParametersSetAsync()
@@ -20,10 +21,26 @@ public partial class OrderDetail : ComponentBase
}
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
private static string GetStatusText(OrderStatus status) => status switch
private string GetStatusText(PaymentStatus orderPaymentStatus)
{
OrderStatus.Paid => "پرداخت‌شده",
_ => "در انتظار",
};
return orderPaymentStatus switch
{
PaymentStatus.Pending => "در انتظار پرداخت",
PaymentStatus.Success => "پرداخت شده",
PaymentStatus.Reject => "پرداخت ناموفق",
_ => "نامشخص",
};
}
private string GetPaymentMethodText(PaymentMethod orderPaymentMethod)
{
return orderPaymentMethod switch
{
PaymentMethod.Wallet => "کیف پول",
PaymentMethod.Ipg => "درگاه پرداخت اینترنتی",
_ => "نامشخص",
};
}
}