Refactor: Update Protobuf references to CMSMicroservice across multiple components
- Changed Protobuf imports from FrontOffice.BFF to CMSMicroservice in Profile components (EditAddressDialog, Index, PaymentCallback, Personal, Settings). - Updated CheckoutSummary, OrderDetail, OrderTracking, and Orders pages to use new UserOrder Protobuf definitions. - Refactored WalletService, PackageService, and other utility services to align with new Protobuf structure. - Adjusted appsettings.json for local development URL. - Removed unused validators and simplified validation logic in AuthDialog. - Enhanced ClubMembershipContractDialog to utilize new OtpToken service for OTP handling.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder
|
||||
@using CMSMicroservice.Protobuf.Protos.UserOrder
|
||||
@using CMSMicroservice.Protobuf.Protos
|
||||
@attribute [Route(RouteConstants.Store.CheckoutSummary)]
|
||||
|
||||
<PageTitle>خلاصه خرید</PageTitle>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress;
|
||||
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
using Messages = CMSMicroservice.Protobuf.Protos;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Store;
|
||||
|
||||
@@ -20,7 +21,7 @@ public partial class CheckoutSummary : ComponentBase
|
||||
private bool _loadingAddresses;
|
||||
private long walletBalance;
|
||||
|
||||
private PaymentMethod _payment = PaymentMethod.Wallet;
|
||||
private Messages.PaymentMethod _payment = Messages.PaymentMethod.Wallet;
|
||||
|
||||
private bool CanPlaceOrder => Cart.Items.Count > 0 && _selectedAddress != null;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Messages = CMSMicroservice.Protobuf.Protos;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Store;
|
||||
|
||||
@@ -22,23 +23,23 @@ public partial class OrderDetail : ComponentBase
|
||||
|
||||
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
|
||||
|
||||
private string GetStatusText(PaymentStatus orderPaymentStatus)
|
||||
private string GetStatusText(Messages.PaymentStatus orderPaymentStatus)
|
||||
{
|
||||
return orderPaymentStatus switch
|
||||
{
|
||||
PaymentStatus.Pending => "در انتظار پرداخت",
|
||||
PaymentStatus.Success => "پرداخت شده",
|
||||
PaymentStatus.Reject => "پرداخت ناموفق",
|
||||
Messages.PaymentStatus.Pending => "در انتظار پرداخت",
|
||||
Messages.PaymentStatus.Success => "پرداخت شده",
|
||||
Messages.PaymentStatus.Reject => "پرداخت ناموفق",
|
||||
_ => "نامشخص",
|
||||
};
|
||||
}
|
||||
|
||||
private string GetPaymentMethodText(PaymentMethod orderPaymentMethod)
|
||||
private string GetPaymentMethodText(Messages.PaymentMethod orderPaymentMethod)
|
||||
{
|
||||
return orderPaymentMethod switch
|
||||
{
|
||||
PaymentMethod.Wallet => "کیف پول",
|
||||
PaymentMethod.Ipg => "درگاه پرداخت اینترنتی",
|
||||
Messages.PaymentMethod.Wallet => "کیف پول",
|
||||
Messages.PaymentMethod.Ipg => "درگاه پرداخت اینترنتی",
|
||||
_ => "نامشخص",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder
|
||||
@using CMSMicroservice.Protobuf.Protos.UserOrder
|
||||
@attribute [Route(RouteConstants.Store.OrderTracking + "{id:long}")]
|
||||
|
||||
<PageTitle>پیگیری سفارش</PageTitle>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Messages = CMSMicroservice.Protobuf.Protos;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Store;
|
||||
|
||||
@@ -45,7 +46,7 @@ public partial class OrderTracking : ComponentBase
|
||||
if (_order is null) return;
|
||||
|
||||
// Build tracking steps based on PaymentStatus
|
||||
var isPaid = _order.PaymentStatus == PaymentStatus.Success;
|
||||
var isPaid = _order.PaymentStatus == Messages.PaymentStatus.Success;
|
||||
|
||||
_trackingSteps = new List<TrackingStep>
|
||||
{
|
||||
@@ -107,10 +108,10 @@ public partial class OrderTracking : ComponentBase
|
||||
return $"{persianCalendar.GetYear(date)}/{persianCalendar.GetMonth(date):00}/{persianCalendar.GetDayOfMonth(date):00}";
|
||||
}
|
||||
|
||||
private static string GetPaymentMethodText(PaymentMethod method) => method switch
|
||||
private static string GetPaymentMethodText(Messages.PaymentMethod method) => method switch
|
||||
{
|
||||
PaymentMethod.Ipg => "پرداخت آنلاین",
|
||||
PaymentMethod.Wallet => "کیف پول",
|
||||
Messages.PaymentMethod.Ipg => "پرداخت آنلاین",
|
||||
Messages.PaymentMethod.Wallet => "کیف پول",
|
||||
_ => "نامشخص"
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Messages = CMSMicroservice.Protobuf.Protos;
|
||||
using MudBlazor;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Store;
|
||||
@@ -45,13 +46,13 @@ public partial class Orders : ComponentBase
|
||||
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
|
||||
|
||||
|
||||
private string GetStatusText(PaymentStatus contextPaymentStatus)
|
||||
private string GetStatusText(Messages.PaymentStatus contextPaymentStatus)
|
||||
{
|
||||
return contextPaymentStatus switch
|
||||
{
|
||||
PaymentStatus.Pending => "در انتظار پرداخت",
|
||||
PaymentStatus.Success => "پرداخت شده",
|
||||
PaymentStatus.Reject => "پرداخت ناموفق",
|
||||
Messages.PaymentStatus.Pending => "در انتظار پرداخت",
|
||||
Messages.PaymentStatus.Success => "پرداخت شده",
|
||||
Messages.PaymentStatus.Reject => "پرداخت ناموفق",
|
||||
_ => "نامشخص",
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user