Table of Contents

Method TryResolveProposalAsync

Namespace
MailFathom.Application.Agent.Conversations
Assembly
MailFathom.Application.dll

TryResolveProposalAsync(AgentConversationId, UserId, long, AgentProposalState, DateTimeOffset, CancellationToken)

Records where a proposal this person was offered now stands.

Task<long?> TryResolveProposalAsync(AgentConversationId id, UserId user, long proposedAt, AgentProposalState state, DateTimeOffset now, CancellationToken cancellationToken)

Parameters

id AgentConversationId

The conversation holding the proposal.

user UserId

The person the caller was admitted for, and whose proposal it has to be.

proposedAt long

The place the offer was written at, which is what names it.

state AgentProposalState

Where it stands now, which is never Pending.

now DateTimeOffset

The instant the answer was given, in UTC.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<long?>

The place the answer was written at, or null when the move was refused.

Remarks

The move is judged against where the proposal stands, in the statement that records it: a pending proposal may be accepted or declined, an accepted one may go on to have failed, a failed one may be accepted again, and nothing else moves. So a proposal answered twice at once is answered once, which matters because an acceptance is what permits an act with a side effect — and one whose act could not be carried out is offered the attempt again rather than left to be proposed a second time.

A refusal is one answer for every way the move was not this caller's to make — no such conversation, not theirs, nothing offered at that place, or the proposal already somewhere this move cannot follow.

Exceptions

ArgumentOutOfRangeException

Thrown when proposedAt is not a written place, or when state is not a declared member.

ArgumentException

Thrown when state is Pending.