Skip to content
Snippets Groups Projects

added DR update API

9 open threads

Files

+ 76
0
/**
@file <file name>
@description <description>
@author <Your Name>
@created <YYYY-MM-DD>
**/
import {
Controller,
Post,
Body,
} from '@nestjs/common';
import {
Logger,
} from 'nest-common-utilities';
import { ApiOperation, ApiResponse } from '@nestjs/swagger';
import { DoctorsService } from './doctors.service';
import { UpdateDoctorsRequestDto } from './dto/update-doctors-request.dto';
import { UpdateDoctorsResponseDto } from './dto/update-doctors-response.dto';
/**
* Controller to manage doctor-related API endpoints.
*/
/**
*
*/
@Controller('doctors')
export class DoctorsController {
private logger = new Logger(DoctorsController.name);
/**
* Initializes the DoctorsController.
*
* @param doctorsService - Service for handling doctors business logic.
*/
/**
* Service for handling doctor-related API endpoints.
*
* @param doctorsService - Service providing business logic for doctor
* operations.
*/
constructor(private readonly doctorsService: DoctorsService) {}
/**
* Update doctor master based on the request parameters.
*
* @param {UpdateDoctorsRequestDto} UpdateDoctorsRequestDto - The
* data transfer object containing the information for updating doctor.
* @returns {Promise<UpdateDoctorsResponseDto>} The updated
* doctor information.
*/
/**
* Handles the HTTP POST request to update an existing doctor's details.
* Delegates the logic to the doctorsService. Returns the updated doctor
* information in the response.
*
* @param updateDoctorsRequestDto - The DTO containing doctor update data.
* @returns A promise that resolves to the updated doctor response DTO.
*/
@Post('/update')
@ApiOperation({ summary: 'Update Doctor details' })
@ApiResponse({
status: 200,
description: 'Doctor Details Updated Successfully.',
Please register or sign in to reply
type: UpdateDoctorsResponseDto,
})
@ApiResponse({ status: 400, description: 'Bad Request.' })
async updateDoctors(
@Body() updateDoctorsRequestDto: UpdateDoctorsRequestDto,
): Promise<UpdateDoctorsResponseDto> {
return this.doctorsService.updateDoctorById(updateDoctorsRequestDto);
}
}
Loading