46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Lagerbestand.Models;
|
|
|
|
/// <summary>
|
|
/// Type of comment (chat message or system activity)
|
|
/// </summary>
|
|
public enum KanbanCommentType
|
|
{
|
|
Chat = 0,
|
|
Activity = 1
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents a chat message or activity log entry on a Kanban task
|
|
/// </summary>
|
|
public class KanbanTaskComment
|
|
{
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
|
|
public Guid TaskId { get; set; }
|
|
|
|
/// <summary>
|
|
/// User who created the comment (null for system activities)
|
|
/// </summary>
|
|
public Guid? UserId { get; set; }
|
|
|
|
[Required]
|
|
public string Content { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Whether this is a chat message or system activity
|
|
/// </summary>
|
|
public KanbanCommentType CommentType { get; set; } = KanbanCommentType.Chat;
|
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
// Navigation properties
|
|
public virtual KanbanTask? Task { get; set; }
|
|
public virtual AppUser? User { get; set; }
|
|
|
|
// Computed properties
|
|
public bool IsActivity => CommentType == KanbanCommentType.Activity;
|
|
public bool IsChat => CommentType == KanbanCommentType.Chat;
|
|
}
|