77 lines
2.0 KiB
C#
77 lines
2.0 KiB
C#
using Chat.Domain.Enums;
|
|
|
|
namespace Chat.Contracts.DTOs;
|
|
|
|
/// <summary>
|
|
/// Data Transfer Object for a message.
|
|
/// Used when returning message data to clients.
|
|
/// </summary>
|
|
public class MessageDto
|
|
{
|
|
/// <summary>
|
|
/// Unique identifier for the message.
|
|
/// </summary>
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// The content/message text.
|
|
/// </summary>
|
|
public string Content { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The ID of the user who sent the message.
|
|
/// </summary>
|
|
public Guid SenderId { get; set; }
|
|
|
|
/// <summary>
|
|
/// The name of the user who sent the message.
|
|
/// </summary>
|
|
public string SenderName { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// The ID of the user receiving the message.
|
|
/// </summary>
|
|
public Guid ReceiverId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Timestamp when the message was sent.
|
|
/// </summary>
|
|
public DateTime SentAt { get; set; }
|
|
|
|
/// <summary>
|
|
/// Indicates if the message has been read by the receiver.
|
|
/// </summary>
|
|
public bool IsRead { get; set; }
|
|
|
|
/// <summary>
|
|
/// Timestamp when the message was read by the receiver.
|
|
/// </summary>
|
|
public DateTime? ReadAt { get; set; }
|
|
|
|
/// <summary>
|
|
/// Indicates if the message has been deleted.
|
|
/// </summary>
|
|
public bool IsDeleted { get; set; }
|
|
|
|
/// <summary>
|
|
/// Indicates if the message has been edited.
|
|
/// </summary>
|
|
public bool IsEdited { get; set; }
|
|
|
|
/// <summary>
|
|
/// Timestamp when the message was last edited.
|
|
/// </summary>
|
|
public DateTime? EditedAt { get; set; }
|
|
|
|
/// <summary>
|
|
/// The current status of the message (e.g., Sent, Delivered, Read).
|
|
/// </summary>
|
|
public MessageStatus MessageStatus { get; set; }
|
|
|
|
/// <summary>
|
|
/// Indicates if the current user is the sender of this message.
|
|
/// Useful for UI differentiation in chat interfaces.
|
|
/// </summary>
|
|
public bool IsFromCurrentUser { get; set; }
|
|
}
|