namespace RelayShared.Services;

//TODO: review name of file, potentially rename for Encryption services rather than sockets

public sealed class SocketRtcSignalMessage
{
    public SignalType Type { get; set; }
    public string SenderUsername { get; set; } = string.Empty;
    public string ChannelId { get; set; } = string.Empty;
    public string CipherText { get; set; } = string.Empty;
    public string Nonce { get; set; } = string.Empty;
    public string Tag { get; set; } = string.Empty;
    public string EncryptedKey { get; set; } = string.Empty;
}

public sealed class SocketEncryptedMessage
{
    public SignalType Type { get; set; } = SignalType.EncryptedChat;
    public string SenderUsername { get; set; } = string.Empty;
    public string RecipientUsername { get; set; } = string.Empty;
    public string ChannelId { get; set; } = string.Empty;
    public string CipherText { get; set; } = string.Empty;
    public string Nonce { get; set; } = string.Empty;
    public string Tag { get; set; } = string.Empty;
    public string EncryptedKey { get; set; } = string.Empty;
}

public sealed class ServerPublicKeyMessage
{
    public SignalType Type { get; set; } = SignalType.ServerPublicKey;
    public string PublicKey { get; set; } = string.Empty;
}

public enum SignalType
{
    Offer,
    Answer,
    Candidate,
    OfferUpdated,
    AnswerUpdated,
    CandidateAdded,
    CallLeft,
    ChannelList,
    ServerPublicKey,
    EncryptedSignal,
    EncryptedChat,
    ClientEncryptedChat
}