refactor: Remove ICurrentUserService dependency from query handlers and update user ID handling logic
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 8s

This commit is contained in:
masoodafar-web
2026-02-10 23:01:49 +03:30
parent b42d9e141d
commit d1ca72300d
13 changed files with 77 additions and 95 deletions
@@ -57,8 +57,11 @@ public class UserWalletService : UserWalletContract.UserWalletContractBase
public override async Task<GetCustomerWalletResponse> GetCustomerWallet(Google.Protobuf.WellKnownTypes.Empty request, ServerCallContext context)
{
// Use GetUserWallet with Id=0 to automatically use current user from JWT
var walletQuery = new GetUserWalletQuery { Id = 0 };
// Customer endpoint: resolve userId from JWT
if (!long.TryParse(_currentUserService.UserId, out var userId) || userId <= 0)
throw new RpcException(new Status(StatusCode.Unauthenticated, "کاربر احراز هویت نشده است"));
var walletQuery = new GetUserWalletQuery { Id = userId };
var wallet = await _sender.Send(walletQuery, context.CancellationToken);
return new GetCustomerWalletResponse