mcp-quiz-server
Version:
🧠AI-Powered Quiz Management via Model Context Protocol (MCP) - Create, manage, and take quizzes directly from VS Code, Claude, and other AI agents.
49 lines (48 loc) • 2.01 kB
JavaScript
;
/**
* @fileoverview Question Repository Interface - Domain Layer
* @version 1.0.0
* @since 2025-07-29
* @lastUpdated 2025-07-29
* @module IQuestionRepository Interface
* @description Repository interface for Question entities following
* Repository pattern and Dependency Inversion Principle.
* Defines the contract for question data access without implementation details.
* @contributors Claude Code Agent
* @dependencies Question domain entity, QuestionId, QuizId value objects
* @requirements REQ-ARCH-001 (Clean Architecture Domain Layer)
* @testCoverage Unit tests for interface contracts via mock implementations
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TooManyQuestionsError = exports.QuestionOrderConflictError = exports.InvalidQuestionOrderError = exports.QuestionNotFoundError = void 0;
/**
* Repository Error Types (specific to questions)
*/
class QuestionNotFoundError extends Error {
constructor(questionId) {
super(`Question with ID ${questionId} not found`);
this.name = 'QuestionNotFoundError';
}
}
exports.QuestionNotFoundError = QuestionNotFoundError;
class InvalidQuestionOrderError extends Error {
constructor(order, quizId) {
super(`Invalid question order ${order} for quiz ${quizId}`);
this.name = 'InvalidQuestionOrderError';
}
}
exports.InvalidQuestionOrderError = InvalidQuestionOrderError;
class QuestionOrderConflictError extends Error {
constructor(order, quizId) {
super(`Question order ${order} already exists in quiz ${quizId}`);
this.name = 'QuestionOrderConflictError';
}
}
exports.QuestionOrderConflictError = QuestionOrderConflictError;
class TooManyQuestionsError extends Error {
constructor(quizId, maxAllowed) {
super(`Quiz ${quizId} already has maximum allowed questions (${maxAllowed})`);
this.name = 'TooManyQuestionsError';
}
}
exports.TooManyQuestionsError = TooManyQuestionsError;