baa25f2e1e
PR Checks / test-and-build (pull_request) Successful in 7m6s
- Add V020 migration: player_links + identity_audit_log tables - Add ISessionStore methods: ResolveEffectivePlayerId, LinkIdentity, UnlinkIdentity, GetLinkedIdentities - Update SessionService to resolve effective player id for all permission checks - Add /auth/discord/callback linking flow when already authenticated - Add /api/me/identities GET/DELETE endpoints - Add Profile.razor page for managing linked accounts - Update NavMenu with profile link and v3.0.0 badge - Bump version to 3.0.0 across all files Bump version → 3.0.0 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
72 lines
3.8 KiB
C#
72 lines
3.8 KiB
C#
using GmRelay.Shared.Domain;
|
|
|
|
namespace GmRelay.Web.Services;
|
|
|
|
public sealed record PlayerAttendanceStats(
|
|
Guid PlayerId,
|
|
string DisplayName,
|
|
string? ExternalUsername,
|
|
long TotalSessions,
|
|
long ConfirmedCount,
|
|
long DeclinedCount,
|
|
long NoResponseCount,
|
|
long WaitlistedCount,
|
|
long CancellationAffectedCount,
|
|
decimal AttendanceRate);
|
|
|
|
public sealed record SessionAuditLogEntry(
|
|
Guid Id,
|
|
Guid SessionId,
|
|
string ActorExternalUserId,
|
|
string ActorName,
|
|
string ChangeType,
|
|
string? OldValue,
|
|
string? NewValue,
|
|
DateTime ChangedAt);
|
|
|
|
public interface ISessionStore
|
|
{
|
|
Task<List<WebGameGroup>> GetGroupsForUserAsync(string platform, string externalUserId);
|
|
Task<WebGameGroup?> GetGroupAsync(Guid groupId);
|
|
Task<bool> IsGroupManagerAsync(Guid groupId, string platform, string externalUserId);
|
|
Task<bool> IsGroupOwnerAsync(Guid groupId, string platform, string externalUserId);
|
|
Task<List<WebGroupManager>> GetGroupManagersAsync(Guid groupId);
|
|
Task<List<WebSession>> GetUpcomingSessionsAsync(Guid groupId);
|
|
Task<WebSession?> GetSessionAsync(Guid sessionId);
|
|
Task<WebSessionBatch?> GetBatchAsync(Guid batchId);
|
|
Task UpdateSessionAsync(Guid sessionId, Guid groupId, string title, DateTime scheduledAt, string joinLink, int? maxPlayers);
|
|
Task PromoteWaitlistedPlayerAsync(Guid sessionId, Guid groupId);
|
|
Task UpdateBatchDetailsAsync(Guid batchId, Guid groupId, string title, string joinLink);
|
|
Task UpdateBatchNotificationModeAsync(Guid batchId, Guid groupId, SessionNotificationMode notificationMode);
|
|
Task RescheduleBatchAsync(Guid batchId, Guid groupId, DateTime firstScheduledAt, int intervalDays);
|
|
Task<WebSessionBatch> CloneBatchAsync(Guid batchId, Guid groupId, BatchCloneInterval interval);
|
|
Task<List<WebCampaignTemplate>> GetCampaignTemplatesAsync(Guid groupId);
|
|
Task<WebCampaignTemplate?> GetCampaignTemplateAsync(Guid templateId);
|
|
Task<WebCampaignTemplate> CreateCampaignTemplateAsync(Guid groupId, CreateCampaignTemplateRequest request);
|
|
Task DeleteCampaignTemplateAsync(Guid templateId, Guid groupId);
|
|
Task<WebSessionBatch> CreateBatchFromTemplateAsync(Guid templateId, Guid groupId, DateTime firstScheduledAt);
|
|
Task AddGroupCoGmAsync(Guid groupId, string ownerPlatform, string ownerExternalUserId, string coGmPlatform, string coGmExternalUserId, string displayName, string? externalUsername);
|
|
Task RemoveGroupCoGmAsync(Guid groupId, string coGmPlatform, string coGmExternalUserId);
|
|
Task<List<WebParticipant>> GetSessionParticipantsAsync(Guid sessionId);
|
|
Task RemovePlayerFromSessionAsync(Guid sessionId, Guid groupId, Guid participantId);
|
|
Task<List<PlayerAttendanceStats>> GetGroupAttendanceStatsAsync(Guid groupId);
|
|
Task LogSessionChangeAsync(Guid sessionId, string actorExternalUserId, string actorName, string changeType, string? oldValue, string? newValue);
|
|
Task<List<SessionAuditLogEntry>> GetSessionHistoryAsync(Guid sessionId);
|
|
Task UpsertDiscordUserAsync(string discordId, string displayName, string? avatarUrl);
|
|
|
|
// --- Identity linking (issue #35) ---
|
|
Task<Guid?> ResolveEffectivePlayerIdAsync(string platform, string externalUserId);
|
|
Task<List<LinkedIdentity>> GetLinkedIdentitiesAsync(string platform, string externalUserId);
|
|
Task LinkIdentityAsync(string currentPlatform, string currentExternalUserId, string targetPlatform, string targetExternalUserId, string? currentName);
|
|
Task UnlinkIdentityAsync(string currentPlatform, string currentExternalUserId, string targetPlatform, string targetExternalUserId);
|
|
Task UpsertPlayerAsync(string platform, string externalUserId, string displayName, string? avatarUrl);
|
|
}
|
|
|
|
public sealed record LinkedIdentity(
|
|
string Platform,
|
|
string ExternalUserId,
|
|
string DisplayName,
|
|
string? ExternalUsername,
|
|
string? AvatarUrl,
|
|
DateTime LinkedAt);
|