feat: projects with context - schema, API, frontend page, task assignment (HQ-17, HQ-21)
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user