Initial commit - ERP
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
|
||||
namespace Chat.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a direct messaging conversation between two users.
|
||||
/// </summary>
|
||||
public class Conversation
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique identifier for the conversation.
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Foreign key to the first participant (User).
|
||||
/// </summary>
|
||||
public Guid Participant1Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Foreign key to the second participant (User).
|
||||
/// </summary>
|
||||
public Guid Participant2Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Date and time when the conversation was created.
|
||||
/// </summary>
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
/// <summary>
|
||||
/// Foreign key to the last message in the conversation. Can be null if no messages exist.
|
||||
/// </summary>
|
||||
public Guid? LastMessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Date and time when the last message was sent in the conversation.
|
||||
/// </summary>
|
||||
public DateTime? LastMessageAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of unread messages for participant 1.
|
||||
/// </summary>
|
||||
public int UnreadCount1 { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of unread messages for participant 2.
|
||||
/// </summary>
|
||||
public int UnreadCount2 { get; set; } = 0;
|
||||
|
||||
// Navigation properties (to User and Message entities when they exist)
|
||||
// public User Participant1 { get; set; }
|
||||
// public User Participant2 { get; set; }
|
||||
// public Message LastMessage { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Chat.Domain.Enums;
|
||||
using System;
|
||||
|
||||
namespace Chat.Domain.Entities;
|
||||
|
||||
public class Message
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string Content { get; set; } = string.Empty;
|
||||
|
||||
public Guid SenderId { get; set; }
|
||||
|
||||
public Guid ReceiverId { get; set; }
|
||||
|
||||
public DateTime SentAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public bool IsRead { get; set; } = false;
|
||||
|
||||
public DateTime? ReadAt { get; set; }
|
||||
|
||||
public bool IsDeleted { get; set; } = false;
|
||||
|
||||
public DateTime? DeletedAt { get; set; }
|
||||
|
||||
public bool IsEdited { get; set; } = false;
|
||||
|
||||
public DateTime? EditedAt { get; set; }
|
||||
|
||||
public MessageStatus Status { get; set; } = MessageStatus.Sent;
|
||||
|
||||
// Navigation properties (to User entity when it exists)
|
||||
// public User Sender { get; set; }
|
||||
// public User Receiver { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Chat.Domain.Enums;
|
||||
using System;
|
||||
|
||||
namespace Chat.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a user's presence status and connection information for real-time features.
|
||||
/// </summary>
|
||||
public class UserPresence
|
||||
{
|
||||
/// <summary>
|
||||
/// Primary key - the unique identifier of the user.
|
||||
/// </summary>
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The current status of the user (Online, Offline, Away).
|
||||
/// </summary>
|
||||
public UserStatus Status { get; set; } = UserStatus.Offline;
|
||||
|
||||
/// <summary>
|
||||
/// Date and time when the user was last seen.
|
||||
/// </summary>
|
||||
public DateTime LastSeenAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
/// <summary>
|
||||
/// SignalR connection ID for real-time messaging. Can be null if the user is not connected.
|
||||
/// </summary>
|
||||
public string? ConnectionId { get; set; }
|
||||
|
||||
// Navigation property (to User entity when it exists)
|
||||
// public User User { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user