refactor: alinha features financeiras ao novo naming

This commit is contained in:
Felipe Coutinho
2026-03-14 12:50:55 +00:00
parent ef918a3667
commit 67ad4b9d02
51 changed files with 876 additions and 898 deletions

View File

@@ -33,10 +33,10 @@ import { AccountFormFields } from "./account-form-fields";
import type { Account, AccountFormValues } from "./types";
const DEFAULT_ACCOUNT_TYPES = [
"Conta Corrente",
"Conta Poupança",
"FinancialAccount Corrente",
"FinancialAccount Poupança",
"Carteira Digital",
"Conta Investimento",
"FinancialAccount Investimento",
"Pré-Pago | VR/VA",
] as const;
@@ -167,7 +167,7 @@ export function AccountDialog({
const accountId = account?.id;
if (mode === "update" && !accountId) {
const message = "Conta inválida.";
const message = "FinancialAccount inválida.";
setErrorMessage(message);
toast.error(message);
return;

View File

@@ -110,10 +110,7 @@ export function AccountFormFields({
<div className="flex items-center gap-2">
<Checkbox
id="exclude-from-balance"
checked={
values.excludeFromBalance === true ||
values.excludeFromBalance === "true"
}
checked={Boolean(values.excludeFromBalance)}
onCheckedChange={(checked) =>
onChange("excludeFromBalance", checked ? "true" : "false")
}
@@ -130,10 +127,7 @@ export function AccountFormFields({
<div className="flex items-center gap-2">
<Checkbox
id="exclude-initial-balance-from-income"
checked={
values.excludeInitialBalanceFromIncome === true ||
values.excludeInitialBalanceFromIncome === "true"
}
checked={Boolean(values.excludeInitialBalanceFromIncome)}
onCheckedChange={(checked) =>
onChange(
"excludeInitialBalanceFromIncome",

View File

@@ -142,7 +142,7 @@ export function AccountStatementCard({
/>
</div>
{/* Informações da Conta */}
{/* Informações da FinancialAccount */}
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 pt-2 border-t border-border/60 border-dashed">
<DetailItem
label="Tipo da conta"

View File

@@ -115,9 +115,7 @@ export function AccountsPage({
<EmptyState
media={<RiBankLine className="size-6 text-primary" />}
title={
isArchived
? "Nenhuma conta arquivada"
: "Nenhuma conta cadastrada"
isArchived ? "Nenhuma conta archived" : "Nenhuma conta cadastrada"
}
description={
isArchived

View File

@@ -4,7 +4,7 @@ import { useState, useTransition } from "react";
import { toast } from "sonner";
import { transferBetweenAccountsAction } from "@/features/accounts/actions";
import type { AccountData } from "@/features/accounts/queries";
import { ContaCartaoSelectContent } from "@/features/transactions/components/select-items";
import { AccountCardSelectContent } from "@/features/transactions/components/select-items";
import { PeriodPicker } from "@/shared/components/period-picker";
import { Button } from "@/shared/components/ui/button";
import { CurrencyInput } from "@/shared/components/ui/currency-input";
@@ -157,12 +157,12 @@ export function TransferDialog({
</div>
<div className="flex flex-col gap-2 sm:col-span-2">
<Label htmlFor="from-account">Conta de origem</Label>
<Label htmlFor="from-account">FinancialAccount de origem</Label>
<Select value={fromAccountId} disabled>
<SelectTrigger id="from-account" className="w-full">
<SelectValue>
{fromAccount && (
<ContaCartaoSelectContent
<AccountCardSelectContent
label={fromAccount.name}
logo={fromAccount.logo}
isCartao={false}
@@ -173,7 +173,7 @@ export function TransferDialog({
<SelectContent>
{fromAccount && (
<SelectItem value={fromAccount.id}>
<ContaCartaoSelectContent
<AccountCardSelectContent
label={fromAccount.name}
logo={fromAccount.logo}
isCartao={false}
@@ -185,7 +185,7 @@ export function TransferDialog({
</div>
<div className="flex flex-col gap-2 sm:col-span-2">
<Label htmlFor="to-account">Conta de destino</Label>
<Label htmlFor="to-account">FinancialAccount de destino</Label>
{availableAccounts.length === 0 ? (
<div className="rounded-md border border-border bg-muted p-3 text-sm text-muted-foreground">
É necessário ter mais de uma conta cadastrada para realizar
@@ -201,7 +201,7 @@ export function TransferDialog({
(acc) => acc.id === toAccountId,
);
return selectedAccount ? (
<ContaCartaoSelectContent
<AccountCardSelectContent
label={selectedAccount.name}
logo={selectedAccount.logo}
isCartao={false}
@@ -213,7 +213,7 @@ export function TransferDialog({
<SelectContent className="w-full">
{availableAccounts.map((account) => (
<SelectItem key={account.id} value={account.id}>
<ContaCartaoSelectContent
<AccountCardSelectContent
label={account.name}
logo={account.logo}
isCartao={false}