import { Controller, Logger, Post } from '@nestjs/common';

import { MODULE_NAME } from 'src/core/strings/constants/module.constants';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';

import { QueueAdminOrchestrator } from '../../domain/queue-admin.orchestrator';
import { Public } from 'src/core/guards';
// import { Cron } from '@nestjs/schedule';

@ApiTags(`Queue Admin`)
@Controller(`v1/${MODULE_NAME.QUEUE}-job`)
@ApiBearerAuth('JWT')
@Public(true)
export class QueueJobController {
  constructor(private orchestrator: QueueAdminOrchestrator) {}

  // @Cron('*/1 * * * *')
  @Post('queues/notification')
  async call() {
    Logger.log('call preparation');
    return this.orchestrator.job();
  }
}
