using EnotaryoPH.Web.Common.Hubs;
using Microsoft.AspNetCore.SignalR;

namespace EnotaryoPH.Web.Common.Services
{
    public class NotificationService
    {
        private readonly IHubContext<NotificationHub> _hubContext;

        public NotificationService(IHubContext<NotificationHub> hubContext) => _hubContext = hubContext;

        public async Task NotifyUserAsync(string user_UID, string message) => await _hubContext.Clients.All.SendAsync("ReceiveUserNotification", user_UID, message);
    }
}