tududi/frontend/entities/TaskEvent.ts
Chris 03f38f05dc
Setup intelligence (#84)
* Add next suggestions and remove console logs

* Add pomodoro timer

* Add pomodoro switch in settings

* Fix pomodoro setting

* Add timezones to settings

* Fix an issue with password reset

* Cleanup

* Sort tags alphabetically

* Clean up today's view

* Add an indicator for repeatedly added to today

* Refactor tags

* Add due date today item

* Move recurrence to the subtitle area

* Fix today layout

* Add a badge to Inbox items

* Move inbox badge to sidebar

* Add quotes and progress bar

* Add translations for quotes

* Fix test issues

* Add helper script for docker local

* Set up overdue tasks

* Add  linux/arm/v7 build to deploy script

* Add  linux/arm/v7 build to deploy script pt2

* Fix an issue with helmet and SSL

* Add volume db persistence

* Fix cog icon issues
2025-06-27 14:02:18 +03:00

71 lines
No EOL
1.7 KiB
TypeScript

export interface TaskEvent {
id: number;
task_id: number;
user_id: number;
event_type: 'created' | 'status_changed' | 'priority_changed' | 'due_date_changed' |
'project_changed' | 'name_changed' | 'description_changed' | 'note_changed' |
'completed' | 'archived' | 'deleted' | 'restored' | 'today_changed' |
'tags_changed' | 'recurrence_changed';
old_value?: any;
new_value?: any;
field_name?: string;
metadata?: {
source?: 'web' | 'api' | 'telegram';
action?: string;
[key: string]: any;
};
created_at: string;
user?: {
id: number;
username: string;
email: string;
};
}
export interface TaskCompletionTime {
task_id: number;
started_at: string;
completed_at: string;
duration_ms: number;
duration_hours: number;
duration_days: number;
}
export interface TaskCompletionAnalytics {
task_id: number;
task_name: string;
project_name?: string;
started_at: string;
completed_at: string;
duration_ms: number;
duration_hours: number;
duration_days: number;
}
export interface ProductivityMetrics {
total_events: number;
tasks_created: number;
tasks_completed: number;
status_changes: number;
average_completion_time?: number;
completion_times: TaskCompletionTime[];
}
export interface CompletionAnalyticsSummary {
total_tasks: number;
average_completion_hours: number;
median_completion_hours: number;
fastest_completion: number;
slowest_completion: number;
}
export interface CompletionAnalyticsResponse {
tasks: TaskCompletionAnalytics[];
summary: CompletionAnalyticsSummary;
}
export interface TaskActivitySummary {
event_type: string;
count: number;
date: string;
}