public async Task <TestingPersonnelInvitationConfirmedShiftsDto> ConfirmInvitationAsync(TestingPersonnelInvitationConfirmDto confirmDto)
        {
            if (confirmDto == null)
            {
                throw new ArgumentNullException(nameof(confirmDto));
            }

            var testingPersonnelAndInvitationData = await _invitationConfirmationTokensRepository
                                                    .GetTestingPersonnelAndInvitationByConfirmationTokenAsync(confirmDto.Token)
                                                    .ConfigureAwait(false);

            if (testingPersonnelAndInvitationData == null)
            {
                ValidationDictionary
                .AddModelError("The token is not valid", $"The provided token has been already used or doesn't exist.");

                return(null);
            }

            var doesConfirmationExist = await _testingPersonnelConfirmationsRepository
                                        .CheckIfConfirmationExistsForInvitationAndTestingPersonnelAsync(testingPersonnelAndInvitationData.InvitationId, testingPersonnelAndInvitationData.TestingPersonnelId)
                                        .ConfigureAwait(false);

            if (doesConfirmationExist)
            {
                ValidationDictionary
                .AddModelError("Confirmation already exists", $"Confirmation for this invitation already exists.");

                await _invitationConfirmationTokensRepository
                .DisposeInvitationConfirmationToken(confirmDto.Token)
                .ConfigureAwait(false);

                return(null);
            }

            var testingPersonnelConfirmSpecDto = new TestingPersonnelConfirmationSpecDto
            {
                InvitationId = testingPersonnelAndInvitationData.InvitationId,
                PersonnelId  = testingPersonnelAndInvitationData.TestingPersonnelId,
                ShiftNumbers = confirmDto.Shifts
            };

            var shiftsBooked = await _testingPersonnelConfirmationsRepository
                               .AddConfirmationOfInvitationAsync(testingPersonnelConfirmSpecDto)
                               .ConfigureAwait(false);

            await _invitationConfirmationTokensRepository
            .DisposeInvitationConfirmationToken(confirmDto.Token)
            .ConfigureAwait(false);

            if (shiftsBooked.ShiftsBooked.Any())
            {
                await _mailSender
                .SendConfirmationForPoolingAssignmentAsync(testingPersonnelAndInvitationData.Email,
                                                           testingPersonnelAndInvitationData.InvitationDate, shiftsBooked.ShiftsBooked)
                .ConfigureAwait(false);
            }

            return(shiftsBooked);
        }