import { asWritingTask } from '../base-application/support/task-type-inference.js';
import { SERVER_MAIN_SRC_DIR, SERVER_TEST_SRC_DIR } from '../generator-constants.js';
import { moveToJavaPackageSrcDir, moveToJavaPackageTestDir } from '../server/support/index.js';
export const mongoDbFiles = {
    serverResource: [
        {
            path: `${SERVER_MAIN_SRC_DIR}_package_/`,
            renameTo: moveToJavaPackageSrcDir,
            templates: ['config/DatabaseConfiguration.java'],
        },
        {
            condition: generator => generator.generateBuiltInUserEntity,
            path: `${SERVER_MAIN_SRC_DIR}_package_/`,
            renameTo: moveToJavaPackageSrcDir,
            templates: ['config/dbmigrations/InitialSetupMigration.java'],
        },
        {
            path: `${SERVER_TEST_SRC_DIR}_package_/`,
            renameTo: moveToJavaPackageTestDir,
            templates: ['config/MongoDbTestContainer.java', 'config/EmbeddedMongo.java'],
        },
    ],
};
export default asWritingTask(async function writeMongodbFilesTask({ application }) {
    await this.writeFiles({
        sections: mongoDbFiles,
        context: application,
    });
});
