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
idAgentConversationIdThe conversation holding the proposal.
userUserIdThe person the caller was admitted for, and whose proposal it has to be.
proposedAtlongThe place the offer was written at, which is what names it.
stateAgentProposalStateWhere it stands now, which is never Pending.
nowDateTimeOffsetThe instant the answer was given, in UTC.
cancellationTokenCancellationTokenCancels the write.
Returns
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
proposedAtis not a written place, or whenstateis not a declared member.- ArgumentException
Thrown when
stateis Pending.