- Replace misleading 'sent' status with 'pending' (no email capability) - Show assessment group name instead of raw 'regular_assessment' type - Add owner last name to invoice table - Fix payment creation Internal Server Error (PostgreSQL $2 type cast) - Add edit/delete capability for payment records with invoice recalc Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
990 B
TypeScript
30 lines
990 B
TypeScript
import { Controller, Get, Post, Put, Delete, 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); }
|
|
|
|
@Put(':id')
|
|
update(@Param('id') id: string, @Body() dto: any, @Request() req: any) {
|
|
return this.paymentsService.update(id, dto, req.user.sub);
|
|
}
|
|
|
|
@Delete(':id')
|
|
delete(@Param('id') id: string) { return this.paymentsService.delete(id); }
|
|
}
|