Table of Contents

Class ContactBookWriter

Namespace
MailFathom.Application.Contacts
Assembly
MailFathom.Application.dll

Writes to the contact book for a caller that was granted writing it.

public sealed class ContactBookWriter
Inheritance
ContactBookWriter
Inherited Members

Remarks

The four acts a caller performs on the book — record a person, amend one, erase one, promote one this deployment collected — each behind MailContactsWrite. The permission is asked for here rather than only at the transport, so an entrypoint added later cannot change what this deployment holds about somebody by arriving another way, and erasure is behind the same grant as the rest: a caller that may edit the book may take somebody out of it, and no smaller grant reaches an act that cannot be undone.

Every write acts under Asserted, because a caller granted this permission is writing for the owner: what an agent is told to record is a person somebody wrote down. What follows from it is the one refusal a caller meets that is about the record rather than about the request — amending a contact this deployment collected is refused until it has been promoted. Promotion is the fourth act for exactly that reason: leaving it to the administrative surface alone would put every collected record permanently out of this one's reach, so it is offered here as well and under the same grant.

The rules a record obeys are applied here rather than at whichever boundary the caller arrived by, so the book cannot be reached having checked fewer of them. Nothing here logs: a name, an address, and a note are personal data about a third party, and so is the fact that a particular person was written down.

Constructors

ContactBookWriter(ContactBook, AccessAuthorization)

Initializes the use case over the book it writes to and the authorization it asks first.

Methods

AmendAsync(ContactId, ContactRecordDraft, CancellationToken)

Amends one contact to the record the caller states.

EraseAsync(ContactId, CancellationToken)

Erases one person and everything the book derived from them.

PromoteAsync(ContactId, CancellationToken)

Takes on a contact this deployment collected, so it becomes one the owner asserted.

RecordAsync(ContactRecordDraft, CancellationToken)

Records a person the book does not yet hold.