refactor: remove category rules and related logic from defaults, types, and services for cleaner codebase

This commit is contained in:
Julien Froidefond
2025-11-27 10:41:10 +01:00
parent 2aafce4df0
commit cf109984e5
6 changed files with 5 additions and 135 deletions

View File

@@ -1,9 +1,9 @@
import { prisma } from "@/lib/prisma"
import type { BankingData, Account, Transaction, Folder, Category, CategoryRule } from "@/lib/types"
import type { BankingData, Account, Transaction, Folder, Category } from "@/lib/types"
export const bankingService = {
async getAllData(): Promise<BankingData> {
const [accounts, transactions, folders, categories, categoryRules] = await Promise.all([
const [accounts, transactions, folders, categories] = await Promise.all([
prisma.account.findMany({
include: {
folder: true,
@@ -17,7 +17,6 @@ export const bankingService = {
}),
prisma.folder.findMany(),
prisma.category.findMany(),
prisma.categoryRule.findMany(),
])
// Transform Prisma models to match our types
@@ -61,12 +60,6 @@ export const bankingService = {
keywords: JSON.parse(c.keywords) as string[],
parentId: c.parentId,
})),
categoryRules: categoryRules.map((r): CategoryRule => ({
id: r.id,
categoryId: r.categoryId,
pattern: r.pattern,
isRegex: r.isRegex,
})),
}
},
}