feat(documents): accept selected_custom_fields in document schemas

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-16 20:08:44 +02:00
parent 2f084174df
commit 2b3266a1cc
3 changed files with 21 additions and 0 deletions

View File

@@ -50,6 +50,11 @@ export const CreateInvoiceSchema = z.object({
// Rich-text CZ/EN "Obsah" sections rendered after the items on the PDF
// (mirrors issued orders — shared DocumentSectionSchema, DB-aligned limits).
sections: z.array(DocumentSectionSchema).optional(),
// Positional indices of company custom fields to print on this document's PDF.
selected_custom_fields: z
.array(z.number().int().nonnegative())
.max(200)
.optional(),
});
export const UpdateInvoiceSchema = z.object({
@@ -74,6 +79,10 @@ export const UpdateInvoiceSchema = z.object({
paid_date: nullableIsoDateString,
items: z.array(InvoiceItemSchema).optional(),
sections: z.array(DocumentSectionSchema).optional(),
selected_custom_fields: z
.array(z.number().int().nonnegative())
.max(200)
.optional(),
});
export type CreateInvoiceInput = z.infer<typeof CreateInvoiceSchema>;