refactor: remove exports internos sem uso

This commit is contained in:
Felipe Coutinho
2026-06-06 16:31:38 -03:00
parent 356801324c
commit 811a035cb0
6 changed files with 4 additions and 48 deletions

View File

@@ -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",

View File

@@ -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<boolean> {
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<string | null | undefined>) => [
...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[];

View File

@@ -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,

View File

@@ -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);
}

View File

@@ -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 [];

View File

@@ -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 "";
}