refactor: Restructure monorepo to apps/server/ and apps/web/ layout
Move src/ → apps/server/ and packages/web/ → apps/web/ to adopt standard monorepo conventions (apps/ for runnable apps, packages/ for reusable libraries). Update all config files, shared package imports, test fixtures, and documentation to reflect new paths. Key fixes: - Update workspace config to ["apps/*", "packages/*"] - Update tsconfig.json rootDir/include for apps/server/ - Add apps/web/** to vitest exclude list - Update drizzle.config.ts schema path - Fix ensure-schema.ts migration path detection (3 levels up in dev, 2 levels up in dist) - Fix tests/integration/cli-server.test.ts import paths - Update packages/shared imports to apps/server/ paths - Update all docs/ files with new paths
This commit is contained in:
36
apps/server/db/repositories/change-set-repository.ts
Normal file
36
apps/server/db/repositories/change-set-repository.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Change Set Repository Port Interface
|
||||
*
|
||||
* Port for ChangeSet aggregate operations.
|
||||
* Implementations (Drizzle, etc.) are adapters.
|
||||
*/
|
||||
|
||||
import type { ChangeSet, ChangeSetEntry } from '../schema.js';
|
||||
|
||||
export type CreateChangeSetData = {
|
||||
agentId: string | null;
|
||||
agentName: string;
|
||||
initiativeId: string;
|
||||
mode: 'plan' | 'detail' | 'refine';
|
||||
summary?: string | null;
|
||||
};
|
||||
|
||||
export type CreateChangeSetEntryData = {
|
||||
entityType: 'page' | 'phase' | 'task' | 'phase_dependency';
|
||||
entityId: string;
|
||||
action: 'create' | 'update' | 'delete';
|
||||
previousState?: string | null;
|
||||
newState?: string | null;
|
||||
sortOrder?: number;
|
||||
};
|
||||
|
||||
export type ChangeSetWithEntries = ChangeSet & { entries: ChangeSetEntry[] };
|
||||
|
||||
export interface ChangeSetRepository {
|
||||
createWithEntries(data: CreateChangeSetData, entries: CreateChangeSetEntryData[]): Promise<ChangeSet>;
|
||||
findById(id: string): Promise<ChangeSet | null>;
|
||||
findByIdWithEntries(id: string): Promise<ChangeSetWithEntries | null>;
|
||||
findByInitiativeId(initiativeId: string): Promise<ChangeSet[]>;
|
||||
findByAgentId(agentId: string): Promise<ChangeSet[]>;
|
||||
markReverted(id: string): Promise<ChangeSet>;
|
||||
}
|
||||
Reference in New Issue
Block a user