import { ReviewContextFactory } from '../factories/reviewContext.factory.js';
export class StubReviewContextGateway {
    contexts = new Map();
    setContext(mergeRequestId, context) {
        this.contexts.set(mergeRequestId, context);
    }
    updateContextProgress(mergeRequestId, progress) {
        const context = this.contexts.get(mergeRequestId);
        if (context) {
            context.progress = { ...progress, updatedAt: new Date().toISOString() };
        }
    }
    create(input) {
        const context = ReviewContextFactory.create({
            mergeRequestId: input.mergeRequestId,
            platform: input.platform,
            projectPath: input.projectPath,
            mergeRequestNumber: input.mergeRequestNumber,
            threads: input.threads ?? [],
        });
        this.contexts.set(input.mergeRequestId, context);
        return {
            success: true,
            filePath: this.getFilePath(input.localPath, input.mergeRequestId),
        };
    }
    delete(_localPath, mergeRequestId) {
        const existed = this.contexts.has(mergeRequestId);
        this.contexts.delete(mergeRequestId);
        return { success: true, deleted: existed };
    }
    read(_localPath, mergeRequestId) {
        return this.contexts.get(mergeRequestId) ?? null;
    }
    exists(_localPath, mergeRequestId) {
        return this.contexts.has(mergeRequestId);
    }
    getFilePath(localPath, mergeRequestId) {
        return `${localPath}/.claude/reviews/logs/${mergeRequestId}.json`;
    }
    appendAction(_localPath, mergeRequestId, action) {
        const context = this.contexts.get(mergeRequestId);
        if (!context) {
            return { success: false };
        }
        context.actions.push(action);
        return { success: true };
    }
    updateProgress(_localPath, mergeRequestId, progress) {
        const context = this.contexts.get(mergeRequestId);
        if (!context) {
            return { success: false };
        }
        context.progress = { ...progress, updatedAt: new Date().toISOString() };
        return { success: true };
    }
    setResult(_localPath, mergeRequestId, result) {
        const context = this.contexts.get(mergeRequestId);
        if (!context) {
            return { success: false };
        }
        context.result = result;
        return { success: true };
    }
    listAll(_localPath) {
        return Array.from(this.contexts.values());
    }
    clear() {
        this.contexts.clear();
    }
}
//# sourceMappingURL=reviewContextGateway.stub.js.map