import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { PatientSalutationService } from './patient-salutation.service';
import { ApiOperation, ApiProperty, ApiResponse, ApiTags } from '@nestjs/swagger';


export class SalutationResponse {
  @ApiProperty({ description: 'Unique identifier for the salutation', example: 1 })
  id: number;

  @ApiProperty({ description: 'The salutation title', example: 'Mr' })
  salutation: string;

  @ApiProperty({ description: 'Timestamp of when the salutation was created', example: '2024-05-09T10:18:53.000Z' })
  created_at: string;
}


@ApiTags('Salutations')
@Controller('patient_salutation')
export class PatientSalutationController {
  constructor(private readonly patientSalutationService: PatientSalutationService) {}


  @Get()
  @ApiOperation({ summary: 'Get all patient salutations' })
  @ApiResponse({
    status: 200,
    description: 'List of patient salutations retrieved successfully.',
    type: [SalutationResponse], 
  })  findAll() {
    return this.patientSalutationService.findAll();
  }

}
