Ajoute les amis et les invitations temps reel
This commit is contained in:
137
ChessCubing.Server/Social/SocialContracts.cs
Normal file
137
ChessCubing.Server/Social/SocialContracts.cs
Normal file
@@ -0,0 +1,137 @@
|
||||
namespace ChessCubing.Server.Social;
|
||||
|
||||
public sealed class SocialOverviewResponse
|
||||
{
|
||||
public SocialFriendResponse[] Friends { get; init; } = [];
|
||||
|
||||
public SocialInvitationResponse[] ReceivedInvitations { get; init; } = [];
|
||||
|
||||
public SocialInvitationResponse[] SentInvitations { get; init; } = [];
|
||||
}
|
||||
|
||||
public sealed class SocialFriendResponse
|
||||
{
|
||||
public string Subject { get; init; } = string.Empty;
|
||||
|
||||
public string Username { get; init; } = string.Empty;
|
||||
|
||||
public string DisplayName { get; init; } = string.Empty;
|
||||
|
||||
public string? Email { get; init; }
|
||||
|
||||
public string? Club { get; init; }
|
||||
|
||||
public string? City { get; init; }
|
||||
|
||||
public bool IsOnline { get; init; }
|
||||
}
|
||||
|
||||
public sealed class SocialInvitationResponse
|
||||
{
|
||||
public long InvitationId { get; init; }
|
||||
|
||||
public string Subject { get; init; } = string.Empty;
|
||||
|
||||
public string Username { get; init; } = string.Empty;
|
||||
|
||||
public string DisplayName { get; init; } = string.Empty;
|
||||
|
||||
public string? Email { get; init; }
|
||||
|
||||
public bool IsOnline { get; init; }
|
||||
|
||||
public DateTime CreatedUtc { get; init; }
|
||||
}
|
||||
|
||||
public sealed class SocialSearchUserResponse
|
||||
{
|
||||
public string Subject { get; init; } = string.Empty;
|
||||
|
||||
public string Username { get; init; } = string.Empty;
|
||||
|
||||
public string DisplayName { get; init; } = string.Empty;
|
||||
|
||||
public string? Email { get; init; }
|
||||
|
||||
public string? Club { get; init; }
|
||||
|
||||
public string? City { get; init; }
|
||||
|
||||
public bool IsOnline { get; init; }
|
||||
|
||||
public bool IsFriend { get; init; }
|
||||
|
||||
public bool HasSentInvitation { get; init; }
|
||||
|
||||
public bool HasReceivedInvitation { get; init; }
|
||||
}
|
||||
|
||||
public sealed class SendFriendInvitationRequest
|
||||
{
|
||||
public string TargetSubject { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
public sealed class PresenceSnapshotMessage
|
||||
{
|
||||
public string[] OnlineSubjects { get; init; } = [];
|
||||
}
|
||||
|
||||
public sealed class PresenceChangedMessage
|
||||
{
|
||||
public string Subject { get; init; } = string.Empty;
|
||||
|
||||
public bool IsOnline { get; init; }
|
||||
}
|
||||
|
||||
public sealed class PlayInviteMessage
|
||||
{
|
||||
public string InviteId { get; init; } = string.Empty;
|
||||
|
||||
public string SenderSubject { get; init; } = string.Empty;
|
||||
|
||||
public string SenderUsername { get; init; } = string.Empty;
|
||||
|
||||
public string SenderDisplayName { get; init; } = string.Empty;
|
||||
|
||||
public string RecipientSubject { get; init; } = string.Empty;
|
||||
|
||||
public string RecipientUsername { get; init; } = string.Empty;
|
||||
|
||||
public string RecipientDisplayName { get; init; } = string.Empty;
|
||||
|
||||
public string RecipientColor { get; init; } = string.Empty;
|
||||
|
||||
public DateTime CreatedUtc { get; init; }
|
||||
|
||||
public DateTime ExpiresUtc { get; init; }
|
||||
}
|
||||
|
||||
public sealed class PlayInviteClosedMessage
|
||||
{
|
||||
public string InviteId { get; init; } = string.Empty;
|
||||
|
||||
public string Reason { get; init; } = string.Empty;
|
||||
|
||||
public string Message { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
public sealed class PlaySessionResponse
|
||||
{
|
||||
public string SessionId { get; init; } = string.Empty;
|
||||
|
||||
public string WhiteSubject { get; init; } = string.Empty;
|
||||
|
||||
public string WhiteName { get; init; } = string.Empty;
|
||||
|
||||
public string BlackSubject { get; init; } = string.Empty;
|
||||
|
||||
public string BlackName { get; init; } = string.Empty;
|
||||
|
||||
public string InitiatorSubject { get; init; } = string.Empty;
|
||||
|
||||
public string RecipientSubject { get; init; } = string.Empty;
|
||||
|
||||
public DateTime ConfirmedUtc { get; init; }
|
||||
}
|
||||
|
||||
public sealed class SocialValidationException(string message) : Exception(message);
|
||||
Reference in New Issue
Block a user