| | |
| | | |
| | | import java.time.Instant; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.pollex.pam.enums.AppointmentStatusEnum; |
| | | import com.pollex.pam.service.dto.AppointmentDTO; |
| | |
| | | |
| | | appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public void recordAllAppointmentsView(String agentNo) { |
| | | List<Appointment> consultantNotViewAppointments = findByAgentNo(agentNo) |
| | | .stream() |
| | | .filter(appointment -> Objects.isNull(appointment.getConsultantViewTime())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | consultantNotViewAppointments.forEach(appointment -> appointment.setConsultantViewTime(Instant.now())); |
| | | appointmentRepository.saveAll(consultantNotViewAppointments); |
| | | } |
| | | |
| | | public List<AppointmentCustomerViewDTO> getConsultantAppointments(String agentNo) { |
| | | List<AppointmentCustomerView> appointmentList = appointmentCustomerViewRepository.findByAgentNo(agentNo); |
| | | return appointmentCustomerViewMapper.toAppointmentCustomerViewDTO(appointmentList); |
| | | } |
| | | } |