import { Controller, Post, Body } from '@nestjs/common';
import { JobSavedService } from './job_saved.service';
import { JobSaved } from './entities/job_saved.entity';
import { ApiBearerAuth, ApiTags, ApiOperation, ApiBody } from '@nestjs/swagger';

@ApiTags('jobSaved')
@ApiBearerAuth('access-token')
@Controller('jobSaved')
export class JobSavedController {
  constructor(private readonly jobSavedService: JobSavedService) {}

  @Post()
  @ApiOperation({ summary: 'Save a job' })
  @ApiBody({
    schema: {
      type: 'object',
      properties: {
        job_post_id: { type: 'number', example: 1 },
        seeker_id: { type: 'number', example: 1 },
      },
      required: ['job_post_id', 'seeker_id'],
    },
  })
  create(@Body() jobSaved: JobSaved) {
    return this.jobSavedService.create(jobSaved);
  }
}
