Class AppointmentRestController
java.lang.Object
es.kukenan.smartfi.microservice.backoffice.controller.AppointmentRestController
Appointment Rest API controller.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPath for appointment detail Rest API.static final StringAuthority (role) required in order to be able to invoke greeting API.static final StringBase path for backoffice Rest API.static final StringPath for check appointment availability Rest API.private AppointmentServiceUsers service.static final StringBase path for backoffice Public Rest API. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object>checkDayAvailability(es.kukenan.smartfi.dto.backoffice.appointment.AppointmentCheckDayRequestDTO requestDto) Check working hours for a day.org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentDto>>getAppointment(String appointmentId) Save appointment for user.org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentDto>>saveAppointment(es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentRequest requestDto) Save appointment for user.
-
Field Details
-
PAPI_BASE_PATH
Base path for backoffice Public Rest API.- See Also:
-
API_CHECK_DATE_PATH
Path for check appointment availability Rest API.- See Also:
-
API_BASE_PATH
Base path for backoffice Rest API.- See Also:
-
API_APPOINTMENT_DETAIL_PATH
Path for appointment detail Rest API.- See Also:
-
API_AUTHORITIES
Authority (role) required in order to be able to invoke greeting API.- See Also:
-
appointmentService
Users service.
-
-
Constructor Details
-
AppointmentRestController
public AppointmentRestController()
-
-
Method Details
-
checkDayAvailability
@PostMapping(path="/papi/v1/backoffice/appointment/checkDay", produces="application/json", consumes="application/json") public org.springframework.http.ResponseEntity<Object> checkDayAvailability(@RequestBody es.kukenan.smartfi.dto.backoffice.appointment.AppointmentCheckDayRequestDTO requestDto) Check working hours for a day.- Parameters:
requestDto- day to check- Returns:
- hours list.
-
saveAppointment
@PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @PostMapping(path="/api/v1/backoffice/appointment", produces="application/json", consumes="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentDto>> saveAppointment(@RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentRequest requestDto) Save appointment for user.- Parameters:
requestDto- appointment information.- Returns:
- Appointment created.
-
getAppointment
@PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_CONSULTANT\') and hasRole(\'ROLE_LEVEL_USER_CONSULTANT\')) or (hasRole(\'ROLE_ACCESS_USER\') and hasRole(\'ROLE_LEVEL_USER_SCA\'))") @GetMapping(path="/api/v1/backoffice/appointment/{appointmentId}", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.appointments.AppointmentDto>> getAppointment(@PathVariable(name="appointmentId") String appointmentId) Save appointment for user.- Parameters:
appointmentId- appointment identifier.- Returns:
- Appointment detail.
-