2026-02-16 13:31:47 -06:00
|
|
|
import { z } from "zod";
|
|
|
|
|
import { ISSUE_PRIORITIES, ISSUE_STATUSES } from "../constants.js";
|
|
|
|
|
|
|
|
|
|
export const createIssueSchema = z.object({
|
Expand data model with companies, approvals, costs, and heartbeats
Add new DB schemas: companies, agent_api_keys, approvals, cost_events,
heartbeat_runs, issue_comments. Add corresponding shared types and
validators. Update existing schemas (agents, goals, issues, projects)
with new fields for company association, budgets, and richer metadata.
Generate initial Drizzle migration. Update seed data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:07:22 -06:00
|
|
|
projectId: z.string().uuid().optional().nullable(),
|
|
|
|
|
goalId: z.string().uuid().optional().nullable(),
|
|
|
|
|
parentId: z.string().uuid().optional().nullable(),
|
2026-02-16 13:31:47 -06:00
|
|
|
title: z.string().min(1),
|
|
|
|
|
description: z.string().optional().nullable(),
|
|
|
|
|
status: z.enum(ISSUE_STATUSES).optional().default("backlog"),
|
|
|
|
|
priority: z.enum(ISSUE_PRIORITIES).optional().default("medium"),
|
Expand data model with companies, approvals, costs, and heartbeats
Add new DB schemas: companies, agent_api_keys, approvals, cost_events,
heartbeat_runs, issue_comments. Add corresponding shared types and
validators. Update existing schemas (agents, goals, issues, projects)
with new fields for company association, budgets, and richer metadata.
Generate initial Drizzle migration. Update seed data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:07:22 -06:00
|
|
|
assigneeAgentId: z.string().uuid().optional().nullable(),
|
|
|
|
|
requestDepth: z.number().int().nonnegative().optional().default(0),
|
|
|
|
|
billingCode: z.string().optional().nullable(),
|
2026-02-16 13:31:47 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export type CreateIssue = z.infer<typeof createIssueSchema>;
|
|
|
|
|
|
|
|
|
|
export const updateIssueSchema = createIssueSchema.partial();
|
|
|
|
|
|
|
|
|
|
export type UpdateIssue = z.infer<typeof updateIssueSchema>;
|
Expand data model with companies, approvals, costs, and heartbeats
Add new DB schemas: companies, agent_api_keys, approvals, cost_events,
heartbeat_runs, issue_comments. Add corresponding shared types and
validators. Update existing schemas (agents, goals, issues, projects)
with new fields for company association, budgets, and richer metadata.
Generate initial Drizzle migration. Update seed data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:07:22 -06:00
|
|
|
|
|
|
|
|
export const checkoutIssueSchema = z.object({
|
|
|
|
|
agentId: z.string().uuid(),
|
|
|
|
|
expectedStatuses: z.array(z.enum(ISSUE_STATUSES)).nonempty(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export type CheckoutIssue = z.infer<typeof checkoutIssueSchema>;
|
|
|
|
|
|
|
|
|
|
export const addIssueCommentSchema = z.object({
|
|
|
|
|
body: z.string().min(1),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export type AddIssueComment = z.infer<typeof addIssueCommentSchema>;
|