Table of Contents

Class OwnNotifications

Namespace
MailFathom.Application.Notifications
Assembly
MailFathom.Application.dll

Reads and marks the signed-in person's own notification centre.

public sealed class OwnNotifications
Inheritance
OwnNotifications
Inherited Members

Remarks

Whose notifications these are comes from the principal rather than from the request, exactly as it does for the user record and the client preferences: there is no argument here for another user's identifier, so a reading of somebody else's centre is something a caller cannot express rather than something a surface has to refuse. A notification named by identifier is addressed with the user beside it, so one another person holds answers as one that does not exist.

The two reads are admitted under NotificationsRead and the three writes under NotificationsWrite. Neither is a grant over mail, because a notification is what this deployment drew for one person rather than anything in a mailbox: marking one read or taking it out of the centre reaches no mail server and leaves what it points at exactly where it is, so a person whose mail accounts an administrator maintains clears their own bell under a grant that says nothing about those accounts.

A page is bounded and the bound is clamped rather than refused, which is the one place this reading differs from every other paged one here. Those serve an operator composing a query by hand, where a page size out of range is a mistake worth naming; this serves a panel that asks for as much as it can draw, where the useful answer to "give me a thousand" is the most this deployment serves rather than an error a screen has to render instead of a list.

Constructors

OwnNotifications(AccessAuthorization, INotificationStore)

Initializes the use case.

Fields

DefaultPageSize

The page size a request that names none is served.

MaximumErasedAtOnce

The greatest number of notifications one erasure may name.

MaximumPageSize

The greatest page size one request is served, whatever it asked for.

Methods

CountUnreadAsync(CancellationToken)

Counts what the signed-in person has not read.

CountUnreadLeftAsync(CancellationToken)

Counts what a change to the centre left unread, for the answer that change is given.

EraseAsync(IReadOnlyCollection<NotificationId>, CancellationToken)

Erases the named notifications, of those the signed-in person holds.

MarkAllReadAsync(CancellationToken)

Marks every one of the signed-in person's unread notifications read.

ReadPageAsync(int?, string?, CancellationToken)

Reads one page of the signed-in person's notifications, newest first.

SetReadAsync(NotificationId, bool, CancellationToken)

Puts one of the signed-in person's notifications into a stated read state.