import { Body, Controller, Post } from '@nestjs/common';
import { SalesPriceFormulaDataOrchestrator } from '../domain/usecases/sales-price-formula-data.orchestrator';
import { SalesPriceFormulaDto } from './dto/sales-price-formula.dto';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { SalesPriceFormulaEntity } from '../domain/entities/sales-price-formula.entity';
import { Public } from 'src/core/guards';

@ApiTags(`sales price formulas - data`)
@Controller('v1/sales-price-formula')
@Public(false)
@ApiBearerAuth('JWT')
export class SalesPriceFormulaDataController {
  constructor(private orchestrator: SalesPriceFormulaDataOrchestrator) {}

  @Post()
  async create(
    @Body() data: SalesPriceFormulaDto,
  ): Promise<SalesPriceFormulaEntity> {
    return await this.orchestrator.update(data);
  }
}
