| ... | @@ -11,12 +11,7 @@ import { | ... | @@ -11,12 +11,7 @@ import { |
| 11 | } from "@t3tools/contracts"; | 11 | } from "@t3tools/contracts"; |
| 12 | import * as Effect from "effect/Effect"; | 12 | import * as Effect from "effect/Effect"; |
| 13 | | 13 | |
| 14 | import { | 14 | import { listThreadsByProjectId, requireThread, requireThreadAbsent } from "./commandInvariants.ts"; |
| 15 | findThreadById, | | |
| 16 | listThreadsByProjectId, | | |
| 17 | requireThread, | | |
| 18 | requireThreadAbsent, | | |
| 19 | } from "./commandInvariants.ts"; | | |
| 20 | | 15 | |
| 21 | const now = "2026-01-01T00:00:00.000Z"; | 16 | const now = "2026-01-01T00:00:00.000Z"; |
| 22 | | 17 | |
| ... | @@ -121,9 +116,7 @@ const messageSendCommand: OrchestrationCommand = { | ... | @@ -121,9 +116,7 @@ const messageSendCommand: OrchestrationCommand = { |
| 121 | }; | 116 | }; |
| 122 | | 117 | |
| 123 | describe("commandInvariants", () => { | 118 | describe("commandInvariants", () => { |
| 124 | it("finds threads by id and project", () => { | 119 | it("lists threads by project", () => { |
| 125 | expect(findThreadById(readModel, ThreadId.make("thread-1"))?.projectId).toBe("project-a"); | | |
| 126 | expect(findThreadById(readModel, ThreadId.make("missing"))).toBeUndefined(); | | |
| 127 | expect( | 120 | expect( |
| 128 | listThreadsByProjectId(readModel, ProjectId.make("project-b")).map((thread) => thread.id), | 121 | listThreadsByProjectId(readModel, ProjectId.make("project-b")).map((thread) => thread.id), |
| 129 | ).toEqual([ThreadId.make("thread-2")]); | 122 | ).toEqual([ThreadId.make("thread-2")]); |