feat(platform): route scheduler notifications through platform messenger
PR Checks / test-and-build (pull_request) Successful in 7m9s
PR Checks / test-and-build (pull_request) Successful in 7m9s
This commit is contained in:
@@ -13,4 +13,22 @@ public interface IPlatformMessenger
|
||||
Task AnswerInteractionAsync(PlatformInteractionReply reply, CancellationToken ct);
|
||||
|
||||
Task SendCalendarFileAsync(PlatformCalendarFile file, CancellationToken ct);
|
||||
|
||||
Task<PlatformMessageRef> SendConfirmationRequestAsync(PlatformConfirmationRequest request, CancellationToken ct) =>
|
||||
throw new NotSupportedException("This platform messenger does not support confirmation requests.");
|
||||
|
||||
Task UpdateConfirmationRequestAsync(PlatformRsvpMessageUpdate update, CancellationToken ct) =>
|
||||
throw new NotSupportedException("This platform messenger does not support confirmation request updates.");
|
||||
|
||||
Task<PlatformMessageRef> SendJoinLinkNotificationAsync(PlatformJoinLinkNotification notification, CancellationToken ct) =>
|
||||
throw new NotSupportedException("This platform messenger does not support join-link notifications.");
|
||||
|
||||
Task SendDirectSessionNotificationAsync(PlatformDirectSessionNotification notification, CancellationToken ct) =>
|
||||
throw new NotSupportedException("This platform messenger does not support direct session notifications.");
|
||||
|
||||
Task SendRsvpOutcomeAsync(PlatformRsvpOutcomeNotification notification, CancellationToken ct) =>
|
||||
throw new NotSupportedException("This platform messenger does not support RSVP outcome notifications.");
|
||||
|
||||
Task UpdateRescheduleVoteAsync(PlatformRescheduleVoteUpdate update, CancellationToken ct) =>
|
||||
throw new NotSupportedException("This platform messenger does not support reschedule vote updates.");
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using GmRelay.Shared.Features.Sessions.RescheduleSession;
|
||||
using GmRelay.Shared.Rendering;
|
||||
|
||||
namespace GmRelay.Shared.Platform;
|
||||
@@ -34,3 +35,81 @@ public sealed record PlatformCalendarFile(
|
||||
byte[] Content,
|
||||
string CaptionHtml,
|
||||
IReadOnlyList<PlatformMessageAction> Actions);
|
||||
|
||||
public sealed record PlatformSessionParticipant(
|
||||
PlatformUser User,
|
||||
string RsvpStatus,
|
||||
string RegistrationStatus,
|
||||
bool IsGm = false);
|
||||
|
||||
public sealed record PlatformConfirmationRequest(
|
||||
PlatformGroup Group,
|
||||
Guid SessionId,
|
||||
string Title,
|
||||
DateTime ScheduledAt,
|
||||
IReadOnlyList<PlatformSessionParticipant> Participants,
|
||||
PlatformMessageRef? ExistingMessage = null);
|
||||
|
||||
public sealed record PlatformJoinLinkNotification(
|
||||
PlatformGroup Group,
|
||||
Guid SessionId,
|
||||
string Title,
|
||||
DateTime ScheduledAt,
|
||||
string JoinLink,
|
||||
IReadOnlyList<PlatformSessionParticipant> ConfirmedPlayers,
|
||||
PlatformMessageRef? ExistingMessage = null);
|
||||
|
||||
public enum PlatformDirectSessionNotificationKind
|
||||
{
|
||||
ConfirmationRequest = 0,
|
||||
OneHourReminder = 1,
|
||||
JoinLink = 2,
|
||||
RsvpAllConfirmed = 3,
|
||||
RsvpDeclined = 4,
|
||||
RescheduleApproved = 5,
|
||||
RescheduleRejected = 6
|
||||
}
|
||||
|
||||
public sealed record PlatformDirectSessionNotification(
|
||||
PlatformDirectSessionNotificationKind Kind,
|
||||
PlatformUser Recipient,
|
||||
Guid SessionId,
|
||||
string Title,
|
||||
DateTime ScheduledAt,
|
||||
string? JoinLink = null,
|
||||
string? ActorDisplayName = null,
|
||||
string? Reason = null);
|
||||
|
||||
public sealed record PlatformRsvpMessageUpdate(
|
||||
PlatformConfirmationRequest Request,
|
||||
bool DisableActions);
|
||||
|
||||
public enum PlatformRsvpOutcomeKind
|
||||
{
|
||||
GroupAllConfirmed = 0,
|
||||
GmAllConfirmed = 1,
|
||||
GmPlayerDeclined = 2
|
||||
}
|
||||
|
||||
public sealed record PlatformRsvpOutcomeNotification(
|
||||
PlatformRsvpOutcomeKind Kind,
|
||||
PlatformGroup? Group,
|
||||
IReadOnlyList<PlatformUser> Recipients,
|
||||
Guid SessionId,
|
||||
string Title,
|
||||
DateTime ScheduledAt,
|
||||
string? ActorDisplayName = null);
|
||||
|
||||
public sealed record PlatformRescheduleVoteUpdate(
|
||||
PlatformGroup Group,
|
||||
PlatformMessageRef ExistingMessage,
|
||||
Guid ProposalId,
|
||||
Guid SessionId,
|
||||
string Title,
|
||||
DateTime CurrentScheduledAt,
|
||||
DateTimeOffset VotingDeadlineAt,
|
||||
RescheduleVoteDecision Decision,
|
||||
RescheduleOptionDto? SelectedOption,
|
||||
IReadOnlyList<RescheduleOptionDto> Options,
|
||||
IReadOnlyList<RescheduleOptionVoteDto> Votes,
|
||||
IReadOnlyList<VoteParticipantDto> Participants);
|
||||
|
||||
Reference in New Issue
Block a user