Class RequestRemovalFromConcreteShiftController
java.lang.Object
org.cswteams.ms3.control.requestRemovalFromConcreteShift.RequestRemovalFromConcreteShiftController
- All Implemented Interfaces:
IRequestRemovalFromConcreteShiftController
@Service
public class RequestRemovalFromConcreteShiftController
extends Object
implements IRequestRemovalFromConcreteShiftController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRequest(@NotNull RequestRemovalFromConcreteShiftDTO requestRemovalFromConcreteShiftDTO) Create a new request of removal from concrete shift, given a DTO.Get all the requests from the database.Get all pending requests (i.e. not reviewed).getRequest(Long requestId) Get a specific request, given an ID.getRequestsByRequestingDoctorId(Long requestingDoctorId) Get all the requests, filtered by requesting doctor ID.reviewRequest(RequestRemovalFromConcreteShiftDTO requestRemovalFromConcreteShiftDTO) Review a request (done by a Planner - the outcome is embedded into the DTO parameter).uploadFile(Long requestId, org.springframework.web.multipart.MultipartFile file) Upload a file (not mandatory) to be attached to a request, given the request ID.
-
Constructor Details
-
RequestRemovalFromConcreteShiftController
public RequestRemovalFromConcreteShiftController()
-
-
Method Details
-
createRequest
public RequestRemovalFromConcreteShiftDTO createRequest(@NotNull @NotNull RequestRemovalFromConcreteShiftDTO requestRemovalFromConcreteShiftDTO) throws DatabaseException, ConcreteShiftException Description copied from interface:IRequestRemovalFromConcreteShiftControllerCreate a new request of removal from concrete shift, given a DTO.- Specified by:
createRequestin interfaceIRequestRemovalFromConcreteShiftController- Parameters:
requestRemovalFromConcreteShiftDTO- DTO related to the request- Returns:
- DTO object related to the request
- Throws:
DatabaseException- in case an error during database lookup occursConcreteShiftException- in case an error during database lookup occurs
-
getRequest
Description copied from interface:IRequestRemovalFromConcreteShiftControllerGet a specific request, given an ID.- Specified by:
getRequestin interfaceIRequestRemovalFromConcreteShiftController- Parameters:
requestId- request id- Returns:
- object related to the request, if any
- Throws:
DatabaseException- in case an error during database lookup occurs
-
getAllRequests
Description copied from interface:IRequestRemovalFromConcreteShiftControllerGet all the requests from the database.- Specified by:
getAllRequestsin interfaceIRequestRemovalFromConcreteShiftController- Returns:
Setof all the requests from the database
-
getPendingRequests
Description copied from interface:IRequestRemovalFromConcreteShiftControllerGet all pending requests (i.e. not reviewed).- Specified by:
getPendingRequestsin interfaceIRequestRemovalFromConcreteShiftController- Returns:
Setof all the pending requests from the database
-
getRequestsByRequestingDoctorId
public Set<RequestRemovalFromConcreteShiftDTO> getRequestsByRequestingDoctorId(Long requestingDoctorId) Description copied from interface:IRequestRemovalFromConcreteShiftControllerGet all the requests, filtered by requesting doctor ID.- Specified by:
getRequestsByRequestingDoctorIdin interfaceIRequestRemovalFromConcreteShiftController- Parameters:
requestingDoctorId- requesting doctor ID, for filtering- Returns:
Setof all the requests related to the specific doctor whose ID is provided
-
reviewRequest
public RequestRemovalFromConcreteShiftDTO reviewRequest(RequestRemovalFromConcreteShiftDTO requestRemovalFromConcreteShiftDTO) throws DatabaseException, ConcreteShiftException Description copied from interface:IRequestRemovalFromConcreteShiftControllerReview a request (done by a Planner - the outcome is embedded into the DTO parameter).- Specified by:
reviewRequestin interfaceIRequestRemovalFromConcreteShiftController- Parameters:
requestRemovalFromConcreteShiftDTO- DTO related to the request- Returns:
- DTO related to the request, updated with the outcome of the review
- Throws:
DatabaseException- in case an error during database lookup occursConcreteShiftException
-
uploadFile
public RequestRemovalFromConcreteShiftDTO uploadFile(Long requestId, org.springframework.web.multipart.MultipartFile file) throws IOException, DatabaseException Description copied from interface:IRequestRemovalFromConcreteShiftControllerUpload a file (not mandatory) to be attached to a request, given the request ID.- Specified by:
uploadFilein interfaceIRequestRemovalFromConcreteShiftController- Parameters:
requestId- request idfile- file to be attached- Returns:
- DTO related to the request, updated with the file
- Throws:
IOException- in case of I/O errorsDatabaseException- in case an error during database lookup occurs
-