feat: implement PmUserQueryService and integrate into AccountApplication for user ID retrieval

This commit is contained in:
2025-12-13 18:38:08 +03:30
parent a4bf6c952d
commit 58816ca383
5 changed files with 42 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
using GozareshgirProgramManager.Application.Modules.Users.Queries.GetSingleUser;
using MediatR;
using Shared.Contracts.PmUser;
namespace GozareshgirProgramManager.Infrastructure.Services.User;
public class PmUserQueryService : IPmUserQueryService
{
public readonly IMediator _mediator;
public PmUserQueryService(IMediator mediator)
{
_mediator = mediator;
}
public async Task<long?> GetCurrentPmUserIdFromAccountId(long accountId)
{
var query = new GetSingleUserQuery(accountId.ToString());
var result = await _mediator.Send(query);
return result.Data?.AccountId ?? null;
}
}