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 { GOAL_LEVELS, GOAL_STATUSES } from "../constants.js";
|
2026-02-16 13:31:47 -06:00
|
|
|
|
|
|
|
|
export const createGoalSchema = z.object({
|
|
|
|
|
title: 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
|
|
|
level: z.enum(GOAL_LEVELS).optional().default("task"),
|
|
|
|
|
status: z.enum(GOAL_STATUSES).optional().default("planned"),
|
2026-02-16 13:31:47 -06:00
|
|
|
parentId: z.string().uuid().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
|
|
|
ownerAgentId: z.string().uuid().optional().nullable(),
|
2026-02-16 13:31:47 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export type CreateGoal = z.infer<typeof createGoalSchema>;
|
|
|
|
|
|
|
|
|
|
export const updateGoalSchema = createGoalSchema.partial();
|
|
|
|
|
|
|
|
|
|
export type UpdateGoal = z.infer<typeof updateGoalSchema>;
|