import { Controller, Get, Patch, Param, Query, UseGuards } from '@nestjs/common';
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
import { RemindersService } from './reminders.service';
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
import { CurrentTenant } from '../../common/decorators/tenant.decorator';
import { ReminderStatus } from '@prisma/client';

@ApiTags('Reminders')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Controller('reminders')
export class RemindersController {
  constructor(private service: RemindersService) {}

  @Get()
  findAll(@CurrentTenant() tenantId: string, @Query('status') status?: ReminderStatus) {
    return this.service.findAll(tenantId, status);
  }

  @Get('overdue')
  overdue(@CurrentTenant() tenantId: string) {
    return this.service.getOverdue(tenantId);
  }

  @Get('today')
  today(@CurrentTenant() tenantId: string) {
    return this.service.getToday(tenantId);
  }

  @Patch(':id/done')
  markDone(@CurrentTenant() tenantId: string, @Param('id') id: string) {
    return this.service.markDone(tenantId, id);
  }
}
