feat(categories): kategori ağacı, varsayılan Türkçe set ve yönetim ekranı

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-05 02:57:58 +03:00
parent eaf80c6bb4
commit 380ddaf303
10 changed files with 1469 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { z } from "zod";
import { tr } from "../../i18n/tr";
import { ICON_KEYS, SWATCHES } from "../appearance";
export const CATEGORY_KINDS = ["expense", "income"] as const;
export type CategoryKind = (typeof CATEGORY_KINDS)[number];
export const categoryFormSchema = z.object({
kind: z.enum(CATEGORY_KINDS),
name: z.string().trim().min(1, tr.common.required).max(80, tr.validation.nameMax),
parentId: z
.string()
.regex(/^([a-f0-9]{24})?$/i)
.transform((s) => (s === "" ? null : s)),
icon: z.enum(ICON_KEYS),
color: z.enum(SWATCHES),
});
export type CategoryFormInput = z.input<typeof categoryFormSchema>;
export type CategoryForm = z.output<typeof categoryFormSchema>;