mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 10:30:37 +09:00
24 lines
832 B
TypeScript
24 lines
832 B
TypeScript
|
|
import { z } from "zod";
|
||
|
|
|
||
|
|
export const createCostEventSchema = z.object({
|
||
|
|
agentId: z.string().uuid(),
|
||
|
|
issueId: z.string().uuid().optional().nullable(),
|
||
|
|
projectId: z.string().uuid().optional().nullable(),
|
||
|
|
goalId: z.string().uuid().optional().nullable(),
|
||
|
|
billingCode: z.string().optional().nullable(),
|
||
|
|
provider: z.string().min(1),
|
||
|
|
model: z.string().min(1),
|
||
|
|
inputTokens: z.number().int().nonnegative().optional().default(0),
|
||
|
|
outputTokens: z.number().int().nonnegative().optional().default(0),
|
||
|
|
costCents: z.number().int().nonnegative(),
|
||
|
|
occurredAt: z.string().datetime(),
|
||
|
|
});
|
||
|
|
|
||
|
|
export type CreateCostEvent = z.infer<typeof createCostEventSchema>;
|
||
|
|
|
||
|
|
export const updateBudgetSchema = z.object({
|
||
|
|
budgetMonthlyCents: z.number().int().nonnegative(),
|
||
|
|
});
|
||
|
|
|
||
|
|
export type UpdateBudget = z.infer<typeof updateBudgetSchema>;
|