2026-02-16 13:31:47 -06:00
|
|
|
import { z } from "zod";
|
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
|
|
|
import { PROJECT_STATUSES } from "../constants.js";
|
2026-02-16 13:31:47 -06:00
|
|
|
|
|
|
|
|
export const createProjectSchema = z.object({
|
2026-02-20 13:43:25 -06:00
|
|
|
/** @deprecated Use goalIds instead */
|
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
|
|
|
goalId: z.string().uuid().optional().nullable(),
|
2026-02-20 13:43:25 -06:00
|
|
|
goalIds: z.array(z.string().uuid()).optional(),
|
2026-02-16 13:31:47 -06:00
|
|
|
name: z.string().min(1),
|
|
|
|
|
description: z.string().optional().nullable(),
|
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
|
|
|
status: z.enum(PROJECT_STATUSES).optional().default("backlog"),
|
|
|
|
|
leadAgentId: z.string().uuid().optional().nullable(),
|
|
|
|
|
targetDate: z.string().optional().nullable(),
|
2026-02-23 09:14:08 -06:00
|
|
|
color: z.string().optional().nullable(),
|
|
|
|
|
archivedAt: z.string().datetime().optional().nullable(),
|
2026-02-16 13:31:47 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export type CreateProject = z.infer<typeof createProjectSchema>;
|
|
|
|
|
|
|
|
|
|
export const updateProjectSchema = createProjectSchema.partial();
|
|
|
|
|
|
|
|
|
|
export type UpdateProject = z.infer<typeof updateProjectSchema>;
|