using System.ComponentModel.DataAnnotations;
namespace Lagerbestand.Models;
///
/// Represents a task template that can be used to quickly create new tasks
///
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; }
///
/// Title pattern for tasks created from this template
/// Can include placeholders like {Kunde}
///
[MaxLength(200)]
public string TitlePattern { get; set; } = string.Empty;
///
/// Default description for tasks
///
public string? DefaultDescription { get; set; }
///
/// Default column for tasks created from this template
///
public Guid? DefaultColumnId { get; set; }
///
/// Default priority for tasks
///
public KanbanTaskPriority DefaultPriority { get; set; } = KanbanTaskPriority.Medium;
///
/// Default estimated minutes
///
public int? DefaultEstimatedMinutes { get; set; }
///
/// Display order for templates
///
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 Todos { get; set; } = new List();
public virtual ICollection TemplateLabels { get; set; } = new List();
}
///
/// Predefined todo item for a template
///
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; }
}
///
/// Default label for a template (many-to-many)
///
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; }
}