d8785a964d
Every AGENT now gets an auto-generated API key on creation, shown once in a modal. AGENTs log in with password and authenticate to the API with X-Api-Key. pre-push.sql defensively migrates any residual SERVICE rows to AGENT before Prisma rewrites the enum. Goddard is no longer baked into the seed — create agents via Admin → Users. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
15 lines
524 B
TypeScript
15 lines
524 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const ROLES = ['ADMIN', 'AGENT', 'USER'] as const;
|
|
export const TICKET_STATUSES = ['OPEN', 'IN_PROGRESS', 'RESOLVED', 'CLOSED'] as const;
|
|
|
|
export const roleSchema = z.enum(ROLES);
|
|
export const ticketStatusSchema = z.enum(TICKET_STATUSES);
|
|
|
|
export type Role = (typeof ROLES)[number];
|
|
export type TicketStatus = (typeof TICKET_STATUSES)[number];
|
|
|
|
export const SEVERITY_MIN = 1;
|
|
export const SEVERITY_MAX = 5;
|
|
export const severitySchema = z.number().int().min(SEVERITY_MIN).max(SEVERITY_MAX);
|