import { Body, Controller, Param, Post, Put } from '@nestjs/common';
import { CreateScrapConfigDto } from '../dto/scrap-config/create-scrap-config';
import { UpdateScrapConfigDto } from '../dto/scrap-config/update-scrap-config';
import { ScrapConfig } from '../entities/scrap-config.entity';
import { ScrapConfigsService } from '../services/scrap-config.service';

@Controller('admin/scrap-configs')
export class ScrapConfigsController {
  constructor(private readonly scrapConfigsService: ScrapConfigsService) {}

  @Post()
  async create(@Body() data: CreateScrapConfigDto) {
    return await this.scrapConfigsService.create(data);
  }

  @Put(':id')
  async update(
    @Param('id') id: ScrapConfig['id'],
    @Body() data: UpdateScrapConfigDto,
  ) {
    return await this.scrapConfigsService.update(id, data);
  }
}
