UNPKG

@bernierllc/todo-list

Version:

Pure todo list business logic and management utilities for @bernierllc packages

124 lines 3.63 kB
/** * Core task priority levels */ export type TaskPriority = 'urgent' | 'high' | 'normal'; /** * Core task status values */ export type TaskStatus = 'pending' | 'in-progress' | 'completed'; /** * Task type definition - describes categories of tasks */ export interface TaskType { readonly id: string; readonly name: string; readonly description: string; readonly icon: string; readonly defaultPriority: TaskPriority; } /** * Core task entity - pure business logic representation */ export interface Task { readonly id: string; readonly userId: string; readonly groupId?: string | undefined; readonly type: TaskType; readonly title: string; readonly description: string; readonly priority: TaskPriority; readonly dueDate?: string | undefined; readonly status: TaskStatus; readonly relatedId?: string | undefined; readonly actionUrl?: string | undefined; readonly canCompleteDirectly: boolean; readonly createdAt: string; readonly updatedAt: string; readonly completedAt?: string | undefined; readonly completedBy?: string | undefined; } /** * Request to create a new task */ export interface CreateTaskRequest { readonly userId: string; readonly groupId?: string | undefined; readonly type: string; readonly title: string; readonly description: string; readonly priority?: TaskPriority | undefined; readonly dueDate?: string | undefined; readonly relatedId?: string | undefined; readonly actionUrl?: string | undefined; readonly canCompleteDirectly?: boolean | undefined; } /** * Request to update an existing task */ export interface UpdateTaskRequest { readonly title?: string | undefined; readonly description?: string | undefined; readonly priority?: TaskPriority | undefined; readonly dueDate?: string | undefined; readonly status?: TaskStatus | undefined; readonly actionUrl?: string | undefined; readonly canCompleteDirectly?: boolean | undefined; } /** * Request to complete a task */ export interface TaskCompletionRequest { readonly completedBy: string; readonly notes?: string | undefined; } /** * Task filtering criteria */ export interface TaskFilters { readonly userId?: string | undefined; readonly groupId?: string | undefined; readonly type?: string | undefined; readonly priority?: TaskPriority | undefined; readonly status?: TaskStatus | undefined; readonly dueDateFrom?: string | undefined; readonly dueDateTo?: string | undefined; } /** * Task analytics and metrics */ export interface TaskAnalytics { readonly totalTasks: number; readonly pendingTasks: number; readonly completedTasks: number; readonly urgentTasks: number; readonly tasksByType: Record<string, number>; readonly tasksByPriority: Record<string, number>; readonly completionRate: number; readonly averageCompletionTime?: number | undefined; } /** * Task history item for audit trail */ export interface TaskHistoryItem { readonly taskId: string; readonly action: 'created' | 'updated' | 'completed' | 'deleted'; readonly userId: string; readonly timestamp: string; readonly details?: Record<string, unknown> | undefined; } /** * Task validation result */ export interface TaskValidationResult { readonly isValid: boolean; readonly errors: string[]; } /** * Task operation result */ export interface TaskOperationResult<T = void> { readonly success: boolean; readonly data?: T | undefined; readonly error?: string | undefined; } //# sourceMappingURL=types.d.ts.map