feat: endurece mutações financeiras e permite zerar conta

This commit is contained in:
Felipe Coutinho
2026-03-20 18:42:18 +00:00
parent f77c64325d
commit e4dd221709
23 changed files with 5490 additions and 2942 deletions

View File

@@ -20,7 +20,10 @@ interface AccountFormFieldsProps {
values: AccountFormValues;
accountTypes: string[];
accountStatuses: string[];
onChange: (field: keyof AccountFormValues, value: string) => void;
onChange: <K extends keyof AccountFormValues>(
field: K,
value: AccountFormValues[K],
) => void;
showInitialBalance?: boolean;
}
@@ -112,7 +115,7 @@ export function AccountFormFields({
id="exclude-from-balance"
checked={Boolean(values.excludeFromBalance)}
onCheckedChange={(checked) =>
onChange("excludeFromBalance", checked ? "true" : "false")
onChange("excludeFromBalance", checked === true)
}
/>
<Label
@@ -129,10 +132,7 @@ export function AccountFormFields({
id="exclude-initial-balance-from-income"
checked={Boolean(values.excludeInitialBalanceFromIncome)}
onCheckedChange={(checked) =>
onChange(
"excludeInitialBalanceFromIncome",
checked ? "true" : "false",
)
onChange("excludeInitialBalanceFromIncome", checked === true)
}
/>
<Label