import { Controller, Get, Post, Body, Param, UseGuards, Request } from '@nestjs/common'; import { ApiTags, ApiBearerAuth } from '@nestjs/swagger'; import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; import { PaymentsService } from './payments.service'; @ApiTags('payments') @Controller('payments') @ApiBearerAuth() @UseGuards(JwtAuthGuard) export class PaymentsController { constructor(private paymentsService: PaymentsService) {} @Get() findAll() { return this.paymentsService.findAll(); } @Get(':id') findOne(@Param('id') id: string) { return this.paymentsService.findOne(id); } @Post() create(@Body() dto: any, @Request() req: any) { return this.paymentsService.create(dto, req.user.sub); } }