mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
18 lines
556 B
TypeScript
18 lines
556 B
TypeScript
|
|
import { z } from "zod";
|
||
|
|
import { APPROVAL_TYPES } from "../constants.js";
|
||
|
|
|
||
|
|
export const createApprovalSchema = z.object({
|
||
|
|
type: z.enum(APPROVAL_TYPES),
|
||
|
|
requestedByAgentId: z.string().uuid().optional().nullable(),
|
||
|
|
payload: z.record(z.unknown()),
|
||
|
|
});
|
||
|
|
|
||
|
|
export type CreateApproval = z.infer<typeof createApprovalSchema>;
|
||
|
|
|
||
|
|
export const resolveApprovalSchema = z.object({
|
||
|
|
decisionNote: z.string().optional().nullable(),
|
||
|
|
decidedByUserId: z.string().optional().default("board"),
|
||
|
|
});
|
||
|
|
|
||
|
|
export type ResolveApproval = z.infer<typeof resolveApprovalSchema>;
|