import { Controller, Get, Param, Patch, UseGuards } from '@nestjs/common'; import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger'; import { NotificationsService } from './notifications.service'; import { JwtGuard } from '../../common/jwt.guard'; @ApiTags('Notifications') @Controller('notifications') @UseGuards(JwtGuard) @ApiBearerAuth('JWT-auth') export class NotificationsController { constructor(private service: NotificationsService) {} @Get(':passengerId') @ApiOperation({ summary: 'Get notifications for passenger' }) getForPassenger(@Param('passengerId') id: string) { return this.service.getForPassenger(id); } @Patch(':id/read') @ApiOperation({ summary: 'Mark notification as read' }) markRead(@Param('id') id: string) { return this.service.markRead(id); } @Patch(':passengerId/read-all') @ApiOperation({ summary: 'Mark all notifications as read' }) markAllRead(@Param('passengerId') id: string) { return this.service.markAllRead(id); } }