diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index dc0bb0f..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v22.12.0 diff --git a/.vscode/settings.json b/.vscode/settings.json index 3759003..67420df 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -28,5 +28,8 @@ "eslint.enable": false, "prettier.enable": false, "typescript.preferences.organizeImportsCollation": "ordinal", - "editor.fontSize": 15 + "editor.fontSize": 15, + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + } } diff --git a/README.md b/README.md index 96d8ee7..4bca9bb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-
+
@@ -21,7 +21,7 @@ ---
-
+
{formattedDate}
diff --git a/components/dashboard/expenses-by-category-widget-with-chart.tsx b/src/features/dashboard/components/expenses-by-category-widget-with-chart.tsx similarity index 80% rename from components/dashboard/expenses-by-category-widget-with-chart.tsx rename to src/features/dashboard/components/expenses-by-category-widget-with-chart.tsx index 6cc09d7..5473fad 100644 --- a/components/dashboard/expenses-by-category-widget-with-chart.tsx +++ b/src/features/dashboard/components/expenses-by-category-widget-with-chart.tsx @@ -1,6 +1,6 @@ "use client"; -import type { ExpensesByCategoryData } from "@/lib/dashboard/categories/expenses-by-category"; +import type { ExpensesByCategoryData } from "@/features/dashboard/categories/expenses-by-category-queries"; import { CategoryBreakdownWidgetView } from "./category-breakdown/category-breakdown-widget-view"; type ExpensesByCategoryWidgetWithChartProps = { diff --git a/components/dashboard/goals-progress-widget.tsx b/src/features/dashboard/components/goals-progress-widget.tsx similarity index 76% rename from components/dashboard/goals-progress-widget.tsx rename to src/features/dashboard/components/goals-progress-widget.tsx index 1ddbe21..4aaa7b8 100644 --- a/components/dashboard/goals-progress-widget.tsx +++ b/src/features/dashboard/components/goals-progress-widget.tsx @@ -1,7 +1,7 @@ "use client"; -import type { GoalsProgressData } from "@/lib/dashboard/goals-progress"; -import { useGoalsProgressWidgetController } from "@/lib/dashboard/use-goals-progress-widget-controller"; +import type { GoalsProgressData } from "@/features/dashboard/goals-progress-queries"; +import { useGoalsProgressWidgetController } from "@/features/dashboard/use-goals-progress-widget-controller"; import { GoalsProgressWidgetView } from "./goals-progress/goals-progress-widget-view"; type GoalsProgressWidgetProps = { diff --git a/components/dashboard/goals-progress/goal-progress-item.tsx b/src/features/dashboard/components/goals-progress/goal-progress-item.tsx similarity index 83% rename from components/dashboard/goals-progress/goal-progress-item.tsx rename to src/features/dashboard/components/goals-progress/goal-progress-item.tsx index eb3b203..6583f51 100644 --- a/components/dashboard/goals-progress/goal-progress-item.tsx +++ b/src/features/dashboard/components/goals-progress/goal-progress-item.tsx @@ -1,14 +1,14 @@ import { RiPencilLine } from "@remixicon/react"; -import { CategoryIconBadge } from "@/components/categorias/category-icon-badge"; -import MoneyValues from "@/components/shared/money-values"; -import { Button } from "@/components/ui/button"; -import { Progress } from "@/components/ui/progress"; -import type { GoalProgressItem as GoalProgressItemData } from "@/lib/dashboard/goals-progress"; +import { CategoryIconBadge } from "@/features/categories/components/category-icon-badge"; import { clampGoalProgress, formatGoalProgressPercentage, getGoalProgressStatusColorClass, -} from "@/lib/dashboard/goals-progress-helpers"; +} from "@/features/dashboard/goals-progress-helpers"; +import type { GoalProgressItem as GoalProgressItemData } from "@/features/dashboard/goals-progress-queries"; +import MoneyValues from "@/shared/components/money-values"; +import { Button } from "@/shared/components/ui/button"; +import { Progress } from "@/shared/components/ui/progress"; type GoalProgressItemProps = { item: GoalProgressItemData; diff --git a/components/dashboard/goals-progress/goals-progress-list.tsx b/src/features/dashboard/components/goals-progress/goals-progress-list.tsx similarity index 84% rename from components/dashboard/goals-progress/goals-progress-list.tsx rename to src/features/dashboard/components/goals-progress/goals-progress-list.tsx index 66188b5..3cacbe6 100644 --- a/components/dashboard/goals-progress/goals-progress-list.tsx +++ b/src/features/dashboard/components/goals-progress/goals-progress-list.tsx @@ -1,6 +1,6 @@ import { RiFundsLine } from "@remixicon/react"; -import { WidgetEmptyState } from "@/components/shared/widget-empty-state"; -import type { GoalProgressItem } from "@/lib/dashboard/goals-progress"; +import type { GoalProgressItem } from "@/features/dashboard/goals-progress-queries"; +import { WidgetEmptyState } from "@/shared/components/widget-empty-state"; import { GoalProgressItem as GoalProgressListItem } from "./goal-progress-item"; type GoalsProgressListProps = { diff --git a/components/dashboard/goals-progress/goals-progress-widget-dialogs.tsx b/src/features/dashboard/components/goals-progress/goals-progress-widget-dialogs.tsx similarity index 78% rename from components/dashboard/goals-progress/goals-progress-widget-dialogs.tsx rename to src/features/dashboard/components/goals-progress/goals-progress-widget-dialogs.tsx index 12c2917..bce61be 100644 --- a/components/dashboard/goals-progress/goals-progress-widget-dialogs.tsx +++ b/src/features/dashboard/components/goals-progress/goals-progress-widget-dialogs.tsx @@ -1,5 +1,8 @@ -import { BudgetDialog } from "@/components/orcamentos/budget-dialog"; -import type { Budget, BudgetCategory } from "@/components/orcamentos/types"; +import { BudgetDialog } from "@/features/budgets/components/budget-dialog"; +import type { + Budget, + BudgetCategory, +} from "@/features/budgets/components/types"; type GoalsProgressWidgetDialogsProps = { selectedBudget: Budget | null; diff --git a/components/dashboard/goals-progress/goals-progress-widget-view.tsx b/src/features/dashboard/components/goals-progress/goals-progress-widget-view.tsx similarity index 87% rename from components/dashboard/goals-progress/goals-progress-widget-view.tsx rename to src/features/dashboard/components/goals-progress/goals-progress-widget-view.tsx index 1a711c5..59bd676 100644 --- a/components/dashboard/goals-progress/goals-progress-widget-view.tsx +++ b/src/features/dashboard/components/goals-progress/goals-progress-widget-view.tsx @@ -1,8 +1,11 @@ -import type { Budget, BudgetCategory } from "@/components/orcamentos/types"; +import type { + Budget, + BudgetCategory, +} from "@/features/budgets/components/types"; import type { GoalProgressItem, GoalsProgressData, -} from "@/lib/dashboard/goals-progress"; +} from "@/features/dashboard/goals-progress-queries"; import { GoalsProgressList } from "./goals-progress-list"; import { GoalsProgressWidgetDialogs } from "./goals-progress-widget-dialogs"; diff --git a/components/dashboard/income-by-category-widget-with-chart.tsx b/src/features/dashboard/components/income-by-category-widget-with-chart.tsx similarity index 79% rename from components/dashboard/income-by-category-widget-with-chart.tsx rename to src/features/dashboard/components/income-by-category-widget-with-chart.tsx index d797c52..522c096 100644 --- a/components/dashboard/income-by-category-widget-with-chart.tsx +++ b/src/features/dashboard/components/income-by-category-widget-with-chart.tsx @@ -1,6 +1,6 @@ "use client"; -import type { IncomeByCategoryData } from "@/lib/dashboard/categories/income-by-category"; +import type { IncomeByCategoryData } from "@/features/dashboard/categories/income-by-category-queries"; import { CategoryBreakdownWidgetView } from "./category-breakdown/category-breakdown-widget-view"; type IncomeByCategoryWidgetWithChartProps = { diff --git a/components/dashboard/income-expense-balance-widget.tsx b/src/features/dashboard/components/income-expense-balance-widget.tsx similarity index 92% rename from components/dashboard/income-expense-balance-widget.tsx rename to src/features/dashboard/components/income-expense-balance-widget.tsx index 275cfb5..536eff1 100644 --- a/components/dashboard/income-expense-balance-widget.tsx +++ b/src/features/dashboard/components/income-expense-balance-widget.tsx @@ -2,15 +2,15 @@ import { RiLineChartLine } from "@remixicon/react"; import { Bar, BarChart, CartesianGrid, XAxis } from "recharts"; -import { WidgetEmptyState } from "@/components/shared/widget-empty-state"; -import { CardContent } from "@/components/ui/card"; +import type { IncomeExpenseBalanceData } from "@/features/dashboard/income-expense-balance-queries"; +import { CardContent } from "@/shared/components/ui/card"; import { type ChartConfig, ChartContainer, ChartTooltip, -} from "@/components/ui/chart"; -import type { IncomeExpenseBalanceData } from "@/lib/dashboard/income-expense-balance"; -import { formatCurrency } from "@/lib/utils/currency"; +} from "@/shared/components/ui/chart"; +import { WidgetEmptyState } from "@/shared/components/widget-empty-state"; +import { formatCurrency } from "@/shared/utils/currency"; type IncomeExpenseBalanceWidgetProps = { data: IncomeExpenseBalanceData; diff --git a/components/dashboard/installment-analysis/installment-analysis-page.tsx b/src/features/dashboard/components/installment-analysis/installment-analysis-page.tsx similarity index 97% rename from components/dashboard/installment-analysis/installment-analysis-page.tsx rename to src/features/dashboard/components/installment-analysis/installment-analysis-page.tsx index 514a2ec..c505756 100644 --- a/components/dashboard/installment-analysis/installment-analysis-page.tsx +++ b/src/features/dashboard/components/installment-analysis/installment-analysis-page.tsx @@ -6,9 +6,9 @@ import { RiCheckboxLine, } from "@remixicon/react"; import { useMemo, useState } from "react"; -import MoneyValues from "@/components/shared/money-values"; -import { Button } from "@/components/ui/button"; -import { Card, CardContent } from "@/components/ui/card"; +import MoneyValues from "@/shared/components/money-values"; +import { Button } from "@/shared/components/ui/button"; +import { Card, CardContent } from "@/shared/components/ui/card"; import { InstallmentGroupCard } from "./installment-group-card"; import type { InstallmentAnalysisData } from "./types"; diff --git a/components/dashboard/installment-analysis/installment-group-card.tsx b/src/features/dashboard/components/installment-analysis/installment-group-card.tsx similarity index 95% rename from components/dashboard/installment-analysis/installment-group-card.tsx rename to src/features/dashboard/components/installment-analysis/installment-group-card.tsx index 429a1cc..cb4c198 100644 --- a/components/dashboard/installment-analysis/installment-group-card.tsx +++ b/src/features/dashboard/components/installment-analysis/installment-group-card.tsx @@ -8,12 +8,12 @@ import { import { format } from "date-fns"; import { ptBR } from "date-fns/locale"; import { useState } from "react"; -import MoneyValues from "@/components/shared/money-values"; -import { Badge } from "@/components/ui/badge"; -import { Card, CardContent } from "@/components/ui/card"; -import { Checkbox } from "@/components/ui/checkbox"; -import { Progress } from "@/components/ui/progress"; -import { cn } from "@/lib/utils/ui"; +import MoneyValues from "@/shared/components/money-values"; +import { Badge } from "@/shared/components/ui/badge"; +import { Card, CardContent } from "@/shared/components/ui/card"; +import { Checkbox } from "@/shared/components/ui/checkbox"; +import { Progress } from "@/shared/components/ui/progress"; +import { cn } from "@/shared/utils/ui"; import type { InstallmentGroup } from "./types"; type InstallmentGroupCardProps = { diff --git a/components/dashboard/installment-analysis/types.ts b/src/features/dashboard/components/installment-analysis/types.ts similarity index 63% rename from components/dashboard/installment-analysis/types.ts rename to src/features/dashboard/components/installment-analysis/types.ts index 4f18f59..50ac299 100644 --- a/components/dashboard/installment-analysis/types.ts +++ b/src/features/dashboard/components/installment-analysis/types.ts @@ -1,6 +1,6 @@ import type { InstallmentAnalysisData, InstallmentGroup, -} from "@/lib/dashboard/expenses/installment-analysis"; +} from "@/features/dashboard/expenses/installment-analysis-queries"; export type { InstallmentAnalysisData, InstallmentGroup }; diff --git a/components/dashboard/installment-expenses-widget.tsx b/src/features/dashboard/components/installment-expenses-widget.tsx similarity index 75% rename from components/dashboard/installment-expenses-widget.tsx rename to src/features/dashboard/components/installment-expenses-widget.tsx index c5d4be3..260f5c5 100644 --- a/components/dashboard/installment-expenses-widget.tsx +++ b/src/features/dashboard/components/installment-expenses-widget.tsx @@ -1,4 +1,4 @@ -import type { InstallmentExpensesData } from "@/lib/dashboard/expenses/installment-expenses"; +import type { InstallmentExpensesData } from "@/features/dashboard/expenses/installment-expenses-queries"; import { InstallmentExpensesWidgetView } from "./installment-expenses/installment-expenses-widget-view"; type InstallmentExpensesWidgetProps = { diff --git a/components/dashboard/installment-expenses/installment-expense-list-item.tsx b/src/features/dashboard/components/installment-expenses/installment-expense-list-item.tsx similarity index 82% rename from components/dashboard/installment-expenses/installment-expense-list-item.tsx rename to src/features/dashboard/components/installment-expenses/installment-expense-list-item.tsx index c931eea..85b2b8d 100644 --- a/components/dashboard/installment-expenses/installment-expense-list-item.tsx +++ b/src/features/dashboard/components/installment-expenses/installment-expense-list-item.tsx @@ -1,13 +1,13 @@ import Image from "next/image"; -import MoneyValues from "@/components/shared/money-values"; -import { Progress } from "@/components/ui/progress"; +import type { InstallmentExpense } from "@/features/dashboard/expenses/installment-expenses-queries"; +import { buildInstallmentExpenseDisplay } from "@/features/dashboard/installment-expenses-helpers"; +import MoneyValues from "@/shared/components/money-values"; +import { Progress } from "@/shared/components/ui/progress"; import { Tooltip, TooltipContent, TooltipTrigger, -} from "@/components/ui/tooltip"; -import type { InstallmentExpense } from "@/lib/dashboard/expenses/installment-expenses"; -import { buildInstallmentExpenseDisplay } from "@/lib/dashboard/installment-expenses-helpers"; +} from "@/shared/components/ui/tooltip"; type InstallmentExpenseListItemProps = { expense: InstallmentExpense; @@ -41,7 +41,7 @@ export function InstallmentExpenseListItem({+ {item.name} +
+