feat: projects with context - schema, API, frontend page, task assignment (HQ-17, HQ-21)

This commit is contained in:
2026-01-29 05:05:20 +00:00
parent 8685548206
commit b0559cdbc8
10 changed files with 963 additions and 6 deletions

View File

@@ -38,6 +38,29 @@ export interface ProgressNote {
note: string;
}
// ─── Projects ───
export interface ProjectLink {
label: string;
url: string;
}
export const projects = pgTable("projects", {
id: uuid("id").defaultRandom().primaryKey(),
name: text("name").notNull(),
description: text("description"),
context: text("context"), // Architecture notes, how-to, credentials references
repos: jsonb("repos").$type<string[]>().default([]), // Git repo URLs
links: jsonb("links").$type<ProjectLink[]>().default([]), // Related URLs (docs, domains, dashboards)
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),
});
export type Project = typeof projects.$inferSelect;
export type NewProject = typeof projects.$inferInsert;
// ─── Tasks ───
export const tasks = pgTable("tasks", {
id: uuid("id").defaultRandom().primaryKey(),
taskNumber: integer("task_number"),
@@ -49,6 +72,7 @@ export const tasks = pgTable("tasks", {
position: integer("position").notNull().default(0),
assigneeId: text("assignee_id"),
assigneeName: text("assignee_name"),
projectId: uuid("project_id").references(() => projects.id, { onDelete: "set null" }),
progressNotes: jsonb("progress_notes").$type<ProgressNote[]>().default([]),
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),