littleshop/LittleShop/Services/IPushNotificationService.cs
2025-09-01 06:01:05 +01:00

24 lines
1.2 KiB
C#

using LittleShop.DTOs;
using LittleShop.Models;
namespace LittleShop.Services;
public interface IPushNotificationService
{
Task<bool> SubscribeUserAsync(Guid userId, PushSubscriptionDto subscriptionDto, string? userAgent = null, string? ipAddress = null);
Task<bool> SubscribeCustomerAsync(Guid customerId, PushSubscriptionDto subscriptionDto, string? userAgent = null, string? ipAddress = null);
Task<bool> UnsubscribeAsync(string endpoint);
Task<bool> SendNotificationToUserAsync(Guid userId, PushNotificationDto notification);
Task<bool> SendNotificationToCustomerAsync(Guid customerId, PushNotificationDto notification);
Task<bool> SendNotificationToAllUsersAsync(PushNotificationDto notification);
Task<bool> SendNotificationToAllCustomersAsync(PushNotificationDto notification);
Task<bool> SendOrderNotificationAsync(Guid orderId, string title, string body);
Task<bool> SendTestNotificationAsync(string? userId = null, string title = "Test Notification", string body = "This is a test notification from LittleShop");
Task<int> CleanupExpiredSubscriptionsAsync();
Task<List<Models.PushSubscription>> GetActiveSubscriptionsAsync();
string GetVapidPublicKey();
}