import BaseApplicationGenerator from '../base-application/index.js';
export default class KafkaGenerator extends BaseApplicationGenerator {
    async beforeQueue() {
        if (!this.fromBlueprint) {
            await this.composeWithBlueprints();
        }
        if (!this.delegateToBlueprint) {
            await this.dependsOnBootstrapApplicationServer();
        }
    }
    get composing() {
        return this.asComposingTaskGroup({
            async compose() {
                const { messageBroker } = this.jhipsterConfig;
                await this.composeWithJHipster(`begcode:spring-cloud-stream:${messageBroker}`);
            },
        });
    }
    get [BaseApplicationGenerator.COMPOSING]() {
        return this.delegateTasksToBlueprint(() => this.composing);
    }
    get preparing() {
        return this.asPreparingTaskGroup({
            preparing({ application }) {
                application.packageInfoJavadocs?.push({
                    packageName: `${application.packageName}.broker`,
                    documentation: 'Spring cloud consumers and providers',
                });
            },
        });
    }
    get [BaseApplicationGenerator.PREPARING]() {
        return this.delegateTasksToBlueprint(() => this.preparing);
    }
}
