Initial commit - ERP
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace Chat.Contracts.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// Data Transfer Object for sending a message.
|
||||
/// Used when a client wants to send a message to another user.
|
||||
/// </summary>
|
||||
public class SendMessageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// The ID of the user who will receive the message.
|
||||
/// </summary>
|
||||
public Guid ReceiverId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The content/message text to be sent.
|
||||
/// </summary>
|
||||
public string Content { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Optional: The ID of the conversation this message belongs to.
|
||||
/// If not provided, a new conversation may be created.
|
||||
/// </summary>
|
||||
public Guid? ConversationId { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user