This commit is contained in:
masoodafar-web
2025-11-25 03:03:47 +03:30
parent 90e260eb30
commit 970a5cdbc5
4 changed files with 18 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance; namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
public class WithdrawBalanceCommandHandler : IRequestHandler<WithdrawBalanceCommand, WithdrawBalanceResponseDto> public class WithdrawBalanceCommandHandler : IRequestHandler<WithdrawBalanceCommand, Unit>
{ {
private readonly IApplicationContractContext _context; private readonly IApplicationContractContext _context;
@@ -8,9 +8,9 @@ public class WithdrawBalanceCommandHandler : IRequestHandler<WithdrawBalanceComm
_context = context; _context = context;
} }
public async Task<WithdrawBalanceResponseDto> Handle(WithdrawBalanceCommand request, CancellationToken cancellationToken) public async Task<Unit> Handle(WithdrawBalanceCommand request, CancellationToken cancellationToken)
{ {
//TODO: Implement your business logic //TODO: Implement your business logic
return new WithdrawBalanceResponseDto(); return new Unit();
} }
} }

View File

@@ -1,26 +1,32 @@
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog; using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog; namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog;
public class GetAllUserWalletChangeLogQueryHandler : IRequestHandler<GetAllUserWalletChangeLogQuery, Unit>
public class
GetAllUserWalletChangeLogQueryHandler : IRequestHandler<GetAllUserWalletChangeLogQuery,
GetAllUserWalletChangeLogResponseDto>
{ {
private readonly IApplicationContractContext _context; private readonly IApplicationContractContext _context;
private readonly ICurrentUserService _currentUserService; private readonly ICurrentUserService _currentUserService;
public GetAllUserWalletChangeLogQueryHandler(IApplicationContractContext context, ICurrentUserService currentUserService) public GetAllUserWalletChangeLogQueryHandler(IApplicationContractContext context,
ICurrentUserService currentUserService)
{ {
_context = context; _context = context;
_currentUserService = currentUserService; _currentUserService = currentUserService;
} }
public async Task<Unit> Handle(GetAllUserWalletChangeLogQuery request, CancellationToken cancellationToken) public async Task<GetAllUserWalletChangeLogResponseDto> Handle(GetAllUserWalletChangeLogQuery request,
CancellationToken cancellationToken)
{ {
await _context.UserWalletChangeLog.GetAllUserWalletChangeLogByFilterAsync(new GetAllUserWalletChangeLogByFilterRequest() var result = await _context.UserWalletChangeLog.GetAllUserWalletChangeLogByFilterAsync(
new GetAllUserWalletChangeLogByFilterRequest()
{ {
Filter = new GetAllUserWalletChangeLogByFilterFilter() Filter = new GetAllUserWalletChangeLogByFilterFilter()
{ {
UserId = _currentUserService.UserId.Value UserId = _currentUserService.UserId.Value
} }
}, cancellationToken: cancellationToken); }, cancellationToken: cancellationToken);
return new Unit(); return result.Adapt<GetAllUserWalletChangeLogResponseDto>();
} }
} }

View File

@@ -1,9 +1,10 @@
using FrontOffice.BFF.Protobuf.Protos.UserWallet;
using FrontOffice.BFF.WebApi.Common.Services; using FrontOffice.BFF.WebApi.Common.Services;
using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog; using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog;
using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet; using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet;
using FrontOffice.BFF.Application.UserWalletCQ.Commands.TransferUserWalletBallance; using FrontOffice.BFF.Application.UserWalletCQ.Commands.TransferUserWalletBallance;
using FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance; using FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
using FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet;
namespace FrontOffice.BFF.WebApi.Services; namespace FrontOffice.BFF.WebApi.Services;
public class UserWalletService : UserWalletContract.UserWalletContractBase public class UserWalletService : UserWalletContract.UserWalletContractBase
{ {

View File

@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>0.0.112</Version> <Version>0.0.113</Version>
<DebugType>None</DebugType> <DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild> <GeneratePackageOnBuild>False</GeneratePackageOnBuild>