Files
tessera/src/models/ticket.ts
Gjermund Høsøien Wiggen 70f0924d4b feat: auth system, scrip scheduler, UI widgets, and new API routes
- Add session-based authentication (login page, middleware, auth context)
- Add cron-like scrip scheduler for time-based conditions
- Add layout builder, scrip wizard, searchable select components
- Add trend chart widget for dashboards
- Add notifications, attachments, queue-permissions API routes
- Add seed-users script
- Update schema with 10 new migrations (0008-0017)
- Apply redesign: Linear-inspired dark theme, conversation-centric UI
- Gitignore runtime data directory

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 20:42:17 +02:00

28 lines
951 B
TypeScript

import type { InferSelectModel } from 'drizzle-orm';
import { z } from 'zod/v4';
import { tickets } from '../db/schema.ts';
export type Ticket = InferSelectModel<typeof tickets>;
export const CreateTicketSchema = z.object({
subject: z.string().min(1),
queue_id: z.string().uuid(),
description: z.string().trim().optional(),
custom_fields: z.record(z.string(), z.string()).optional(),
});
export const UpdateTicketSchema = z.object({
subject: z.string().min(1).optional(),
status: z.string().min(1).optional(),
owner_id: z.string().uuid().nullable().optional(),
team_id: z.string().uuid().nullable().optional(),
});
export const CommentSchema = z.object({
body: z.string().min(1),
creator_id: z.string().optional().default('00000000-0000-0000-0000-000000000000'),
internal: z.boolean().optional().default(false),
attachment_ids: z.array(z.string()).optional(),
time_worked_minutes: z.number().int().min(0).optional(),
});