Files

99 lines
4.3 KiB
C#

using Lagerbestand.Models;
namespace Lagerbestand.Services;
public interface IKanbanService
{
// Columns
Task<List<KanbanColumn>> GetColumnsAsync();
Task<KanbanColumn?> GetColumnByIdAsync(Guid id);
Task<KanbanColumn> CreateColumnAsync(KanbanColumn column);
Task<KanbanColumn> UpdateColumnAsync(KanbanColumn column);
Task DeleteColumnAsync(Guid id);
Task ReorderColumnsAsync(List<Guid> columnIds);
// Labels
Task<List<KanbanLabel>> GetLabelsAsync();
Task<KanbanLabel?> GetLabelByIdAsync(Guid id);
Task<KanbanLabel> CreateLabelAsync(KanbanLabel label);
Task<KanbanLabel> UpdateLabelAsync(KanbanLabel label);
Task DeleteLabelAsync(Guid id);
// Tasks
Task<List<KanbanTask>> GetTasksAsync(bool includeArchived = false);
Task<List<KanbanTask>> GetTasksByColumnAsync(Guid columnId);
Task<KanbanTask?> GetTaskByIdAsync(Guid id);
Task<KanbanTask> CreateTaskAsync(KanbanTask task, Guid? userId = null);
Task<KanbanTask> CreateTaskFromTemplateAsync(Guid templateId, string? title = null, Guid? customerId = null, Guid? userId = null);
Task<KanbanTask> UpdateTaskAsync(KanbanTask task, Guid? userId = null);
Task MoveTaskAsync(Guid taskId, Guid newColumnId, int newSortOrder, Guid? userId = null);
Task DeleteTaskAsync(Guid id);
Task ArchiveTaskAsync(Guid id);
Task UnarchiveTaskAsync(Guid id);
Task<List<KanbanTask>> GetRecentlyArchivedTasksAsync(int days = 7);
Task ArchiveOldCompletedTasksAsync(int daysAfterCompletion = 30);
// Task Todos
Task<KanbanTaskTodo> AddTodoAsync(Guid taskId, string text);
Task<KanbanTaskTodo> UpdateTodoAsync(KanbanTaskTodo todo);
Task ToggleTodoAsync(Guid todoId);
Task DeleteTodoAsync(Guid todoId);
Task ReorderTodosAsync(Guid taskId, List<Guid> todoIds);
// Task Comments/Chat
Task<List<KanbanTaskComment>> GetCommentsAsync(Guid taskId);
Task<KanbanTaskComment> AddCommentAsync(Guid taskId, string content, Guid? userId);
Task AddActivityAsync(Guid taskId, string activity, Guid? userId = null);
// Task Notes
Task<List<KanbanTaskNote>> GetNotesAsync(Guid taskId);
Task<KanbanTaskNote> AddNoteAsync(Guid taskId, string title, string content);
Task<KanbanTaskNote> UpdateNoteAsync(KanbanTaskNote note, Guid? userId = null);
Task DeleteNoteAsync(Guid noteId);
// Task Attachments
Task<List<KanbanTaskAttachment>> GetAttachmentsAsync(Guid taskId);
Task<KanbanTaskAttachment?> GetAttachmentByIdAsync(Guid id);
Task<KanbanTaskAttachment> AddAttachmentAsync(Guid taskId, string fileName, string contentType, byte[] content, Guid? userId);
Task<byte[]?> GetAttachmentContentAsync(Guid attachmentId);
Task DeleteAttachmentAsync(Guid attachmentId);
// Task Labels
Task AddLabelToTaskAsync(Guid taskId, Guid labelId);
Task RemoveLabelFromTaskAsync(Guid taskId, Guid labelId);
Task SetTaskLabelsAsync(Guid taskId, List<Guid> labelIds);
// Task Assignees
Task AddAssigneeAsync(Guid taskId, Guid userId);
Task RemoveAssigneeAsync(Guid taskId, Guid userId);
Task SetAssigneesAsync(Guid taskId, List<Guid> userIds, Guid? changedByUserId = null);
// Task Customers
Task AddCustomerToTaskAsync(Guid taskId, Guid customerId);
Task RemoveCustomerFromTaskAsync(Guid taskId, Guid customerId);
Task SetTaskCustomersAsync(Guid taskId, Dictionary<Guid, Guid?> customerVehicleMap);
// Task TireStacks
Task AddTireStackToTaskAsync(Guid taskId, Guid tireStackId);
Task RemoveTireStackFromTaskAsync(Guid taskId, Guid tireStackId);
Task SetTaskTireStacksAsync(Guid taskId, List<Guid> tireStackIds);
// Templates
Task<List<KanbanTaskTemplate>> GetTemplatesAsync();
Task<KanbanTaskTemplate?> GetTemplateByIdAsync(Guid id);
Task<KanbanTaskTemplate> CreateTemplateAsync(KanbanTaskTemplate template);
Task<KanbanTaskTemplate> UpdateTemplateAsync(KanbanTaskTemplate template);
Task DeleteTemplateAsync(Guid id);
// Template Todos
Task<KanbanTaskTemplateTodo> AddTemplateTodoAsync(Guid templateId, string text);
Task DeleteTemplateTodoAsync(Guid todoId);
Task SyncTemplateTodosAsync(Guid templateId, List<KanbanTaskTemplateTodo> todos);
// Template Labels
Task SetTemplateLabelsAsync(Guid templateId, List<Guid> labelIds);
// Statistics/Dashboard
Task<KanbanStatistics> GetStatisticsAsync();
}