import { javaMainPackageTemplatesBlock, javaTestPackageTemplatesBlock } from '../../support/index.js';
import { checkRegenerateAbsoluteFile } from '../../../base/support/index.js';
export const entityServerFiles = {
    model: [
        javaMainPackageTemplatesBlock({
            condition: ctx => ctx.entityDomainLayer && !ctx.skipComponent?.includes('domain'),
            override(context) {
                return checkRegenerateAbsoluteFile(this, context.begcodeData && context.begcodeData.destinationFile);
            },
            templates: ['_entityPackage_/domain/_persistClass_.java.jhi', '_entityPackage_/domain/_persistClass_.java.jhi.extends_impl'],
        }),
    ],
    modelTestFiles: [
        javaTestPackageTemplatesBlock({
            condition: ctx => ctx.entityDomainLayer,
            templates: [
                '_entityPackage_/domain/_persistClass_Asserts.java',
                '_entityPackage_/domain/_persistClass_Test.java',
                '_entityPackage_/domain/_persistClass_TestSamples.java',
            ],
        }),
    ],
    server: [
        javaMainPackageTemplatesBlock({
            condition: ctx => ctx.useJakartaValidation && ctx.entityDomainLayer,
            templates: ['_entityPackage_/domain/_persistClass_.java.jhi.jakarta_validation'],
        }),
        javaMainPackageTemplatesBlock({
            condition: ctx => ctx.useJacksonIdentityInfo && ctx.entityDomainLayer,
            templates: ['_entityPackage_/domain/_persistClass_.java.jhi.jackson_identity_info'],
        }),
    ],
};
export const enumFiles = {
    enumFiles: [
        javaMainPackageTemplatesBlock({
            renameTo: (data, filepath) => filepath.replace('_enumName_', data.enumName).replace('_entityPackage_/', ''),
            templates: ['_entityPackage_/domain/enumeration/_enumName_.java'],
        }),
    ],
};
