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