93 lines
2.5 KiB
C#
93 lines
2.5 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Lagerbestand.Models;
|
|
|
|
/// <summary>
|
|
/// Represents a task template that can be used to quickly create new tasks
|
|
/// </summary>
|
|
public class KanbanTaskTemplate
|
|
{
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
|
|
[Required]
|
|
[MaxLength(100)]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
[MaxLength(500)]
|
|
public string? Description { get; set; }
|
|
|
|
/// <summary>
|
|
/// Title pattern for tasks created from this template
|
|
/// Can include placeholders like {Kunde}
|
|
/// </summary>
|
|
[MaxLength(200)]
|
|
public string TitlePattern { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Default description for tasks
|
|
/// </summary>
|
|
public string? DefaultDescription { get; set; }
|
|
|
|
/// <summary>
|
|
/// Default column for tasks created from this template
|
|
/// </summary>
|
|
public Guid? DefaultColumnId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Default priority for tasks
|
|
/// </summary>
|
|
public KanbanTaskPriority DefaultPriority { get; set; } = KanbanTaskPriority.Medium;
|
|
|
|
/// <summary>
|
|
/// Default estimated minutes
|
|
/// </summary>
|
|
public int? DefaultEstimatedMinutes { get; set; }
|
|
|
|
/// <summary>
|
|
/// Display order for templates
|
|
/// </summary>
|
|
public int SortOrder { get; set; }
|
|
|
|
public bool IsActive { get; set; } = true;
|
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
// Navigation properties
|
|
public virtual KanbanColumn? DefaultColumn { get; set; }
|
|
public virtual ICollection<KanbanTaskTemplateTodo> Todos { get; set; } = new List<KanbanTaskTemplateTodo>();
|
|
public virtual ICollection<KanbanTaskTemplateLabel> TemplateLabels { get; set; } = new List<KanbanTaskTemplateLabel>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Predefined todo item for a template
|
|
/// </summary>
|
|
public class KanbanTaskTemplateTodo
|
|
{
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
|
|
public Guid TemplateId { get; set; }
|
|
|
|
[Required]
|
|
[MaxLength(500)]
|
|
public string Text { get; set; } = string.Empty;
|
|
|
|
public int SortOrder { get; set; }
|
|
|
|
// Navigation properties
|
|
public virtual KanbanTaskTemplate? Template { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Default label for a template (many-to-many)
|
|
/// </summary>
|
|
public class KanbanTaskTemplateLabel
|
|
{
|
|
public Guid TemplateId { get; set; }
|
|
public Guid LabelId { get; set; }
|
|
|
|
// Navigation properties
|
|
public virtual KanbanTaskTemplate? Template { get; set; }
|
|
public virtual KanbanLabel? Label { get; set; }
|
|
}
|