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:
masoodafar-web
2026-02-03 00:02:16 +03:30
parent 26ce7fd2b6
commit eab978188a
40 changed files with 261 additions and 258 deletions
+14 -13
View File
@@ -1,5 +1,6 @@
using DateTimeConverterCL;
using FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet;
using CMSMicroservice.Protobuf.Protos.UserWallet;
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
using Google.Protobuf.WellKnownTypes;
namespace FrontOffice.Main.Utilities;
@@ -16,9 +17,9 @@ public record WithdrawalSettings(long MinWithdrawalAmount);
public class WalletService
{
private readonly UserWalletContract.UserWalletContractClient _client;
private readonly CMSMicroservice.Protobuf.Protos.UserWallet.UserWalletContract.UserWalletContractClient _client;
public WalletService(UserWalletContract.UserWalletContractClient client)
public WalletService(CMSMicroservice.Protobuf.Protos.UserWallet.UserWalletContract.UserWalletContractClient client)
{
_client = client;
}
@@ -27,7 +28,7 @@ public class WalletService
{
try
{
var response = await _client.GetUserWalletAsync(new Empty());
var response = await _client.GetCustomerWalletAsync(new Empty());
return new WalletBalances(response.Balance, response.DiscountBalance, response.NetworkBalance);
}
catch
@@ -41,7 +42,7 @@ public class WalletService
{
try
{
var request = new GetAllUserWalletChangeLogRequest();
var request = new GetCustomerWalletChangeLogRequest();
if (referenceId.HasValue)
{
request.ReferenceId = referenceId.Value;
@@ -50,7 +51,7 @@ public class WalletService
{
request.IsIncrease = isIncrease.Value;
}
var response = await _client.GetAllUserWalletChangeLogAsync(request);
var response = await _client.GetCustomerWalletChangeLogAsync(request);
return response.Models
.Select(t => new WalletTransaction(
ResolveTransactionDate(t),
@@ -67,7 +68,7 @@ public class WalletService
}
}
private static string ResolveTransactionDate(GetAllUserWalletChangeLogResponseModel model)
private static string ResolveTransactionDate(CustomerWalletChangeLogModel model)
{
if (model.CreatedAt is not null)
{
@@ -84,7 +85,7 @@ public class WalletService
return DateTime.Now.MiladiToJalaliWithTime();
}
private static string ResolveDescription(GetAllUserWalletChangeLogResponseModel model)
private static string ResolveDescription(CustomerWalletChangeLogModel model)
{
if (model.ChangeValue > 0) return "شارژ کیف پول";
if (model.ChangeValue < 0) return "برداشت/خرید";
@@ -93,7 +94,7 @@ public class WalletService
public async Task<bool> RequestWithdrawalAsync(long payoutId, WithdrawalMethodClient method, string? iban)
{
var request = new WithdrawBalanceRequest
var request = new CustomerWithdrawBalanceRequest
{
PayoutId = payoutId,
WithdrawalMethod = (int)method
@@ -104,7 +105,7 @@ public class WalletService
}
try
{
await _client.WithdrawBalanceAsync(request);
await _client.CustomerWithdrawBalanceAsync(request);
return true;
}
catch (Grpc.Core.RpcException ex)
@@ -117,13 +118,13 @@ public class WalletService
{
try
{
var request = new GetUserWithdrawalsRequest();
var request = new GetCustomerWithdrawalsRequest();
if (status.HasValue)
{
request.Status = status.Value;
}
var response = await _client.GetUserWithdrawalsAsync(request);
var response = await _client.GetCustomerWithdrawalsAsync(request);
return response.Models
.Select(m => new WalletWithdrawal(
m.Id,
@@ -146,7 +147,7 @@ public class WalletService
{
try
{
var response = await _client.GetWithdrawalSettingsAsync(new Empty());
var response = await _client.GetCustomerWithdrawalSettingsAsync(new Empty());
return new WithdrawalSettings(response.MinWithdrawalAmount);
}
catch