fix: corrigir tipos e eliminar non-null assertions
Substitui non-null assertions (!) por type assertions ou optional chaining com guards. Troca any por unknown/tipos explícitos. - drizzle.config: DATABASE_URL! → as string - use-form-state: Record<string, any> → Record<string, unknown> - actions: catch (e: any) → catch (e), model tipado explicitamente - pagadores/data: row: any → Record<string, unknown> - note-dialog: result tipado explicitamente - bulk-import: payload as any removido - Map.get()! → optional chaining + guards em relatórios e dashboard Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,8 @@ type ContaSluggedOption = BaseSluggedOption & {
|
||||
type CartaoSluggedOption = BaseSluggedOption & {
|
||||
kind: "cartao";
|
||||
logo: string | null;
|
||||
closingDay: string | null;
|
||||
dueDay: string | null;
|
||||
};
|
||||
|
||||
export type SluggedFilters = {
|
||||
@@ -160,6 +162,8 @@ export const toOption = (
|
||||
logo?: string | null,
|
||||
icon?: string | null,
|
||||
accountType?: string | null,
|
||||
closingDay?: string | null,
|
||||
dueDay?: string | null,
|
||||
): SelectOption => ({
|
||||
value,
|
||||
label: normalizeLabel(label),
|
||||
@@ -170,6 +174,8 @@ export const toOption = (
|
||||
logo: logo ?? null,
|
||||
icon: icon ?? null,
|
||||
accountType: accountType ?? null,
|
||||
closingDay: closingDay ?? null,
|
||||
dueDay: dueDay ?? null,
|
||||
});
|
||||
|
||||
export const fetchLancamentoFilterSources = async (userId: string) => {
|
||||
@@ -252,6 +258,8 @@ export const buildSluggedFilters = ({
|
||||
slug: contaCartaoSlugger(label),
|
||||
kind: "cartao" as const,
|
||||
logo: cartao.logo ?? null,
|
||||
closingDay: cartao.closingDay ?? null,
|
||||
dueDay: cartao.dueDay ?? null,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -378,7 +386,7 @@ export const buildLancamentoWhere = ({
|
||||
ilike(lancamentos.condition, searchPattern),
|
||||
and(isNotNull(contas.name), ilike(contas.name, searchPattern)),
|
||||
and(isNotNull(cartoes.name), ilike(cartoes.name, searchPattern)),
|
||||
)!,
|
||||
) as SQL,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -501,8 +509,20 @@ export const buildOptionSets = ({
|
||||
: cartaoFiltersRaw;
|
||||
|
||||
const cartaoOptions = sortByLabel(
|
||||
cartaoOptionsSource.map(({ id, label, slug, logo }) =>
|
||||
toOption(id, label, undefined, undefined, slug, undefined, logo),
|
||||
cartaoOptionsSource.map(({ id, label, slug, logo, closingDay, dueDay }) =>
|
||||
toOption(
|
||||
id,
|
||||
label,
|
||||
undefined,
|
||||
undefined,
|
||||
slug,
|
||||
undefined,
|
||||
logo,
|
||||
undefined,
|
||||
undefined,
|
||||
closingDay,
|
||||
dueDay,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user