/// <summary>
        ///     Execute a command asynchronously.
        /// </summary>
        /// <param name="command">Command to execute.</param>
        /// <returns>
        ///     Task which will be completed once the command has been executed.
        /// </returns>
        public async Task HandleAsync(IMessageContext context, UpdateNotifications command)
        {
            var settings = await _notificationsRepository.TryGetAsync(command.UserId, command.ApplicationId);

            if (settings == null)
            {
                settings = new UserNotificationSettings(command.UserId, command.ApplicationId);
                await _notificationsRepository.CreateAsync(settings);
            }

            settings.ApplicationSpike = command.NotifyOnPeaks.ConvertEnum <NotificationState>();
            settings.NewIncident      = command.NotifyOnNewIncidents.ConvertEnum <NotificationState>();
            settings.ReopenedIncident = command.NotifyOnReOpenedIncident.ConvertEnum <NotificationState>();
            settings.UserFeedback     = command.NotifyOnUserFeedback.ConvertEnum <NotificationState>();
            await _notificationsRepository.UpdateAsync(settings);
        }