Phase 3-4: Goals AI planner, Team tasks, Push notifications, i18n (CZ/HE/RU/UA)
- Goals CRUD API + AI study plan generator + progress reports - Goals frontend page with progress bars - Team tasks: assign, transfer, collaborate endpoints - Push notifications: web-push, VAPID, subscribe/send - i18n: 4 languages (cs, he, ru, ua) translation files - notifications.js + goals.js routes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -149,3 +149,58 @@ export interface Connector {
|
||||
type: string;
|
||||
config: Record<string, unknown>;
|
||||
}
|
||||
|
||||
// Goals
|
||||
export interface Goal {
|
||||
id: string;
|
||||
user_id: string | null;
|
||||
title: string;
|
||||
target_date: string | null;
|
||||
progress_pct: number;
|
||||
group_id: string | null;
|
||||
plan: Record<string, unknown> | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
group_name: string | null;
|
||||
group_color: string | null;
|
||||
group_icon: string | null;
|
||||
tasks?: Task[];
|
||||
}
|
||||
|
||||
export interface GoalPlanResult {
|
||||
plan: Record<string, unknown>;
|
||||
tasks_created: number;
|
||||
}
|
||||
|
||||
export interface GoalReport {
|
||||
report: string;
|
||||
stats: { done: number; total: number; pct: number };
|
||||
}
|
||||
|
||||
export function getGoals(token: string) {
|
||||
return apiFetch<{ data: Goal[] }>("/api/v1/goals", { token });
|
||||
}
|
||||
|
||||
export function getGoal(token: string, id: string) {
|
||||
return apiFetch<{ data: Goal }>(`/api/v1/goals/${id}`, { token });
|
||||
}
|
||||
|
||||
export function createGoal(token: string, data: Partial<Goal>) {
|
||||
return apiFetch<{ data: Goal }>("/api/v1/goals", { method: "POST", body: data, token });
|
||||
}
|
||||
|
||||
export function updateGoal(token: string, id: string, data: Partial<Goal>) {
|
||||
return apiFetch<{ data: Goal }>(`/api/v1/goals/${id}`, { method: "PUT", body: data, token });
|
||||
}
|
||||
|
||||
export function deleteGoal(token: string, id: string) {
|
||||
return apiFetch<void>(`/api/v1/goals/${id}`, { method: "DELETE", token });
|
||||
}
|
||||
|
||||
export function generateGoalPlan(token: string, id: string) {
|
||||
return apiFetch<{ data: GoalPlanResult }>(`/api/v1/goals/${id}/plan`, { method: "POST", token });
|
||||
}
|
||||
|
||||
export function getGoalReport(token: string, id: string) {
|
||||
return apiFetch<{ data: GoalReport }>(`/api/v1/goals/${id}/report`, { token });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user