Revert "PM-18939 refactoring send service to 'cqrs' (#5652)"

This reverts commit 818934487f.
This commit is contained in:
✨ Audrey ✨
2025-06-11 15:26:00 -04:00
parent 1f9849da10
commit 0eeea7df63
32 changed files with 1346 additions and 2204 deletions

View File

@@ -12,17 +12,17 @@ namespace Bit.Api.KeyManagement.Validators;
/// </summary>
public class SendRotationValidator : IRotationValidator<IEnumerable<SendWithIdRequestModel>, IReadOnlyList<Send>>
{
private readonly ISendAuthorizationService _sendAuthorizationService;
private readonly ISendService _sendService;
private readonly ISendRepository _sendRepository;
/// <summary>
/// Instantiates a new <see cref="SendRotationValidator"/>
/// </summary>
/// <param name="sendAuthorizationService">Enables conversion of <see cref="SendWithIdRequestModel"/> to <see cref="Send"/></param>
/// <param name="sendService">Enables conversion of <see cref="SendWithIdRequestModel"/> to <see cref="Send"/></param>
/// <param name="sendRepository">Retrieves all user <see cref="Send"/>s</param>
public SendRotationValidator(ISendAuthorizationService sendAuthorizationService, ISendRepository sendRepository)
public SendRotationValidator(ISendService sendService, ISendRepository sendRepository)
{
_sendAuthorizationService = sendAuthorizationService;
_sendService = sendService;
_sendRepository = sendRepository;
}
@@ -44,7 +44,7 @@ public class SendRotationValidator : IRotationValidator<IEnumerable<SendWithIdRe
throw new BadRequestException("All existing sends must be included in the rotation.");
}
result.Add(send.ToSend(existing, _sendAuthorizationService));
result.Add(send.ToSend(existing, _sendService));
}
return result;