// src/modules/manager/manager.module.ts
import {Module} from '@nestjs/common';
import {BullModule} from '@nestjs/bullmq';
import {ManagerService} from './manager.service';
import {ManagerProcessor} from './manager.processor';
import {AIService} from "../../shared/ai.service";
import {BullBoardModule} from "@bull-board/nestjs";
import {BullMQAdapter} from "@bull-board/api/bullMQAdapter";
import {GrokProvider} from "../content-writer/providers/grok.provider";
import {ContentWriterModule} from "../content-writer/content-writer.module";

@Module({
    imports: [
        ContentWriterModule,
        BullModule.registerQueue(
            {name: 'content_writer_queue'}, // Hàng đợi cho AI-B
            // Hàng đợi cho AI-B
            {name: 'download_video_queue'},
            {name: 'content_writer_completed_queue'},// Hàng đợi cho AI-C
            {name: 'manager_task_queue'},// Hàng đợi cho AI-C
            {name: 'comment_writer_queue'},// Hàng đợi cho AI-C
            {name: 'comment_writer_completed_queue'},// Hàng đợi cho AI-C
        ),
        BullBoardModule.forFeature(
            {
                name: 'manager_task_queue',
                adapter: BullMQAdapter
            },
            {
                name: 'content_writer_queue',
                adapter: BullMQAdapter
            },
            {
                name: 'comment_writer_queue',
                adapter: BullMQAdapter
            },
            {
                name: 'download_video_queue',
                adapter: BullMQAdapter
            },
            {
                name: 'content_writer_completed_queue',
                adapter: BullMQAdapter
            },
            {
                name: 'comment_writer_completed_queue',
                adapter: BullMQAdapter
            },
        ),
    ],
    providers: [
        ManagerService,
        ManagerProcessor,
        AIService,
        GrokProvider,
        // ContentWriterService,
        // StyleDetectorService
    ],
    exports: [ManagerService],
})
export class ManagerModule {
}
