refactor(api-server): extract IMPORTANT_DOC_TYPES constant

Move the duplicated important-document-type list out of routes-tasks.ts
and routes-files.ts into src/shared/document-categories.ts so the array
and lookup set live in one place.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-16 22:27:56 -04:00
1 parent 12027562e3
commit 18bcd0abfc
3 files changed
+26 -3

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
/**
* Document type categories shared between db, route handlers, and clients.
*
* IMPORTANT_DOC_TYPES are the document types that trigger deliverable-review
* approvals (PRDs, specs, design docs, contracts, etc.). The ordering matters
* for some lookup queries; keep this in sync with database/documents.ts.
*/
export const IMPORTANT_DOC_TYPES = [
"prd",
"technical_spec",
"design_doc",
"project_brief",
"proposal",
"budget_proposal",
"architecture_decision",
"contract",
"sop",
] as const;
export type ImportantDocType = (typeof IMPORTANT_DOC_TYPES)[number];
export const IMPORTANT_DOC_TYPE_SET: ReadonlySet<string> = new Set(IMPORTANT_DOC_TYPES);