metis-desk/modules/assets/src/api/domain/support-values.ts

23 lines
751 B
TypeScript
Raw Normal View History

2026-10-07 08:16:39 +00:00
import { z } from "zod/v4";
export const SupportValuesSchema = z
.strictObject({
toolId: z.uuid(),
destination: z.string().trim().max(300),
requiresVpn: z.boolean(),
preferred: z.boolean(),
state: z.enum(["pending", "available", "retired"]),
notes: z.string().trim().max(2000),
})
.refine((value) => !value.preferred || value.state === "available");
export type SupportInput = z.infer<typeof SupportValuesSchema>;
export const SupportToolInputSchema = z.strictObject({
name: z.string().trim().min(1).max(100),
active: z.boolean(),
});
export type SupportToolInput = z.infer<typeof SupportToolInputSchema>;
export class SupportError extends Error {
constructor(public readonly code: string) {
super(code);
}
}