| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.pollex.pam.enums.SatisfactionTypeEnum; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import com.pollex.pam.enums.SatisfactionStatusEnum; |
| | | import com.pollex.pam.repository.AppointmentRepository; |
| | | import com.pollex.pam.service.dto.AppointmentDTO; |
| | | import com.pollex.pam.service.dto.SatisfactionCustomerScoreDTO; |
| | | |
| | | @Service |
| | | public class AppointmentMapper { |
| | |
| | | .map(s -> toAppointmentDTO(s)).collect(toList()); |
| | | } |
| | | |
| | | public Satisfaction toSatisfaction(Appointment appointment) { |
| | | public Satisfaction toAppointmentSatisfaction(Appointment appointment) { |
| | | Satisfaction target = new Satisfaction(); |
| | | target.setAppointmentId(appointment.getId()); |
| | | target.setAgentNo(appointment.getAgentNo()); |
| | | target.setCustomerId(appointment.getCustomerId()); |
| | | target.setType(SatisfactionTypeEnum.APPOINTMENT); |
| | | target.setStatus(SatisfactionStatusEnum.UNFILLED); |
| | | return target; |
| | | } |
| | | |
| | | public Satisfaction toSatisfaction(Long appointmentId) { |
| | | public Satisfaction toAppointmentSatisfaction(Long appointmentId) { |
| | | Appointment appointment = appointmentRepository.findById(appointmentId).get(); |
| | | return toSatisfaction(appointment); |
| | | return toAppointmentSatisfaction(appointment); |
| | | } |
| | | |
| | | |