@@ -1,4 +1,4 @@
|
||||
import { Controller, Get, Post, Param, UseGuards, Req } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Param, UseGuards } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth, ApiResponse } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
|
||||
import { RolesGuard } from '../common/guards/roles.guard';
|
||||
@@ -21,11 +21,14 @@ export class RemindersController {
|
||||
}
|
||||
|
||||
@Post('send')
|
||||
@ApiOperation({ summary: 'Send payment reminders via Resend' })
|
||||
@UseGuards(RolesGuard)
|
||||
@Roles('admin')
|
||||
@ApiOperation({ summary: 'Send payment reminders via Resend (admin only)' })
|
||||
@ApiResponse({ status: 201, description: 'Reminders sent' })
|
||||
@ApiResponse({ status: 400, description: 'Resend not configured' })
|
||||
async send(@Param('venueId') venueId: string, @Req() req: any) {
|
||||
return this.service.sendReminders(venueId, req.user?.email || 'unknown');
|
||||
@ApiResponse({ status: 409, description: 'Reminders are already being sent' })
|
||||
async send(@Param('venueId') venueId: string) {
|
||||
return this.service.sendReminders(venueId);
|
||||
}
|
||||
|
||||
@Get()
|
||||
|
||||
Reference in New Issue
Block a user