Merge remote-tracking branch 'origin/stage' into stage

This commit is contained in:
masoodafar-web
2025-11-16 17:20:49 +03:30

View File

@@ -1,4 +1,4 @@
using CMSMicroservice.Domain.Events; using CMSMicroservice.Domain.Events;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
namespace CMSMicroservice.Application.OtpTokenCQ.Commands.VerifyOtpToken; namespace CMSMicroservice.Application.OtpTokenCQ.Commands.VerifyOtpToken;
public class VerifyOtpTokenCommandHandler : IRequestHandler<VerifyOtpTokenCommand, VerifyOtpTokenResponseDto> public class VerifyOtpTokenCommandHandler : IRequestHandler<VerifyOtpTokenCommand, VerifyOtpTokenResponseDto>
@@ -68,6 +68,8 @@ public class VerifyOtpTokenCommandHandler : IRequestHandler<VerifyOtpTokenComman
ParentId = parent.Id ParentId = parent.Id
}; };
await _context.Users.AddAsync(user, cancellationToken); await _context.Users.AddAsync(user, cancellationToken);
user.AddDomainEvent(new CreateNewUserEvent(user));
await _context.SaveChangesAsync(cancellationToken);
await _context.UserRoles.AddAsync(new() await _context.UserRoles.AddAsync(new()
{ {
UserId = user.Id, UserId = user.Id,