"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateApiFiles = void 0;
// node
const path = require("node:path");
// imports
const config_1 = require("../../config");
const types_1 = require("../../types");
const utils_1 = require("../../utils");
const generateApiFiles = async (generateCommandState) => {
    await utils_1.TemplateGenerator.createDirectory(path.join('src', config_1.cliterConfig.apiContainer), generateCommandState.schema.boundedContextName.toLowerCase().toKebabCase());
    await utils_1.TemplateGenerator.generateStaticContents(generateCommandState.command, types_1.TemplateElement.BACK_API, path.join('src', config_1.cliterConfig.apiContainer), 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,
            sqlType: types_1.SqlType,
            relationship: types_1.SqlRelationship,
        },
    });
};
exports.generateApiFiles = generateApiFiles;
