From dcf127bd57a7869e0e3fb3de2ab8d25778faf316 Mon Sep 17 00:00:00 2001 From: "i.seliverstov" Date: Sun, 16 Aug 2026 09:45:56 +0500 Subject: [PATCH] feat(goals): complete with success or failure outcome --- alfy-bot-frontend/src/api/goals.ts | 1 + alfy-bot-frontend/src/components/GoalCard.vue | 2 +- .../src/components/GoalStatusBadge.vue | 20 +++-- alfy-bot-frontend/src/types/index.ts | 2 + alfy-bot-frontend/src/views/GoalView.vue | 81 ++++++++++++++++++- .../tests/views/GoalView.spec.ts | 66 +++++++++++++++ .../modules/bot/scenes/list-goals.scene.ts | 5 ++ .../src/modules/goal/dto/goal-response.dto.ts | 10 ++- .../src/modules/goal/dto/update-goal.dto.ts | 10 +++ .../src/modules/goal/goal.controller.spec.ts | 31 +++++++ alfy-bot/src/modules/goal/goal.controller.ts | 6 ++ alfy-bot/src/shared/entities/goal.entity.ts | 4 + 12 files changed, 226 insertions(+), 12 deletions(-) diff --git a/alfy-bot-frontend/src/api/goals.ts b/alfy-bot-frontend/src/api/goals.ts index bc283f5..beb347c 100644 --- a/alfy-bot-frontend/src/api/goals.ts +++ b/alfy-bot-frontend/src/api/goals.ts @@ -27,6 +27,7 @@ export interface QuestionWithScheduleItem { export interface UpdateGoalDto { status?: 'active' | 'completed' | 'archived' | 'deleted' + outcome?: 'success' | 'failure' | null goal_name?: string parent_goal_id?: number | null } diff --git a/alfy-bot-frontend/src/components/GoalCard.vue b/alfy-bot-frontend/src/components/GoalCard.vue index 850ddc5..8d260e1 100644 --- a/alfy-bot-frontend/src/components/GoalCard.vue +++ b/alfy-bot-frontend/src/components/GoalCard.vue @@ -50,7 +50,7 @@ function subGoalsLabel(n: number) {
- + -import type { GoalStatus } from '../types' +import type { GoalOutcome, GoalStatus } from '../types' -const props = defineProps<{ status: GoalStatus }>() +const props = defineProps<{ status: GoalStatus, outcome?: GoalOutcome | null }>() const config: Record = { active: { @@ -10,9 +10,9 @@ const config: Record