Interface IStoredContentMoveStore
- Namespace
- MailFathom.Application.EmailContent.Move
- Assembly
- MailFathom.Application.dll
The database side of the move: what is still held here, what one payload holds, and where a moved one now points.
public interface IStoredContentMoveStore
Remarks
One contract rather than three, because the operations describe one restartable walk over the five content tables: which payloads come next, what one of them holds, where the row points once the object is verified, and how much is left. A caller holding only some of them could not make the walk terminate.
No operation here takes a persistence session, and that is the design rather than an omission. The move puts an object between reading a payload and repointing its row, so a session spanning the two would hold a database transaction open across a network call — which ADR 0001 forbids. Each operation is therefore its own unit of work, and the repoint is one statement whose own condition is what makes it safe to issue alone.
Methods
- CountPayloadsAwaitingMoveAsync(CancellationToken)
Counts what the database still holds, across every payload kind.
- FindPayloadAsync(EmailContentKind, Guid, CancellationToken)
Reads back the raw MIME one database-backed payload holds.
- GetPayloadsToMoveAsync(EmailContentKind, Guid?, int, CancellationToken)
Reads the next bounded batch of payloads of one kind that the database still holds.
- RepointAtObjectAsync(EmailContentKind, Guid, string, DateTimeOffset, CancellationToken)
Points one row at the verified object, leaving the payload the database was holding exactly where it is.