feat: endurece mutações financeiras e permite zerar conta

This commit is contained in:
Felipe Coutinho
2026-03-20 18:42:18 +00:00
parent f77c64325d
commit e4dd221709
23 changed files with 5490 additions and 2942 deletions

View File

@@ -49,16 +49,17 @@ const DASHBOARD_ENTITIES: ReadonlySet<string> = new Set([
/**
* Revalidates paths for a specific entity.
* Also invalidates the dashboard "use cache" tag for financial entities.
* Also invalidates the user-scoped dashboard cache tag for financial entities.
* @param entity - The entity type
*/
export function revalidateForEntity(
entity: keyof typeof revalidateConfig,
userId: string,
): void {
revalidateConfig[entity].forEach((path) => revalidatePath(path));
// Invalidate dashboard cache for financial mutations
// Invalidate dashboard cache for financial mutations.
if (DASHBOARD_ENTITIES.has(entity)) {
revalidateTag("dashboard", "max");
revalidateTag(`dashboard-${userId}`, "max");
}
}