/// <summary>
        /// Информирование операторов о изменении поля локации
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="caseFolderId"></param>
        /// <param name="fieldType"></param>
        /// <returns></returns>
        public async Task <Result> SetActiveLocationFieldAsync(Guid userId, Guid caseFolderId,
                                                               CoordinateFieldType fieldType)
        {
            await _phoneHubMessageService.NotifyClientsAboutLocationActiveFieldAsync(userId, caseFolderId, fieldType);

            return(Result.Success());
        }
        public async Task <demoResult> SetActiveField(Guid caseFolderId, CoordinateFieldType fieldType)
        {
            if (fieldType == CoordinateFieldType.Undefined || caseFolderId == default)
            {
                _logger.Warning($"Model not valid");
                return(BadRequest(ErrorCodes.ValidationError));
            }

            var result = await _caseService.SetActiveLocationFieldAsync(GetUserId(), caseFolderId, fieldType);

            if (result.IsFailure)
            {
                _logger.Warning(result.ErrorMessage);
                return(BadRequest(result.ErrorCode));
            }

            return(Ok());
        }
 /// <summary>
 /// Оповестить клиентов об изменении полей с координатами.
 /// </summary>
 public async Task NotifyClientsAboutLocationActiveFieldAsync(Guid userId, Guid caseFolderId, CoordinateFieldType coordinateFieldType)
 {
     await _phoneHubContext.Clients.All.SendAsync("OnActiveLocationFieldUpdated",
                                                  new
     {
         OperatorId   = userId,
         CaseFolderId = caseFolderId,
         FieldType    = coordinateFieldType,
     });
 }