import { moveToJavaPackageSrcDir, moveToJavaPackageTestDir } from '../server/support/index.js';
import { SERVER_MAIN_RES_DIR, SERVER_MAIN_SRC_DIR, SERVER_TEST_SRC_DIR } from '../generator-constants.js';
export const neo4jFiles = {
    serverResource: [
        {
            path: `${SERVER_MAIN_SRC_DIR}_package_/`,
            renameTo: moveToJavaPackageSrcDir,
            templates: ['config/DatabaseConfiguration.java_neo4j'],
        },
        {
            condition: generator => generator.generateBuiltInUserEntity && !generator.databaseMigrationLiquibase,
            path: `${SERVER_MAIN_SRC_DIR}_package_/`,
            renameTo: moveToJavaPackageSrcDir,
            templates: ['config/neo4j/Neo4jMigrations.java'],
        },
        {
            condition: generator => generator.generateBuiltInUserEntity && !generator.databaseMigrationLiquibase,
            path: SERVER_MAIN_RES_DIR,
            templates: ['config/neo4j/migrations/user__admin.json', 'config/neo4j/migrations/user__user.json'],
        },
    ],
    serverTestFw: [
        {
            path: `${SERVER_TEST_SRC_DIR}_package_/`,
            renameTo: moveToJavaPackageTestDir,
            templates: [
                'config/Neo4jTestContainer.java',
                'config/Neo4jTestContainersSpringContextCustomizerFactory.java',
                'config/EmbeddedNeo4j.java',
            ],
        },
    ],
};
export default async function writeFilesTask({ application }) {
    await this.writeFiles({
        sections: neo4jFiles,
        context: application,
    });
}
