import { Controller, Get, Post, Body, Param } from '@nestjs/common';
import { WorkflowService } from './workflow.service';

@Controller('workflow')
export class WorkflowController {
  constructor(private svc: WorkflowService) {}

  @Get() findAll() { return this.svc.findAll(); }
  @Get('pendentes') pendentes() { return this.svc.findPendentes(); }
  @Get(':id') findOne(@Param('id') id: string) { return this.svc.findOne(id); }
  @Post() create(@Body() body: any) { return this.svc.create(body); }
  @Post(':id/aprovar') aprovar(@Param('id') id: string, @Body() body: any) { return this.svc.aprovar(id, body?.observacao); }
  @Post(':id/reprovar') reprovar(@Param('id') id: string, @Body() body: any) { return this.svc.reprovar(id, body?.observacao); }
}
