| | |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.pollex.pam.enums.ContactStatusEnum.*; |
| | | |
| | | @Service |
| | | public class ConsultantService { |
| | | |
| | |
| | | |
| | | if (!appointments.isEmpty()) { |
| | | AppointmentCustomerView latestAvailableAppointment = appointments.get(0); |
| | | customerFavoriteConsultantDTO.setContactStatus(latestAvailableAppointment.getCommunicateStatus()); |
| | | |
| | | if(latestAvailableAppointment.getCommunicateStatus() == RESERVED) |
| | | customerFavoriteConsultantDTO.setContactStatus(RESERVED); |
| | | else |
| | | customerFavoriteConsultantDTO.setContactStatus(PICKED); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | customerFavoriteConsultantRepository.saveAll(notViewRelation); |
| | | } |
| | | |
| | | public Consultant findByAgentNo(String agentNo) { |
| | | return consultantRepository.findOneByAgentNo(agentNo).get(); |
| | | } |
| | | } |