Class AppointmentRestController

java.lang.Object
es.kukenan.smartfi.microservice.backoffice.controller.AppointmentRestController

@RestController public class AppointmentRestController extends Object
Appointment Rest API controller.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Path for appointment detail Rest API.
    static final String
    Authority (role) required in order to be able to invoke greeting API.
    static final String
    Base path for backoffice Rest API.
    static final String
    Path for check appointment availability Rest API.
    Users service.
    static final String
    Base path for backoffice Public Rest API.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PAPI_BASE_PATH

      public static final String PAPI_BASE_PATH
      Base path for backoffice Public Rest API.
      See Also:
    • API_CHECK_DATE_PATH

      public static final String API_CHECK_DATE_PATH
      Path for check appointment availability Rest API.
      See Also:
    • API_BASE_PATH

      public static final String API_BASE_PATH
      Base path for backoffice Rest API.
      See Also:
    • API_APPOINTMENT_DETAIL_PATH

      public static final String API_APPOINTMENT_DETAIL_PATH
      Path for appointment detail Rest API.
      See Also:
    • API_AUTHORITIES

      public static final String API_AUTHORITIES
      Authority (role) required in order to be able to invoke greeting API.
      See Also:
    • appointmentService

      @Autowired private AppointmentService 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.