adpa-enterprise-framework-automation
Version:
Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe
58 lines • 1.81 kB
JavaScript
/**
* IValidator Interface
*
* Defines the contract for all individual validation processors in the
* ADPA Quality Assurance Engine validation factory system.
*
* This interface enables a modular, extensible validation architecture
* where each validator focuses on a specific aspect of PMBOK compliance.
*
* @version 1.0.0
* @author ADPA Quality Assurance Engine Team
* @created June 2025
*/
/**
* Abstract base class for validators with common functionality
*/
export class BaseValidator {
defaultEnabled = true;
/**
* Default implementation of applicability check
*/
isApplicable(documentTypes) {
// If no specific documents are defined, applies to all
if (this.applicableDocuments.length === 0) {
return true;
}
// Check if any of the document types match our applicable documents
return documentTypes.some(docType => this.applicableDocuments.includes(docType));
}
/**
* Helper method to create a standardized validation result
*/
createResult(passed, score, maxScore = 100, issues = [], strengths = [], severity = 'warning', recommendations = [], executionTimeMs = 0, metadata) {
return {
validatorId: this.id,
validatorName: this.name,
passed,
score,
maxScore,
issues,
strengths,
severity,
recommendations,
executionTimeMs,
metadata
};
}
/**
* Helper method to measure execution time
*/
async measureExecutionTime(operation) {
const start = Date.now();
const result = await operation();
const timeMs = Date.now() - start;
return { result, timeMs };
}
}
//# sourceMappingURL=IValidator.js.map