import { Body, Controller, Get, Post } from '@nestjs/common';
import { ScrapConfigsService } from '../../services/scrap-config.service';
import { ScrapItemsService } from '../../services/scrap-item-config.service';
import { UpsertScrapItemDto } from '../../dto/scrap-items/upsert-scrap-item.dto';
import { ScrapItem } from '../../entities/scrap-item.entity';

@Controller('scrap-items')
export class ClientScrapItemsController {
  constructor(private readonly scrapItemsService: ScrapItemsService) {}

  @Post('upsert')
  async upsertScrapItems(@Body() data: UpsertScrapItemDto[]) {
    return await this.scrapItemsService.upsertScrapItemsRes(
      data as ScrapItem[],
    );
  }
}
