public async Task SaveVerificationResultAsync(SaveFCMomentResultRequest request, long autorId) { var fcMomentInfo = await fcMomentsRepository.GetAsync(request.Id); fcMomentInfo.InUse = false; fcMomentInfo.VerifierId = autorId; fcMomentInfo.VerificationTime = DateTime.UtcNow; fcMomentInfo.BestAnswerTime = TimeSpan.FromSeconds(request.BestAnswerTime); fcMomentInfo.SelectedAms = request.Result; fcMomentInfo.IsPerfect = request.IsPerfect; UnsubscribeFromReopenAudio(fcMomentInfo.Id); await transactionService.CommitAsync(new[] { TransactionContextScope.Main }, async() => { await fcMomentsRepository.UpdateAsync(fcMomentInfo); var filter = new WorkingPeriodFilter { AgentId = autorId, Type = LabelingType.FullConversationMoments, Action = LabelingAction.Verification }; await workingPeriodsService.SaveWorkingPeriodAsync(filter, request.SpentTime); }); }
public async Task SaveFCMomentVerificationResult([FromBody] SaveFCMomentResultRequest request) { var user = await userManager.GetUserAsync(HttpContext.User); await fcMomentsService.SaveVerificationResultAsync(request, user.Id); }