| | |
| | | import java.time.Instant; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.pollex.pam.domain.Satisfaction; |
| | |
| | | appointment.setRequirement(updateAppointmentDTO.getRequirement()); |
| | | appointment.setHopeContactTime(updateAppointmentDTO.getHopeContactTime()); |
| | | appointment.setOtherRequirement(updateAppointmentDTO.getOtherRequirement()); |
| | | appointment.setLastModifiedDate(Instant.now()); |
| | | |
| | | appointmentRepository.save(appointment); |
| | | } |
| | |
| | | public void markAppointmentDeleted(Long appointmentId) { |
| | | Appointment appointment = appointmentRepository.findById(appointmentId).get(); |
| | | appointment.setStatus(DELETED); |
| | | appointment.setLastModifiedDate(Instant.now()); |
| | | appointmentRepository.save(appointment); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | public Appointment markAsContacted(Long appointmentId) { |
| | | |
| | | Appointment appointment = appointmentRepository.findById(appointmentId).get(); |
| | | appointment.setCommunicateStatus(ContactStatusEnum.CONTACTED); |
| | | appointment.setContactTime(Instant.now()); |
| | | return appointmentRepository.save(appointment); |
| | | appointment.setLastModifiedDate(Instant.now()); |
| | | return appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public AppointmentCustomerViewDTO getAppointmentDetail(Long appointmentId) { |
| | |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | public Optional<Appointment> findLatestAppointmentByAgentNoAndCustomerId(String agentNo, Long customerId) { |
| | | return appointmentRepository.findTopByAgentNoAndCustomerIdOrderByAppointmentDateDesc(agentNo, customerId); |
| | | } |
| | | |
| | | public void recordConsultantReadTime(Long appointmentId) { |
| | | Appointment appointment = appointmentRepository.findById(appointmentId).get(); |
| | | |