Class Notification
- Namespace
- MailFathom.Domain.Notifications
- Assembly
- MailFathom.Domain.dll
States one thing that happened to a person while nobody was looking at the screen.
public sealed record Notification : IEquatable<Notification>
- Inheritance
-
Notification
- Implements
- Inherited Members
Remarks
It belongs to the deployment rather than to a device, because the read state has to be the same in both heads and on
a second machine, and because most of what produces one is visible only to the service. It is per user, on the
(user, identifier) axis every account reference already uses.
It is a pointer plus the least it takes to draw a row, and never a second copy of the mailbox. The title and the body are derived when the notification is produced rather than by re-reading mail when it is displayed, which is what keeps the notification centre readable without opening anything — and what makes the record derived personal data with the same classification as the mail behind it. Nothing here holds a mail body, an attachment, an address, or credential material.
Being derived personal data decides the rest: a notification pointing at a message is erased with that message rather than swept for separately, it falls under the same erasure and export path as the mail it derives from, and it has a retention bound of its own so the table cannot become a mailbox history in miniature.
Fields
- MaximumBodyLength
The longest body stored, which is the row's second line rather than a message.
- MaximumSourceLength
The longest source stored, which is generous for an account identifier.
- MaximumTitleLength
The longest title stored, which is a headline rather than a sentence.
Properties
- Body
Gets the second line the row is drawn with.
- DeduplicationKey
Gets the condition it was raised for, which is what stops it being said twice while it is unread.
- Id
Gets what addresses this notification.
- IsRead
Gets whether the person has read it.
- Kind
Gets what part of MailFathom it is about.
- OccurredAt
Gets when the thing it describes happened.
- Statement
Gets what the notification says as a condition and its numbers, and null where the row names no condition.
- Target
Gets where opening it leads.
- Title
Gets the headline the row is drawn with.
- User
Gets the user it happened to.
Methods
- Compose(NotificationId, UserId, NotificationKind, string, string, NotificationStatement?, string?, NotificationTarget, NotificationDeduplicationKey, DateTimeOffset)
Composes a notification that has not been read.
- Restore(NotificationId, UserId, NotificationKind, string, string, NotificationStatement?, string?, NotificationTarget, NotificationDeduplicationKey, DateTimeOffset, bool)
Restores a notification this deployment already kept, with the read state it was stored under.