Dashboard Page - Appointments:
- create separate dashboard components for doctor and patient - add appointments to dashboard components - add code to backend for appointments retrieval
This commit is contained in:
@@ -116,4 +116,50 @@ public class AppointmentManagementHandler
|
||||
Data = null
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<BaseResponse> HandleGetAppointmentsByPatientId(Guid patientId)
|
||||
{
|
||||
var criteria = new List<(string FieldName, string Value)>
|
||||
{
|
||||
("PatientId", patientId.ToString())
|
||||
};
|
||||
var appointments = await _appointmentsMongoDbService.FindAsync<Appointment>(criteria);
|
||||
|
||||
if (appointments.Count == 0)
|
||||
return new BaseResponse
|
||||
{
|
||||
StatusCode = HttpStatusCodes.NotFound,
|
||||
Message = $"Appointments not found in system for patient with id {patientId}.",
|
||||
Data = null
|
||||
};
|
||||
return new BaseResponse
|
||||
{
|
||||
StatusCode = HttpStatusCodes.OK,
|
||||
Message = $"Appointments for patient with id {patientId} successfully retrieved.",
|
||||
Data = appointments
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<BaseResponse> HandleGetAppointmentsByDoctorId(Guid doctorId)
|
||||
{
|
||||
var criteria = new List<(string FieldName, string Value)>
|
||||
{
|
||||
("DoctorId", doctorId.ToString())
|
||||
};
|
||||
var appointments = await _appointmentsMongoDbService.FindAsync<Appointment>(criteria);
|
||||
|
||||
if (appointments.Count == 0)
|
||||
return new BaseResponse
|
||||
{
|
||||
StatusCode = HttpStatusCodes.NotFound,
|
||||
Message = $"Appointments not found in system for doctor with id {doctorId}.",
|
||||
Data = null
|
||||
};
|
||||
return new BaseResponse
|
||||
{
|
||||
StatusCode = HttpStatusCodes.OK,
|
||||
Message = $"Appointments for doctor with id {doctorId} successfully retrieved.",
|
||||
Data = appointments
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user