mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-09 19:01:47 +00:00
refactor(ui): renomear "Pagador/Pagadores" para "Pessoa/Pessoas" na interface
Todas as strings visíveis ao usuário (labels, títulos, toasts, mensagens de erro, cabeçalhos de tabela, exportações) foram atualizadas. Acordos de gênero em português corrigidos. Código, rotas (/payers) e schema do banco (pagadores) permanecem inalterados — divergência intencional documentada em CLAUDE.md e CHANGELOG. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -602,7 +602,7 @@ export async function createMassTransactionsAction(
|
||||
if (transaction.payerId && invalidPayers.has(transaction.payerId)) {
|
||||
return {
|
||||
success: false,
|
||||
error: `Payer não encontrado na transação ${i + 1}.`,
|
||||
error: `Pessoa não encontrado na transação ${i + 1}.`,
|
||||
};
|
||||
}
|
||||
if (
|
||||
@@ -611,7 +611,7 @@ export async function createMassTransactionsAction(
|
||||
) {
|
||||
return {
|
||||
success: false,
|
||||
error: `Category não encontrada na transação ${i + 1}.`,
|
||||
error: `Categoria não encontrada na transação ${i + 1}.`,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,8 +189,8 @@ export async function validateAllOwnership(
|
||||
];
|
||||
|
||||
const errors = [
|
||||
"Pagador não encontrado ou sem permissão.",
|
||||
"Pagador secundário não encontrado ou sem permissão.",
|
||||
"Pessoa não encontrada ou sem permissão.",
|
||||
"Pessoa secundário não encontrado ou sem permissão.",
|
||||
"Categoria não encontrada.",
|
||||
"Conta não encontrada.",
|
||||
"Cartão não encontrado.",
|
||||
@@ -359,7 +359,7 @@ const refineLancamento = (
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["payerId"],
|
||||
message: "Selecione o pagador principal para dividir o lançamento.",
|
||||
message: "Selecione a pessoa principal para dividir o lançamento.",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -367,13 +367,13 @@ const refineLancamento = (
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["secondaryPayerId"],
|
||||
message: "Selecione o pagador secundário para dividir o lançamento.",
|
||||
message: "Selecione a pessoa secundário para dividir o lançamento.",
|
||||
});
|
||||
} else if (data.payerId && data.secondaryPayerId === data.payerId) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
path: ["secondaryPayerId"],
|
||||
message: "Escolha um pagador diferente para dividir o lançamento.",
|
||||
message: "Escolha uma pessoa diferente para dividir o lançamento.",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ export async function importTransactionsAction(
|
||||
validateCartaoOwnership(userId, cardId),
|
||||
]);
|
||||
|
||||
if (!payerOk) return { success: false, error: "Pagador não encontrado." };
|
||||
if (!payerOk) return { success: false, error: "Pessoa não encontrada." };
|
||||
if (!accountOk) return { success: false, error: "Conta não encontrada." };
|
||||
if (!cardOk) return { success: false, error: "Cartão não encontrado." };
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ export async function createInstallmentAnticipationAction(
|
||||
if (data.payerId && payer.length === 0) {
|
||||
return {
|
||||
success: false,
|
||||
error: "Pagador inválido para esta conta.",
|
||||
error: "Pessoa inválida para esta conta.",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export const LANCAMENTOS_COLUMN_LABELS: Record<string, string> = {
|
||||
condition: "Condição",
|
||||
paymentMethod: "Forma de Pagamento",
|
||||
categoriaName: "Categoria",
|
||||
pagadorName: "Pagador",
|
||||
pagadorName: "Pessoa",
|
||||
note: "Anotação",
|
||||
contaCartao: "Conta/Cartão",
|
||||
};
|
||||
|
||||
@@ -269,7 +269,7 @@ export function AnticipateInstallmentsDialog({
|
||||
</Field>
|
||||
|
||||
<Field className="gap-1">
|
||||
<FieldLabel htmlFor="anticipation-pagador">Pagador</FieldLabel>
|
||||
<FieldLabel htmlFor="anticipation-pagador">Pessoa</FieldLabel>
|
||||
<FieldContent>
|
||||
<Select
|
||||
value={formState.payerId}
|
||||
|
||||
@@ -116,7 +116,7 @@ export function BulkActionDialog({
|
||||
htmlFor="period"
|
||||
className="text-sm cursor-pointer font-medium"
|
||||
>
|
||||
Todos os pagadores deste período
|
||||
Todas as pessoas deste período
|
||||
</Label>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Aplica a todos os lançamentos deste mesmo mês na série
|
||||
@@ -125,7 +125,7 @@ export function BulkActionDialog({
|
||||
<div className="mt-1.5 flex items-start gap-1.5 rounded-md bg-amber-50 px-2 py-1.5 text-amber-800 dark:bg-amber-950/40 dark:text-amber-300">
|
||||
<RiErrorWarningLine className="mt-0.5 size-3.5 shrink-0" />
|
||||
<p className="text-xs">
|
||||
Atenção: os valores individuais de cada pagador serão
|
||||
Atenção: os valores individuais de cada pessoa serão
|
||||
substituídos pelos valores deste lançamento.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -90,7 +90,7 @@ export function BulkImportDialog({
|
||||
event.preventDefault();
|
||||
|
||||
if (!payerId) {
|
||||
toast.error("Selecione o pagador.");
|
||||
toast.error("Selecione a pessoa.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -197,16 +197,16 @@ export function BulkImportDialog({
|
||||
<DialogDescription>
|
||||
Importando {itemCount}{" "}
|
||||
{itemCount === 1 ? "lançamento" : "lançamentos"}. Selecione o
|
||||
pagador, categoria e forma de pagamento para aplicar a todos.
|
||||
pessoa, categoria e forma de pagamento para aplicar a todos.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<form className="space-y-4" onSubmit={handleSubmit}>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="pagador">Pagador *</Label>
|
||||
<Label htmlFor="pagador">Pessoa *</Label>
|
||||
<Select value={payerId} onValueChange={setPagadorId}>
|
||||
<SelectTrigger id="pagador" className="w-full">
|
||||
<SelectValue placeholder="Selecione o pagador">
|
||||
<SelectValue placeholder="Selecione a pessoa">
|
||||
{payerId &&
|
||||
(() => {
|
||||
const selectedOption = payerOptions.find(
|
||||
|
||||
@@ -525,7 +525,7 @@ export function MassAddDialog({
|
||||
htmlFor={`pagador-${transaction.id}`}
|
||||
className="sr-only"
|
||||
>
|
||||
Pagador {index + 1}
|
||||
Pessoa {index + 1}
|
||||
</Label>
|
||||
<Select
|
||||
value={transaction.payerId}
|
||||
@@ -537,7 +537,7 @@ export function MassAddDialog({
|
||||
id={`pagador-${transaction.id}`}
|
||||
className="w-32 truncate"
|
||||
>
|
||||
<SelectValue placeholder="Pagador">
|
||||
<SelectValue placeholder="Pessoa">
|
||||
{transaction.payerId &&
|
||||
(() => {
|
||||
const selectedOption = payerOptions.find(
|
||||
|
||||
@@ -50,7 +50,7 @@ export function PayerSection({
|
||||
<div>
|
||||
<p className="text-sm text-foreground">Dividir lançamento</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Atribuir parte do valor a outro pagador.
|
||||
Atribuir parte do valor a outra pessoa.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -75,7 +75,7 @@ export function PayerSection({
|
||||
|
||||
<div className="flex w-full flex-col gap-2 md:flex-row">
|
||||
<div className="w-full space-y-1">
|
||||
<Label htmlFor="payer">Pagador</Label>
|
||||
<Label htmlFor="payer">Pessoa</Label>
|
||||
<div className="flex gap-2">
|
||||
<Select
|
||||
value={formState.payerId ?? ""}
|
||||
|
||||
@@ -230,7 +230,7 @@ export function TransactionDialog({
|
||||
|
||||
if (formState.isSplit && !formState.payerId) {
|
||||
const message =
|
||||
"Selecione o pagador principal para dividir o lançamento.";
|
||||
"Selecione a pessoa principal para dividir o lançamento.";
|
||||
setErrorMessage(message);
|
||||
toast.error(message);
|
||||
return;
|
||||
@@ -238,7 +238,7 @@ export function TransactionDialog({
|
||||
|
||||
if (formState.isSplit && !formState.secondaryPayerId) {
|
||||
const message =
|
||||
"Selecione o pagador secundário para dividir o lançamento.";
|
||||
"Selecione a pessoa secundário para dividir o lançamento.";
|
||||
setErrorMessage(message);
|
||||
toast.error(message);
|
||||
return;
|
||||
@@ -464,7 +464,7 @@ export function TransactionDialog({
|
||||
const description =
|
||||
mode === "create"
|
||||
? isImportMode
|
||||
? "Importando lançamento de outro usuário. Ajuste a categoria, pagador e cartão/conta antes de salvar."
|
||||
? "Importando lançamento de outro usuário. Ajuste a categoria, pessoa e cartão/conta antes de salvar."
|
||||
: isCopyMode
|
||||
? "Os dados do lançamento foram copiados. Revise e ajuste conforme necessário antes de salvar."
|
||||
: isNewWithType
|
||||
@@ -519,7 +519,7 @@ export function TransactionDialog({
|
||||
|
||||
<div className="border-t border-border/40 my-3" />
|
||||
|
||||
{/* Pagador */}
|
||||
{/* Pessoa */}
|
||||
<PayerSection
|
||||
formState={formState}
|
||||
onFieldChange={handleFieldChange}
|
||||
|
||||
@@ -123,13 +123,13 @@ export function GlobalFields({
|
||||
</div>
|
||||
|
||||
<div className="flex min-w-44 flex-col gap-1.5">
|
||||
<Label>Pagador</Label>
|
||||
<Label>Pessoa</Label>
|
||||
<Select
|
||||
value={payerId ?? ""}
|
||||
onValueChange={(v) => onPayerChange(v || null)}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Selecionar pagador…" />
|
||||
<SelectValue placeholder="Selecionar pessoa…" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{payerOptions.map((opt) => (
|
||||
|
||||
@@ -134,7 +134,7 @@ export function AnticipationCard({
|
||||
|
||||
{anticipation.payer && (
|
||||
<div>
|
||||
<dt className="text-muted-foreground">Pagador</dt>
|
||||
<dt className="text-muted-foreground">Pessoa</dt>
|
||||
<dd className="mt-1 font-medium">{anticipation.payer.name}</dd>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -229,12 +229,12 @@ function buildColumns({
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="sr-only">
|
||||
Dividido entre pagadores
|
||||
Dividido entre pessoas
|
||||
</span>
|
||||
</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top">
|
||||
Dividido entre pagadores
|
||||
Dividido entre pessoas
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
@@ -408,10 +408,10 @@ function buildColumns({
|
||||
},
|
||||
{
|
||||
accessorKey: "pagadorName",
|
||||
header: "Pagador",
|
||||
header: "Pessoa",
|
||||
cell: ({ row }) => {
|
||||
const { payerId, pagadorName, pagadorAvatar } = row.original;
|
||||
const label = pagadorName?.trim() || "Sem pagador";
|
||||
const label = pagadorName?.trim() || "Sem pessoa";
|
||||
const displayName = label.split(/\s+/)[0] ?? label;
|
||||
const avatarSrc = getAvatarSrc(pagadorAvatar);
|
||||
const initial = displayName.charAt(0).toUpperCase() || "?";
|
||||
|
||||
@@ -386,7 +386,7 @@ export function TransactionsFilters({
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium">Pagador</label>
|
||||
<label className="text-sm font-medium">Pessoa</label>
|
||||
<Select
|
||||
value={getParamValue("payer")}
|
||||
onValueChange={(value) =>
|
||||
|
||||
@@ -109,7 +109,7 @@ export function TransactionsExport({
|
||||
"Valor",
|
||||
"Category",
|
||||
"Conta/Cartão",
|
||||
"Payer",
|
||||
"Pessoa",
|
||||
];
|
||||
const rows: string[][] = [];
|
||||
|
||||
@@ -169,7 +169,7 @@ export function TransactionsExport({
|
||||
"Valor",
|
||||
"Category",
|
||||
"Conta/Cartão",
|
||||
"Payer",
|
||||
"Pessoa",
|
||||
];
|
||||
const rows: (string | number)[][] = [];
|
||||
|
||||
@@ -277,7 +277,7 @@ export function TransactionsExport({
|
||||
"Valor",
|
||||
"Categoria",
|
||||
"Conta/Cartão",
|
||||
"Payer",
|
||||
"Pessoa",
|
||||
],
|
||||
];
|
||||
|
||||
@@ -317,7 +317,7 @@ export function TransactionsExport({
|
||||
5: { cellWidth: 24 }, // Valor
|
||||
6: { cellWidth: 30 }, // Categoria
|
||||
7: { cellWidth: 30 }, // Conta/Cartão
|
||||
8: { cellWidth: 31 }, // Payer
|
||||
8: { cellWidth: 31 }, // Pessoa
|
||||
},
|
||||
didParseCell: (cellData) => {
|
||||
if (cellData.section === "body" && cellData.column.index === 5) {
|
||||
|
||||
Reference in New Issue
Block a user