import { Body, Controller, Post } from '@nestjs/common';
import { VipCodeDataOrchestrator } from '../domain/usecases/vip-code-data.orchestrator';
import { VipCodeDto } from './dto/vip-code.dto';
import { MODULE_NAME } from 'src/core/strings/constants/module.constants';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { VipCodeEntity } from '../domain/entities/vip-code.entity';
import { Public } from 'src/core/guards';

@ApiTags(`${MODULE_NAME.VIP_CODE.split('-').join(' ')} - data`)
@Controller(`v1/${MODULE_NAME.VIP_CODE}`)
@Public(false)
@ApiBearerAuth('JWT')
export class VipCodeDataController {
  constructor(private orchestrator: VipCodeDataOrchestrator) {}

  @Post()
  async create(@Body() data: VipCodeDto): Promise<VipCodeEntity> {
    return await this.orchestrator.create(data);
  }

  @Post('generate-code')
  async generateCOde(): Promise<string> {
    return await this.orchestrator.generateCode();
  }

  // @Put('/batch-delete')
  // async batchDeleted(@Body() body: BatchIdsDto): Promise<BatchResult> {
  //   return await this.orchestrator.batchDelete(body.ids);
  // }

  // @Delete(':id')
  // async delete(@Param('id') dataId: string): Promise<string> {
  //   return await this.orchestrator.delete(dataId);
  // }
}
