refactor: atualiza transacoes dashboard e relatorios

This commit is contained in:
Felipe Coutinho
2026-03-14 12:51:22 +00:00
parent 43b0f0c47e
commit 6854017a8c
89 changed files with 2785 additions and 2705 deletions

View File

@@ -1,8 +1,8 @@
import type {
AntecipacaoParcela,
Categoria,
Lancamento,
Pagador,
Category,
InstallmentAnticipation,
Payer,
Transaction,
} from "@/db/schema";
/**
@@ -18,17 +18,17 @@ export type EligibleInstallment = {
currentInstallment: number | null;
installmentCount: number | null;
paymentMethod: string;
categoriaId: string | null;
pagadorId: string | null;
categoryId: string | null;
payerId: string | null;
};
/**
* Antecipação com dados completos
*/
export type InstallmentAnticipationWithRelations = AntecipacaoParcela & {
lancamento: Lancamento;
pagador: Pagador | null;
categoria: Categoria | null;
export type InstallmentAnticipationWithRelations = InstallmentAnticipation & {
transaction: Transaction;
payer: Payer | null;
category: Category | null;
};
/**
@@ -39,8 +39,8 @@ export type CreateAnticipationInput = {
installmentIds: string[];
anticipationPeriod: string;
discount?: number;
pagadorId?: string;
categoriaId?: string;
payerId?: string;
categoryId?: string;
note?: string;
};

View File

@@ -1,24 +1,24 @@
import type {
LancamentoItem,
SelectOption,
TransactionItem,
} from "@/features/transactions/components/types";
export type CalendarEvent =
| {
id: string;
type: "lancamento";
type: "transaction";
date: string;
lancamento: LancamentoItem;
transaction: TransactionItem;
}
| {
id: string;
type: "boleto";
date: string;
lancamento: LancamentoItem;
transaction: TransactionItem;
}
| {
id: string;
type: "cartao";
type: "card";
date: string;
card: {
id: string;
@@ -47,12 +47,12 @@ export type CalendarDay = {
};
export type CalendarFormOptions = {
pagadorOptions: SelectOption[];
splitPagadorOptions: SelectOption[];
defaultPagadorId: string | null;
contaOptions: SelectOption[];
cartaoOptions: SelectOption[];
categoriaOptions: SelectOption[];
payerOptions: SelectOption[];
splitPayerOptions: SelectOption[];
defaultPayerId: string | null;
accountOptions: SelectOption[];
cardOptions: SelectOption[];
categoryOptions: SelectOption[];
estabelecimentos: string[];
};