| | |
| | | package com.pollex.pam.web.rest; |
| | | |
| | | import com.pollex.pam.business.aop.logging.audit.AuditLoggingInject; |
| | | import com.pollex.pam.business.domain.Appointment; |
| | | import com.pollex.pam.business.domain.Consultant; |
| | | import com.pollex.pam.business.security.SecurityUtils; |
| | | import com.pollex.pam.business.service.AppointmentService; |
| | |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | | |
| | | import static com.pollex.pam.business.aop.logging.audit.AuditLoggingType.CONSULTANT_SEND_FILL_SATISFACTION_NOTICE; |
| | | import static com.pollex.pam.business.aop.logging.audit.AuditLoggingType.EDIT_CONSULTANT_DATA; |
| | | |
| | | @RestController |
| | |
| | | } |
| | | Consultant editResult = consultantService.editConsultant(editDTO); |
| | | return new ResponseEntity<>(editResult, HttpStatus.OK); |
| | | } |
| | | |
| | | @AuditLoggingInject(type = CONSULTANT_SEND_FILL_SATISFACTION_NOTICE) |
| | | @PostMapping("/sendSatisfactionToClient/{appointmentId}") |
| | | public ResponseEntity<Void> sendSatisfactionToClient(@PathVariable Long appointmentId) { |
| | | Appointment appointment = appointmentService.findById(appointmentId); |
| | | if(!appointment.getAgentNo().equals(SecurityUtils.getAgentNo())) { |
| | | throw new IllegalAccessError(); |
| | | } |
| | | consultantService.sendSatisfactionToClient(appointment); |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | } |