| | |
| | | |
| | | @Autowired |
| | | AppointmentProcess abstractAppointmentProcess; |
| | | |
| | | @Autowired |
| | | PersonalNotificationService personalNotificationService; |
| | | |
| | | public Appointment customerCreateAppointment(AppointmentCreateDTO appointmentCreateDTO) { |
| | | Appointment appointment = appointmentDTOMapper.toAppointment(appointmentCreateDTO); |
| | |
| | | return appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public void updateAppointment(AppointmentUpdateDTO updateAppointmentDTO) { |
| | | public Appointment updateAppointment(AppointmentUpdateDTO updateAppointmentDTO) { |
| | | Appointment appointment = appointmentRepository.findById(updateAppointmentDTO.getId()).get(); |
| | | |
| | | BeanUtils.copyProperties(updateAppointmentDTO, appointment); |
| | | appointment.setPhone(updateAppointmentDTO.getPhone()); |
| | | appointment.setEmail(updateAppointmentDTO.getEmail()); |
| | | appointment.setContactType(updateAppointmentDTO.getContactType()); |
| | |
| | | appointment.setOtherRequirement(updateAppointmentDTO.getOtherRequirement()); |
| | | appointment.setLastModifiedDate(Instant.now()); |
| | | |
| | | appointmentRepository.save(appointment); |
| | | return appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public void markAppointmentDeleted(Long appointmentId) { |
| | |
| | | appointment.setLastModifiedDate(Instant.now()); |
| | | appointment.setCommunicateStatus(ContactStatusEnum.CANCEL); |
| | | appointmentRepository.save(appointment); |
| | | personalNotificationService.createMarkAppointmentDeletedToConsultant(appointment); |
| | | |
| | | } |
| | | |
| | | public List<Appointment> findByAgentNo(String agentNo) { |