// dispatchers/database-security-dispatcher.ts — Database, Security, API Contract dispatches
import { buildContractTestFile, buildMockServerFile, } from '../adapters/contract-testing-adapter.js';
import { isDatabaseTestProject, generateDatabaseTestDefs, generateDatabaseTestFiles, } from '../generators/database/index.js';
import { isSecurityTestProject, generateSecurityTestDefs, generateSecurityTestFiles, } from '../generators/security/index.js';
export function dispatchDatabaseSecurity(spec, knowledge, testDir, testFramework, slug, autoGenerate, testExt, _unitTests, integrationTests, testFiles) {
    // SPEC-058b: Database & Data Layer
    if (isDatabaseTestProject(knowledge)) {
        const dbDefs = generateDatabaseTestDefs(spec.title, testDir, testExt, knowledge);
        integrationTests.push(...dbDefs);
        testFiles.push(...generateDatabaseTestFiles({ title: spec.title, slug }, testDir, testFramework, knowledge.language, testExt, autoGenerate, knowledge));
    }
    // SPEC-058b: Security Testing
    if (isSecurityTestProject(knowledge)) {
        const secDefs = generateSecurityTestDefs(spec.title, testDir, testExt, knowledge);
        integrationTests.push(...secDefs);
        testFiles.push(...generateSecurityTestFiles({ title: spec.title, slug }, testDir, testFramework, knowledge.language, testExt, autoGenerate, knowledge));
    }
    const isApiSpec = spec.target === 'backend' || spec.target === 'fullstack';
    if (isApiSpec) {
        testFiles.push(buildContractTestFile(spec.title, slug, knowledge, autoGenerate));
        testFiles.push(buildMockServerFile(spec.title, slug, knowledge, autoGenerate));
    }
    return { isApiSpec };
}
//# sourceMappingURL=database-security-dispatcher.js.map