feat(dashboard): confirmação de pagamento com conta e data para faturas e boletos

- widget de faturas abre modal com seleção de conta de origem e data antes de pagar
- widget de boletos ganha a mesma paridade: modal com conta de pagamento e data
- toggleTransactionSettlementAction aceita paymentAccountId e paymentDate opcionais
- DashboardBill expõe accountId para inicializar o modal com a conta já vinculada

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Felipe Coutinho
2026-05-02 22:08:16 +00:00
parent 4bea6330bf
commit 0f5c735be0
8 changed files with 441 additions and 105 deletions

View File

@@ -1,20 +1,31 @@
"use client";
import type { DashboardInvoice } from "@/features/dashboard/invoices/invoices-queries";
import type {
DashboardInvoice,
InvoicePaymentAccountOption,
} from "@/features/dashboard/invoices/invoices-queries";
import { useInvoicesWidgetController } from "@/features/dashboard/invoices/use-invoices-widget-controller";
import { InvoicesWidgetView } from "../invoices/invoices-widget-view";
type InvoicesWidgetProps = {
invoices: DashboardInvoice[];
paymentAccountOptions: InvoicePaymentAccountOption[];
};
export function InvoicesWidget({ invoices }: InvoicesWidgetProps) {
export function InvoicesWidget({
invoices,
paymentAccountOptions,
}: InvoicesWidgetProps) {
const {
items,
selectedInvoice,
isModalOpen,
modalState,
isPending,
paymentAccountId,
setPaymentAccountId,
paymentDate,
setPaymentDate,
openPaymentDialog,
closePaymentDialog,
confirmPayment,
@@ -27,6 +38,11 @@ export function InvoicesWidget({ invoices }: InvoicesWidgetProps) {
isModalOpen={isModalOpen}
modalState={modalState}
isPending={isPending}
paymentAccountId={paymentAccountId}
onPaymentAccountChange={setPaymentAccountId}
paymentDate={paymentDate}
onPaymentDateChange={setPaymentDate}
paymentAccountOptions={paymentAccountOptions}
onOpenPaymentDialog={openPaymentDialog}
onClosePaymentDialog={closePaymentDialog}
onConfirmPayment={confirmPayment}