From 21ef1925cee5e7664289b96ba843f28a3701343c Mon Sep 17 00:00:00 2001 From: MrDave1999 Date: Fri, 30 Dec 2022 18:11:32 -0500 Subject: [PATCH] Removed the feature of sending appointment information to the patient by WhatsApp It was decided to remove this feature for several reasons: 1. The basic user can view the appointment information from the web application. 2. We have not found an easy and efficient way on how to get the title of the option selected by the user from the chatbot. The current code makes another call to the database to get the appointment information, when this should not be the case, it is inefficient. It is true that this functionality has a benefit: - In case the basic user schedules an appointment for a dependent, the appointment information would reach the dependent's WhatsApp (e.g., a family member or friend). --- src/Extensions/ApplicationDependencies.cs | 1 - src/Features/Appointments/AppointmentService.cs | 4 ---- .../Notification/AppointmentInformationSendingService.cs | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Extensions/ApplicationDependencies.cs b/src/Extensions/ApplicationDependencies.cs index f3bf92d0..c628fc38 100644 --- a/src/Extensions/ApplicationDependencies.cs +++ b/src/Extensions/ApplicationDependencies.cs @@ -20,7 +20,6 @@ public static IServiceCollection AddServices(this IServiceCollection services) .AddScoped() .AddScoped() .AddScoped() - .AddScoped() .AddScoped() .AddScoped() .AddScoped() diff --git a/src/Features/Appointments/AppointmentService.cs b/src/Features/Appointments/AppointmentService.cs index fd371b72..23b6d61c 100644 --- a/src/Features/Appointments/AppointmentService.cs +++ b/src/Features/Appointments/AppointmentService.cs @@ -3,15 +3,12 @@ public class AppointmentService : IAppointmentService { private readonly IAppointmentRepository _appointmentRepository; - private readonly IAppointmentInformationSendingService _sendingService; private readonly IDateTimeProvider _dateTimeProvider; public AppointmentService(IAppointmentRepository appointmentRepository, - IAppointmentInformationSendingService sendingService, IDateTimeProvider dateTimeProvider) { _appointmentRepository = appointmentRepository; - _sendingService = sendingService; _dateTimeProvider = dateTimeProvider; } @@ -23,7 +20,6 @@ public async Task> CreateAppointmentAsync(AppointmentInsertDto var appointment = appointmentInsertDto.MapToAppointment(); _appointmentRepository.Insert(appointment); await _appointmentRepository.SaveAsync(); - await _sendingService.SendAppointmentInformationAsync(appointment.Id, appointmentInsertDto); return new Response { Data = new DtoBase { Id = appointment.Id }, diff --git a/src/Features/Appointments/Notification/AppointmentInformationSendingService.cs b/src/Features/Appointments/Notification/AppointmentInformationSendingService.cs index 0e128102..147d7926 100644 --- a/src/Features/Appointments/Notification/AppointmentInformationSendingService.cs +++ b/src/Features/Appointments/Notification/AppointmentInformationSendingService.cs @@ -17,7 +17,7 @@ public AppointmentInformationSendingService(IAppointmentRepository appointmentRe public async Task SendAppointmentInformationAsync(int appointmentId, AppointmentInsertDto appointmentInsertDto) { - // La consulta se ejecuta en caso que se realice el agendamiento de forma manual. + // The query is executed in case the scheduling of appointments is done manually by the secretary. appointmentInsertDto.RangeToPay ??= await _treatmentRepository.GetTreatmentWithRangeToPayAsync(appointmentInsertDto.GeneralTreatmentId); var businessName = EnvReader.Instance[AppSettings.BusinessName]; var info = await _appointmentRepository.GetAppointmentInformationAsync(appointmentId);