feat(ai): chat / extract-invoices / usage / budget routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-08 14:43:47 +02:00
parent bcf63d00d1
commit ec74ded953
4 changed files with 269 additions and 1 deletions

20
src/schemas/ai.schema.ts Normal file
View File

@@ -0,0 +1,20 @@
import { z } from "zod";
export const AiChatSchema = z.object({
messages: z
.array(
z.object({
role: z.enum(["user", "assistant"]),
content: z.string().min(1).max(8000),
}),
)
.min(1, "Zpráva je povinná")
.max(100, "Příliš mnoho zpráv"),
});
export const AiBudgetSchema = z.object({
budget_usd: z
.union([z.number(), z.string()])
.transform((v) => Number(v))
.refine((n) => Number.isFinite(n) && n >= 0, "Neplatný rozpočet"),
});