"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateAppFiles = void 0;
const config_1 = require("../../config");
const types_1 = require("../../types");
const utils_1 = require("../../utils");
const path = require("node:path");
const generateAppFiles = async (generateCommandState) => {
    // create directory application container, normally src/@app
    await utils_1.TemplateGenerator.createDirectory(path.join('src', config_1.cliterConfig.appContainer), generateCommandState.schema.boundedContextName.toLowerCase().toKebabCase());
    // create module files
    await utils_1.TemplateGenerator.generateStaticContents(generateCommandState.command, types_1.TemplateElement.BACK_APP, path.join('src', config_1.cliterConfig.appContainer), generateCommandState.schema.boundedContextName.toLowerCase().toKebabCase(), {
        boundedContextName: generateCommandState.schema.boundedContextName,
        moduleName: generateCommandState.schema.moduleName,
        moduleNames: generateCommandState.schema.moduleNames,
        force: generateCommandState.flags.force,
        verbose: generateCommandState.flags.verbose,
        excludeFiles: generateCommandState.schema.excluded,
        lockFiles: generateCommandState.lockFiles,
        templateData: {
            ...generateCommandState,
            relationship: types_1.SqlRelationship,
        },
    });
    // create value objects in module folder
    await utils_1.TemplateGenerator.generateValueObjects(generateCommandState, path.join('src', config_1.cliterConfig.appContainer), generateCommandState.schema.boundedContextName.toLowerCase().toKebabCase(), generateCommandState.schema.properties.valueObjects, generateCommandState.schema.moduleName);
};
exports.generateAppFiles = generateAppFiles;
