import { Controller, Get, Param, Query } from '@nestjs/common';
import { FilterItemRateDto } from './dto/filter-item-rate.dto';
import { Pagination } from 'src/core/response';
import { PaginationResponse } from 'src/core/response/domain/ok-response.interface';
import { ItemRateEntity } from '../domain/entities/item-rate.entity';
import { ItemRateReadOrchestrator } from '../domain/usecases/item-rate-read.orchestrator';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { MODULE_NAME } from 'src/core/strings/constants/module.constants';
import { Public } from 'src/core/guards';
import { ItemEntity } from '../../item/domain/entities/item.entity';

@ApiTags(`${MODULE_NAME.ITEM_RATE.split('-').join(' ')} - read`)
@Controller(`v1/${MODULE_NAME.ITEM_RATE}`)
@Public(false)
@ApiBearerAuth('JWT')
export class ItemRateReadController {
  constructor(private orchestrator: ItemRateReadOrchestrator) {}

  @Get()
  @Pagination()
  async index(
    @Query() params: FilterItemRateDto,
  ): Promise<PaginationResponse<ItemEntity>> {
    return await this.orchestrator.indexItem(params);
  }

  // @Get(':id')
  // async detail(@Param('id') id: string): Promise<ItemRateEntity> {
  //   return await this.orchestrator.detail(id);
  // }
}
