diff --git a/src/features/settings/lib/changelog-types.ts b/src/features/settings/lib/changelog-types.ts index dfe8027..8df4cbc 100644 --- a/src/features/settings/lib/changelog-types.ts +++ b/src/features/settings/lib/changelog-types.ts @@ -1,6 +1,6 @@ export type SectionType = "Adicionado" | "Alterado" | "Corrigido" | "Removido"; -export const SECTION_TYPES: readonly SectionType[] = [ +const SECTION_TYPES: readonly SectionType[] = [ "Adicionado", "Alterado", "Corrigido", diff --git a/src/features/transactions/actions/core.ts b/src/features/transactions/actions/core.ts index 244feb3..080a269 100644 --- a/src/features/transactions/actions/core.ts +++ b/src/features/transactions/actions/core.ts @@ -31,19 +31,6 @@ import { addMonthsToPeriod, MONTH_NAMES } from "@/shared/utils/period"; // Authorization Validation Functions // ============================================================================ -export async function validatePayerOwnership( - userId: string, - payerId: string | null | undefined, -): Promise { - if (!payerId) return true; - - const pagador = await db.query.payers.findFirst({ - where: and(eq(payers.id, payerId), eq(payers.userId, userId)), - }); - - return !!pagador; -} - const normalizeIds = (ids: Array) => [ ...new Set(ids.filter((id): id is string => Boolean(id))), ]; @@ -592,7 +579,7 @@ type SplitShareInput = { amount: number; }; -export const resolveSplitShares = (data: { +const resolveSplitShares = (data: { payerId?: string | null; secondaryPayerId?: string | null; splitShares?: SplitShareInput[]; diff --git a/src/features/transactions/components/dialogs/transaction-dialog/split-config-dialog.tsx b/src/features/transactions/components/dialogs/transaction-dialog/split-config-dialog.tsx index 0b9fdbc..1034119 100644 --- a/src/features/transactions/components/dialogs/transaction-dialog/split-config-dialog.tsx +++ b/src/features/transactions/components/dialogs/transaction-dialog/split-config-dialog.tsx @@ -137,24 +137,6 @@ export function getSplitSummaryData( }; } -export function getSplitSummaryLabel( - formState: FormState, - payerOptions: SplitSummaryPayerOption[], - totalAmount: number, -) { - const summary = getSplitSummaryData(formState, payerOptions, totalAmount); - - if (summary.type === "text") return summary.label; - - const namesLabel = summary.participants - .map((participant) => participant.firstName) - .join(" "); - const remainingLabel = - summary.remainingCount > 0 ? ` +${summary.remainingCount}` : ""; - - return `${summary.count} pessoas: ${namesLabel}${remainingLabel} ยท ${summary.totalLabel}`; -} - export function SplitConfigDialog({ open, onOpenChange, diff --git a/src/features/transactions/lib/category-helpers.ts b/src/features/transactions/lib/category-helpers.ts index 9d1c5bd..45240f0 100644 --- a/src/features/transactions/lib/category-helpers.ts +++ b/src/features/transactions/lib/category-helpers.ts @@ -61,13 +61,3 @@ export function groupAndSortCategories( ), })); } - -/** - * Filters secondary payer options to exclude the primary payer - */ -export function filterSecondaryPayerOptions( - allOptions: SelectOption[], - primaryPayerId?: string, -): SelectOption[] { - return allOptions.filter((option) => option.value !== primaryPayerId); -} diff --git a/src/features/transactions/lib/page-helpers.ts b/src/features/transactions/lib/page-helpers.ts index f3bccb9..5043dfe 100644 --- a/src/features/transactions/lib/page-helpers.ts +++ b/src/features/transactions/lib/page-helpers.ts @@ -150,10 +150,7 @@ export const getSingleParam = ( return Array.isArray(value) ? (value[0] ?? null) : value; }; -export const getMultiParam = ( - params: ResolvedSearchParams, - key: string, -): string[] => { +const getMultiParam = (params: ResolvedSearchParams, key: string): string[] => { const value = params?.[key]; if (!value) { return []; diff --git a/src/shared/lib/logo/index.ts b/src/shared/lib/logo/index.ts index 3c153f6..8a4d4fc 100644 --- a/src/shared/lib/logo/index.ts +++ b/src/shared/lib/logo/index.ts @@ -36,7 +36,7 @@ export const getLogoDisplayName = (logo?: string | null): string => { * @example * deriveNameFromLogo("my-company-logo.png") // "My Company Logo" */ -export const deriveNameFromLogo = (logo?: string | null) => { +const deriveNameFromLogo = (logo?: string | null) => { if (!logo) { return ""; }