Files
ReifenSpaeth/Lagerbestand/Models/KanbanLabel.cs
T

62 lines
1.6 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace Lagerbestand.Models;
/// <summary>
/// Represents a label that can be attached to Kanban tasks
/// </summary>
public class KanbanLabel
{
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
[MaxLength(50)]
public string Name { get; set; } = string.Empty;
/// <summary>
/// Hex color code for the label (e.g., "#FF5733")
/// </summary>
[Required]
[MaxLength(7)]
public string Color { get; set; } = "#6B7280";
/// <summary>
/// Optional description for the label
/// </summary>
[MaxLength(200)]
public string? Description { get; set; }
/// <summary>
/// Display order for labels
/// </summary>
public int SortOrder { get; set; }
public bool IsActive { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
// Navigation properties
public virtual ICollection<KanbanTaskLabel> TaskLabels { get; set; } = new List<KanbanTaskLabel>();
public virtual ICollection<KanbanTaskTemplateLabel> TemplateLabels { get; set; } = new List<KanbanTaskTemplateLabel>();
}
/// <summary>
/// Predefined label colors for easy selection
/// </summary>
public static class KanbanLabelColors
{
public static readonly Dictionary<string, string> Presets = new()
{
{ "Rot", "#EF4444" },
{ "Orange", "#F97316" },
{ "Gelb", "#EAB308" },
{ "Grün", "#22C55E" },
{ "Türkis", "#14B8A6" },
{ "Blau", "#3B82F6" },
{ "Indigo", "#6366F1" },
{ "Violett", "#8B5CF6" },
{ "Pink", "#EC4899" },
{ "Grau", "#6B7280" }
};
}