feat: Add errands schema, repository, and wire into tRPC context/container
Creates the errands table (with conflictFiles column), errand-repository port interface, DrizzleErrandRepository adapter, and wires the repository into TRPCContext, the DI container, _helpers.ts requireErrandRepository guard, and the test harness. Also fixes pre-existing TS error in controller.test.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ import type { MessageRepository } from '../db/repositories/message-repository.js
|
||||
import type { AgentRepository } from '../db/repositories/agent-repository.js';
|
||||
import type { InitiativeRepository } from '../db/repositories/initiative-repository.js';
|
||||
import type { PhaseRepository } from '../db/repositories/phase-repository.js';
|
||||
import type { ErrandRepository } from '../db/repositories/errand-repository.js';
|
||||
import type { Initiative, Phase, Task } from '../db/schema.js';
|
||||
import { createTestDatabase } from '../db/repositories/drizzle/test-helpers.js';
|
||||
import { createRepositories } from '../container.js';
|
||||
@@ -204,6 +205,8 @@ export interface TestHarness {
|
||||
initiativeRepository: InitiativeRepository;
|
||||
/** Phase repository */
|
||||
phaseRepository: PhaseRepository;
|
||||
/** Errand repository */
|
||||
errandRepository: ErrandRepository;
|
||||
|
||||
// tRPC Caller
|
||||
/** tRPC caller for direct procedure calls */
|
||||
@@ -409,7 +412,7 @@ export function createTestHarness(): TestHarness {
|
||||
|
||||
// Create repositories
|
||||
const repos = createRepositories(db);
|
||||
const { taskRepository, messageRepository, agentRepository, initiativeRepository, phaseRepository } = repos;
|
||||
const { taskRepository, messageRepository, agentRepository, initiativeRepository, phaseRepository, errandRepository } = repos;
|
||||
|
||||
// Create real managers wired to mocks
|
||||
const dispatchManager = new DefaultDispatchManager(
|
||||
@@ -447,6 +450,7 @@ export function createTestHarness(): TestHarness {
|
||||
coordinationManager,
|
||||
initiativeRepository,
|
||||
phaseRepository,
|
||||
errandRepository,
|
||||
});
|
||||
|
||||
// Create tRPC caller
|
||||
@@ -470,6 +474,7 @@ export function createTestHarness(): TestHarness {
|
||||
agentRepository,
|
||||
initiativeRepository,
|
||||
phaseRepository,
|
||||
errandRepository,
|
||||
|
||||
// tRPC Caller
|
||||
caller,
|
||||
|
||||
Reference in New Issue
Block a user