export type GoalStatus = "ACTIVE" | "COMPLETED" | "PAUSED" | "CANCELLED"; export type GoalPriority = "LOW" | "MEDIUM" | "HIGH"; export type AutoSaveFrequency = "DAILY" | "WEEKLY" | "MONTHLY"; export interface Goal { id: string; titleRu: string; descriptionRu?: string; targetAmount: number; currentAmount: number; targetDate?: string; status: GoalStatus; priority: GoalPriority; icon?: string; color?: string; autoSaveEnabled: boolean; autoSaveAmount?: number; autoSaveFrequency?: AutoSaveFrequency; createdAt: string; updatedAt: string; } export interface CreateGoalBody { titleRu: string; descriptionRu?: string; targetAmount: number; currentAmount?: number; targetDate?: string; priority?: GoalPriority; icon?: string; color?: string; autoSaveEnabled?: boolean; autoSaveAmount?: number; autoSaveFrequency?: AutoSaveFrequency; } export interface UpdateGoalBody { titleRu?: string; descriptionRu?: string; targetAmount?: number; targetDate?: string; status?: GoalStatus; priority?: GoalPriority; icon?: string; color?: string; autoSaveEnabled?: boolean; autoSaveAmount?: number; autoSaveFrequency?: AutoSaveFrequency; } export interface GoalFundsBody { amount: number; note?: string; } export interface GoalsSummary { totalGoals: number; activeGoals: number; completedGoals: number; totalTargetAmount: number; totalCurrentAmount: number; overallProgress: number; } export interface BaseResponse { success: boolean; timestamp: string; } export interface GoalsListResponse extends BaseResponse { data: Goal[]; } export interface GoalResponse extends BaseResponse { data: Goal; } export interface GoalsSummaryResponse extends BaseResponse { data: GoalsSummary; } export interface GoalsInitialState { goals: Goal[]; summary: GoalsSummary | null; upcoming: Goal[]; isLoading: boolean; error: string | undefined; } export interface GoalsUpdateArgs { id: string; body: UpdateGoalBody; } export interface GoalsFundsArgs { id: string; body: GoalFundsBody; } export type GoalsListApi = (params?: { status?: GoalStatus; }) => Promise; export type GoalsGetApi = (id: string) => Promise; export type GoalsCreateApi = (body: CreateGoalBody) => Promise; export type GoalsUpdateApi = (args: GoalsUpdateArgs) => Promise; export type GoalsDeleteApi = (id: string) => Promise; export type GoalsAddFundsApi = (args: GoalsFundsArgs) => Promise; export type GoalsWithdrawApi = (args: GoalsFundsArgs) => Promise; export type GoalsSummaryApi = () => Promise; export type GoalsUpcomingApi = (days?: number) => Promise;