54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using QMax.Api.Data.Entities;
|
|
|
|
namespace QMax.Api.Contracts;
|
|
|
|
public sealed record ChatDto(
|
|
Guid Id,
|
|
string? ExternalId,
|
|
ChatKind Kind,
|
|
string Title,
|
|
string? AvatarUrl,
|
|
string? LastMessagePreview,
|
|
DateTimeOffset? LastMessageAt,
|
|
int UnreadCount,
|
|
bool IsPinned,
|
|
bool IsMuted,
|
|
bool IsArchived);
|
|
|
|
public sealed record MessageDto(
|
|
Guid Id,
|
|
Guid ChatId,
|
|
string? ExternalId,
|
|
string? SenderName,
|
|
MessageDirection Direction,
|
|
string? Text,
|
|
DateTimeOffset SentAt,
|
|
DateTimeOffset? EditedAt,
|
|
DateTimeOffset? DeletedAt,
|
|
Guid? ReplyToMessageId,
|
|
string? ForwardedFrom,
|
|
MessageDeliveryState DeliveryState,
|
|
string? Error,
|
|
IReadOnlyList<ReactionDto> Reactions,
|
|
IReadOnlyList<AttachmentDto> Attachments);
|
|
|
|
public sealed record ReactionDto(string Emoji, int Count, bool ReactedByMe);
|
|
|
|
public sealed record AttachmentDto(
|
|
Guid Id,
|
|
string FileName,
|
|
string ContentType,
|
|
long FileSizeBytes,
|
|
string DownloadPath,
|
|
AttachmentKind Kind,
|
|
int SortOrder);
|
|
|
|
public sealed record SendMessageRequest(string Text, Guid? ReplyToMessageId = null);
|
|
public sealed record EditMessageRequest(string Text);
|
|
public sealed record ForwardMessageRequest(Guid TargetChatId);
|
|
public sealed record SetReactionRequest(string Emoji);
|
|
public sealed record MessageDeletedDto(Guid ChatId, Guid MessageId);
|
|
public sealed record CreateDirectChatRequest(string ExternalChatId, string Title, string? AvatarUrl = null);
|
|
|
|
public sealed record ChatPresenceDto(bool IsTyping, string? StatusText, DateTimeOffset UpdatedAt);
|