From 1be0b02a5448052fe838bda8bfa4f4f59a0ba5a5 Mon Sep 17 00:00:00 2001 From: zemedkunworkalem32 Date: Mon, 6 Apr 2026 21:12:36 +0300 Subject: [PATCH] add comment --- src/modules/appointments/appointment.controller.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/appointments/appointment.controller.js b/src/modules/appointments/appointment.controller.js index e9b7ae5..c840100 100644 --- a/src/modules/appointments/appointment.controller.js +++ b/src/modules/appointments/appointment.controller.js @@ -1,26 +1,26 @@ import * as appointmentService from './appointment.service.js'; import { asyncHandler, ApiResponse } from '../../shared/utils/helpers.js'; - +// Controller functions for appointment routes export const createAppointment = asyncHandler(async (req, res) => { const result = await appointmentService.createAppointment(req.body); res.status(201).json(ApiResponse.success(result, 'Appointment created successfully', 201)); }); - +// Get all appointments with optional filters (date range, provider, user) export const getAllAppointments = asyncHandler(async (req, res) => { const result = await appointmentService.getAllAppointments(req.query); res.status(200).json(ApiResponse.success(result, 'Appointments retrieved successfully')); }); - +// Get appointment by ID export const getAppointmentById = asyncHandler(async (req, res) => { const result = await appointmentService.getAppointmentById(req.params.appointmentId); res.status(200).json(ApiResponse.success(result, 'Appointment retrieved successfully')); }); - +// Get appointments for a specific user export const getUserAppointments = asyncHandler(async (req, res) => { const result = await appointmentService.getAppointmentsByUser(req.params.userId, req.query); res.status(200).json(ApiResponse.success(result, 'User appointments retrieved successfully')); }); - +// Get appointments for a specific provider export const getProviderAppointments = asyncHandler(async (req, res) => { const result = await appointmentService.getAppointmentsByProvider(req.params.providerId, req.query); res.status(200).json(ApiResponse.success(result, 'Provider appointments retrieved successfully'));