Interface IMailAccountCustodyStore
- Namespace
- MailFathom.Application.Accounts.Custody
- Assembly
- MailFathom.Application.dll
Persists what an administrator asked one account's custody to be, and how far the work of granting it has got.
public interface IMailAccountCustodyStore
Remarks
The requested value and the phase are two columns on the account rather than one, and they are written by different callers: an administrative command asks for a custody, and the account's own supervision moves the phase once the work that direction owes has been done. Neither may write the other's, which is what keeps a switch a period rather than an instant.
Every phase write is conditional on the phase it was decided from, because the account's supervision may move across
a lease handover: a replica that read Mirrored, spent a run draining, and then wrote Held would be
writing over whatever the replica that replaced it had since decided. See
ADR 0034.
Methods
- MovePhaseAsync(IPersistenceSession, MailAccountId, MailAccountCustodyPhase, MailAccountCustodyPhase, CancellationToken)
Moves one account's phase, but only from the phase it was decided from.
- ReadAsync(MailAccountId, CancellationToken)
Reads one account's custody, joining no transaction.
- RequestAsync(IPersistenceSession, MailAccountId, MailAccountCustody, CancellationToken)
Writes the custody an administrator asked for, leaving the phase where it stands.