using System.Threading.Tasks;
using Abp.Domain.Entities;
using Abp.Runtime.Session;
namespace Abp.Notifications
{
///
/// Used to publish notifications.
///
public interface INotificationPublisher
{
///
/// Publishes a new notification.
///
/// Unique notification name
/// Notification data (optional)
/// The entity identifier if this notification is related to an entity
/// Notification severity
///
/// Target user id(s).
/// Used to send notification to specific user(s) (without checking the subscription).
/// If this is null/empty, the notification is sent to subscribed users.
///
///
/// Excluded user id(s).
/// This can be set to exclude some users while publishing notifications to subscribed users.
/// It's normally not set if is set.
///
///
/// Target tenant id(s).
/// Used to send notification to subscribed users of specific tenant(s).
/// This should not be set if is set.
/// can be passed to indicate all tenants.
/// But this can only work in a single database approach (all tenants are stored in host database).
/// If this is null, then it's automatically set to the current tenant on .
///
Task PublishAsync(
string notificationName,
NotificationData data = null,
EntityIdentifier entityIdentifier = null,
NotificationSeverity severity = NotificationSeverity.Info,
UserIdentifier[] userIds = null,
UserIdentifier[] excludedUserIds = null,
int?[] tenantIds = null);
}
}