Interface ICalendarEventStore
- Namespace
- MailFathom.Application.Calendar
- Assembly
- MailFathom.Application.dll
Keeps one person's calendar: what they put on it, and what mail proposed to it.
public interface ICalendarEventStore
Remarks
A calendar belongs to the person whose it is rather than to a mailbox, because a person with two mail accounts has one day. So every operation here names the owner beside whatever else it was given, and the store applies it rather than trusting the record it was handed: an identifier naming somebody else's event reaches a calendar that holds no such event, which makes a read, an amendment, and a deletion equally unable to be aimed across owners by a caller who learned an identifier elsewhere.
The three writes stage through the caller's session and commit nothing, as ADR 0001 requires of a write port: the caller decides the transaction, and the retry policy above it decides what a lost race means. The two reads join none, so they take no session.
Accepting a proposal is not an operation here. It is Accepted(DateTimeOffset) applied to the event and written back through ReplaceAsync(IPersistenceSession, UserId, CalendarEvent, CancellationToken), because what acceptance changes is the event rather than the store's idea of it — and dismissing one is DeleteAsync(IPersistenceSession, UserId, CalendarEventId, CancellationToken), since a proposal nobody wants is a row nobody is keeping.
Methods
- AddAsync(IPersistenceSession, UserId, CalendarEvent, CancellationToken)
Stages an event the calendar does not yet hold.
- DeleteAsync(IPersistenceSession, UserId, CalendarEventId, CancellationToken)
Removes one event of somebody's calendar outright, inside the caller's transaction.
- ReadAsync(UserId, CalendarEventId, CancellationToken)
Reads one event of somebody's calendar.
- ReadImportedUidsAsync(UserId, IReadOnlyCollection<ImportedCalendarEventUid>, CancellationToken)
Reports which of the stated imported identifiers somebody's calendar already holds.
- ReadRangeAsync(UserId, CalendarEventQuery, CancellationToken)
Reads the events of somebody's calendar that fall in one window, earliest first.
- ReplaceAsync(IPersistenceSession, UserId, CalendarEvent, CancellationToken)
Stages the held event being replaced by the one supplied.