Skip to content

Commit

Permalink
VM-1483: get or create communication user service method
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-buravlev committed Oct 30, 2024
1 parent c79d4e9 commit 6a060bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ public interface ICommunicationUserService
{
Task<CommunicationUser> CreateCommunicationUser(string userId, string userType);
Task<CommunicationUser> GetCommunicationUserByUserId(string userId, string userType);
Task<CommunicationUser> GetOrCreateCommunicationUser(string userId, string userType);
Task<IList<CommunicationUser>> SearchUsersByName(string userName, string userType);
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ public virtual async Task<CommunicationUser> GetCommunicationUserByUserId(string
return null;
}

public virtual async Task<CommunicationUser> GetOrCreateCommunicationUser(string userId, string userType)
{
var communicationUser = await GetCommunicationUserByUserId(userId, userType);
if (communicationUser == null)
{
communicationUser = await CreateCommunicationUser(userId, userType);
}

return communicationUser;
}

public virtual Task<IList<CommunicationUser>> SearchUsersByName(string userName, string userType)
{
throw new NotImplementedException();
Expand Down

0 comments on commit 6a060bc

Please sign in to comment.