Class OmsReturnsController


  • @Controller
    @RequestMapping("/returns")
    public class OmsReturnsController
    extends OmsBaseController
    WebResource exposing OmsReturnFacade http://host:port/ordermanagementwebservices/returns
    • Constructor Detail

      • OmsReturnsController

        public OmsReturnsController()
    • Method Detail

      • getReturns

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(method=GET)
        @ResponseBody
        public ReturnSearchPageWsDTO getReturns​(@RequestParam(required=false,defaultValue="DEFAULT")
                                                java.lang.String fields,
                                                @RequestParam(required=false,defaultValue="0")
                                                int currentPage,
                                                @RequestParam(required=false,defaultValue="10")
                                                int pageSize,
                                                @RequestParam(required=false,defaultValue="asc")
                                                java.lang.String sort)
        Request to get paged returns in the system
        Parameters:
        fields - defaulted to DEFAULT but can be FULL or BASIC
        currentPage - number of the current page
        pageSize - number of items in a page
        sort - sorting the results ascending or descending
        Returns:
        list of returns
      • getReturnsByStatus

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="status/{returnStatuses}",
                        method=GET)
        @ResponseBody
        public ReturnSearchPageWsDTO getReturnsByStatus​(@PathVariable
                                                        java.lang.String returnStatuses,
                                                        @RequestParam(required=false,defaultValue="DEFAULT")
                                                        java.lang.String fields,
                                                        @RequestParam(required=false,defaultValue="0")
                                                        int currentPage,
                                                        @RequestParam(required=false,defaultValue="10")
                                                        int pageSize,
                                                        @RequestParam(required=false,defaultValue="asc")
                                                        java.lang.String sort)
                                                 throws WebserviceValidationException
        Request to get paged returns with certain return status(s)
        Parameters:
        returnStatuses - a list of valid return statuses separated by ","
        fields - defaulted to DEFAULT but can be FULL or BASIC
        currentPage - number of the current page
        pageSize - number of items in a page
        sort - sorting the results ascending or descending
        Returns:
        list of returns that complies with conditions above
        Throws:
        WebserviceValidationException - in case of passing a wrong return status validation exception will be thrown
      • getReturnForReturnCode

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="{code}",
                        method=GET)
        @ResponseBody
        public ReturnRequestWsDTO getReturnForReturnCode​(@PathVariable
                                                         java.lang.String code,
                                                         @RequestParam(required=false,defaultValue="DEFAULT")
                                                         java.lang.String fields)
        Request to get ReturnRequest by its code
        Parameters:
        code - the code of the requested return
        fields - defaulted to DEFAULT but can be FULL or BASIC
        Returns:
        the requested returnRequest that complies with conditions above
      • updateReturnByReturnCode

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="{code}",
                        method=PUT,
                        produces={"application/json","application/xml"},
                        consumes={"application/json","application/xml"})
        @ResponseStatus(OK)
        @ResponseBody
        public ReturnRequestWsDTO updateReturnByReturnCode​(@NotNull @RequestBody
                                                           @NotNull ReturnRequestModificationWsDTO returnRequestModificationWsDTO,
                                                           @NotNull @PathVariable
                                                           @NotNull java.lang.String code,
                                                           @RequestParam(required=false,defaultValue="DEFAULT")
                                                           java.lang.String fields)
        Request to update ReturnRequest by its code
        Parameters:
        code - the code of the requested return
        fields - defaulted to DEFAULT but can be FULL or BASIC
        Returns:
        the requested returnRequest that complies with conditions above
      • getReturnStatuses

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="/statuses",
                        method=GET)
        @ResponseBody
        public ReturnStatusListWsDTO getReturnStatuses()
        Request to get all ReturnStatus in the system
        Returns:
        list of return statuses
      • getReturnEntriesForOrderCode

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="/{code}/entries",
                        method=GET)
        @ResponseBody
        public ReturnEntrySearchPageWsDTO getReturnEntriesForOrderCode​(@PathVariable
                                                                       java.lang.String code,
                                                                       @RequestParam(required=false,defaultValue="DEFAULT")
                                                                       java.lang.String fields,
                                                                       @RequestParam(required=false,defaultValue="0")
                                                                       int currentPage,
                                                                       @RequestParam(required=false,defaultValue="10")
                                                                       int pageSize,
                                                                       @RequestParam(required=false,defaultValue="asc")
                                                                       java.lang.String sort)
        Request to get returnEntries for the given ReturnRequestModel.CODE
        Parameters:
        code - return's code for the requested return entries
        fields - defaulted to DEFAULT but can be FULL or BASIC
        currentPage - number of the current page
        pageSize - number of items in a page
        sort - sorting the results ascending or descending
        Returns:
        the list of returnEntries fulfilling the above conditions
      • createReturnRequest

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(method=POST,
                        produces={"application/json","application/xml"},
                        consumes={"application/json","application/xml"})
        @ResponseStatus(CREATED)
        @ResponseBody
        public ReturnRequestWsDTO createReturnRequest​(@RequestBody
                                                      ReturnRequestWsDTO returnRequestWsDTO,
                                                      @RequestParam(required=false,defaultValue="DEFAULT")
                                                      java.lang.String fields)
        Request to create return in the system
        Parameters:
        fields - defaulted to DEFAULT but can be FULL or BASIC
        returnRequestWsDTO - object representing ReturnRequestWsDTO
        Returns:
        created return
      • getReturnsCancellationReasons

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="/cancel-reasons",
                        method=GET)
        @ResponseBody
        public CancelReasonListWsDTO getReturnsCancellationReasons()
        Request to get return cancellation reasons
        Returns:
        list of cancel reasons
      • getRefundReasons

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="/refund-reasons",
                        method=GET)
        @ResponseBody
        public RefundReasonListWsDTO getRefundReasons()
        Request to get refund reasons
        Returns:
        list of refund reasons
      • getReturnActions

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="/actions",
                        method=GET)
        @ResponseBody
        public ReturnActionListWsDTO getReturnActions()
        Request to get return actions
        Returns:
        list of return actions
      • approveReturnRequest

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="{code}/approve",
                        method=POST)
        @ResponseStatus(OK)
        public void approveReturnRequest​(@PathVariable
                                         java.lang.String code)
        Request to approve Return Request
        Parameters:
        code - code for the requested returnRequest
      • cancelReturnRequest

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="/cancel",
                        method=POST,
                        produces={"application/json","application/xml"},
                        consumes={"application/json","application/xml"})
        @ResponseStatus(OK)
        public void cancelReturnRequest​(@RequestBody
                                        CancelReturnRequestWsDTO cancelReturnRequestWsDTO)
                                 throws WebserviceValidationException
        Request to cancel a ReturnRequestModel.
        Parameters:
        cancelReturnRequestWsDTO - contains information about the cancellation of the return request.
        Throws:
        WebserviceValidationException - in case the request body has erroneous fields.
      • manuallyReversePayment

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="{code}/manual/reverse-payment",
                        method=POST)
        @ResponseStatus(OK)
        public void manuallyReversePayment​(@NotNull @PathVariable
                                           @NotNull java.lang.String code)
        Request to reverse payment manually.
        Parameters:
        code - code for the requested returnRequest
      • manuallyReverseTax

        @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"})
        @RequestMapping(value="{code}/manual/reverse-tax",
                        method=POST)
        @ResponseStatus(OK)
        public void manuallyReverseTax​(@NotNull @PathVariable
                                       @NotNull java.lang.String code)
        Request to reverse tax manually.
        Parameters:
        code - code for the requested returnRequest
      • extractReturnStatuses

        protected java.util.Set<ReturnStatus> extractReturnStatuses​(java.lang.String statuses)
        Extracts the ReturnStatus from the provided String representation
        Parameters:
        statuses - a comma-separated string that represent ReturnStatus
        Returns:
        the newly extracted Set