using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GB5Shared.DTO.PushNotification;
using GB5Shared.DTO.Framework.Login;
namespace GB5Shared.PushNotification
{
public interface IPushNotificationDAL
{
///
/// Saves a user’s Firebase device token
///
/// The user’s login context and details.
/// The device token to save.
/// A message indicating success or failure.
Task SaveUserToken(LoginDTO loginDTO, string token);
///
/// Subscribes a user’s device token to a specific Firebase topic.
/// Example topics: “DEV”, “Payroll”, “Announcements”.
///
/// The user’s Firebase device token.
/// The topic name to subscribe the user to.
/// A message indicating subscription success or failure.
Task SubscribeUserToTopic(string token, string topic);
///
/// Sends a push notification to all users subscribed to a specific Firebase topic.
///
/// The notification data including topic, title, and body.
///
/// A message indicating success with the Firebase message ID, or an error message on failure.
///
Task SendNotificationToTopic(PushNotificationDTO pushNotificationDTO);
///
/// Sends a push notification to one or multiple users based on their stored tokens.
///
/// The notification data including user IDs, title, and body.
///
/// A message summarizing how many notifications were successfully sent or skipped.
///
Task SendNotificationToUsers(PushNotificationDTO pushNotificationDTO);
}
public class UserTokenCache
{
public string Token { get; set; }
public DateTime Expiration { get; set; }
public int UserId { get; set; }
public int ServerId { get; set; }
public string DatabaseName { get; set; }
public long LoginEventLogId { get; set; }
}
public class UserKeysCache
{
public List Keys { get; set; } = new List();
}
}