diff --git a/packages/api/src/__tests__/comment-entity-registry.test.ts b/packages/api/src/__tests__/comment-entity-registry.test.ts new file mode 100644 index 0000000..2d390e9 --- /dev/null +++ b/packages/api/src/__tests__/comment-entity-registry.test.ts @@ -0,0 +1,17 @@ +import { describe, expect, it } from "vitest"; +import { + CommentEntityTypeSchema, + getCommentToolEntityDescription, + getCommentToolScopeSentence, + getSupportedCommentEntityTypes, +} from "../lib/comment-entity-registry.js"; + +describe("comment entity registry metadata", () => { + it("keeps the router schema and helper metadata aligned", () => { + expect(getSupportedCommentEntityTypes()).toEqual(["estimate", "resource"]); + expect(CommentEntityTypeSchema.options).toEqual(["estimate", "resource"]); + expect(getCommentToolEntityDescription()).toContain("estimate, resource"); + expect(getCommentToolScopeSentence()).toContain("Supported comment entities: estimate, resource."); + expect(getCommentToolScopeSentence()).toContain("resource comments follow resource detail visibility"); + }); +}); diff --git a/packages/shared/src/constants/comment-entities.ts b/packages/shared/src/constants/comment-entities.ts new file mode 100644 index 0000000..76ffe5e --- /dev/null +++ b/packages/shared/src/constants/comment-entities.ts @@ -0,0 +1,8 @@ +export const COMMENT_ENTITY_TYPE_VALUES = ["estimate", "resource"] as const; + +export type CommentEntityType = (typeof COMMENT_ENTITY_TYPE_VALUES)[number]; + +export const COMMENT_ENTITY_LABELS: Record = { + estimate: "estimate", + resource: "resource", +};