import { Controller, Get, UseGuards } from '@nestjs/common';
import { JwtAuthGuard } from '../common/guards/jwt-auth.guard';
import { CurrentUser, AuthenticatedUser } from '../common/decorators/current-user.decorator';
import { CertificateService } from './certificate.service';

@UseGuards(JwtAuthGuard)
@Controller('certificate')
export class CertificateController {
  constructor(private readonly certificateService: CertificateService) {}

  @Get()
  get(@CurrentUser() user: AuthenticatedUser) {
    return this.certificateService.getCertificate(user.userId);
  }
}
