java.lang.Object
de.hybris.platform.ordermanagementwebservices.controllers.OmsBaseController
de.hybris.platform.ordermanagementwebservices.controllers.order.OmsOrdersController

@Controller @RequestMapping("/orders") public class OmsOrdersController extends OmsBaseController
WebResource exposing OmsOrderFacade http://host:port/ordermanagementwebservices/orders
  • Constructor Details

    • OmsOrdersController

      public OmsOrdersController()
  • Method Details

    • getOrders

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(method=GET) @ResponseBody public OrderSearchPageWsDto getOrders(@RequestParam(required=false,defaultValue="DEFAULT") String fields, @RequestParam(required=false,defaultValue="0") int currentPage, @RequestParam(required=false,defaultValue="10") int pageSize, @RequestParam(required=false,defaultValue="asc") String sort)
      Request to get all orders 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:
      the list of orders
    • getOrderForCode

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}", method=GET) @ResponseBody public OrderWsDTO getOrderForCode(@PathVariable String code, @RequestParam(required=false,defaultValue="DEFAULT") String fields)
      Request to get an order by code
      Parameters:
      code - the code of the requested order
      fields - defaulted to DEFAULT but can be FULL or BASIC
      Returns:
      the order
    • getOrdersByStatus

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="status/{orderStatuses}", method=GET) @ResponseBody public OrderSearchPageWsDto getOrdersByStatus(@PathVariable String orderStatuses, @RequestParam(required=false,defaultValue="DEFAULT") String fields, @RequestParam(required=false,defaultValue="0") int currentPage, @RequestParam(required=false,defaultValue="10") int pageSize, @RequestParam(required=false,defaultValue="asc") String sort) throws WebserviceValidationException
      Request to get all orders with certain order status(es)
      Parameters:
      orderStatuses - a list of valid order 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:
      the list of orders fulfilling the above conditions
      Throws:
      WebserviceValidationException - in case of passing a wrong order status validation exception will be thrown
    • getOrderStatuses

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/statuses", method=GET) @ResponseBody public OrderStatusListWsDTO getOrderStatuses()
      Request to get all OrderStatus in the system
      Returns:
      list of order statuses
    • getOrderEntriesForOrderCode

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/entries", method=GET) @ResponseBody public OrderEntrySearchPageWsDTO getOrderEntriesForOrderCode(@PathVariable String code, @RequestParam(required=false,defaultValue="DEFAULT") String fields, @RequestParam(required=false,defaultValue="0") int currentPage, @RequestParam(required=false,defaultValue="10") int pageSize, @RequestParam(required=false,defaultValue="asc") String sort)
      Request to get orderEntries for the given AbstractOrderModel.CODE
      Parameters:
      code - order's code for the requested order 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 orderEntries fulfilling the above conditions
    • getOrderEntryForOrderCodeAndEntryNumber

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/entries/{entryNumber}", method=GET) @ResponseBody public OrderEntryWsDTO getOrderEntryForOrderCodeAndEntryNumber(@PathVariable String code, @PathVariable String entryNumber, @RequestParam(required=false,defaultValue="DEFAULT") String fields)
      Request to get orderEntry for the given AbstractOrderModel.CODE and AbstractOrderEntryModel.ENTRYNUMBER
      Parameters:
      code - order's code for the requested order entries
      entryNumber - the entry number
      fields - defaulted to DEFAULT but can be FULL or BASIC
      Returns:
      the list of orderEntries fulfilling the above conditions
    • getCancelReason

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/cancel-reasons", method=GET) @ResponseBody public CancelReasonListWsDTO getCancelReason()
      Request to get all CancelReason in the system
      Returns:
      list of cancel reasons
    • getOrderFraudReports

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/fraud-reports", method=GET) @ResponseBody public FraudReportListWsDTO getOrderFraudReports(@PathVariable String code, @RequestParam(required=false,defaultValue="DEFAULT") String fields)
      Request to get fraud reports for a certain order
      Parameters:
      code - order's code for which to get the fraud reports
      fields - defaulted to DEFAULT but can be FULL or BASIC
      Returns:
      list of the order's fraud reports
    • submitOrder

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(method=POST, produces={"application/json","application/xml"}, consumes={"application/json","application/xml"}) @ResponseStatus(CREATED) @ResponseBody public OrderWsDTO submitOrder(@RequestBody OrderRequestWsDTO orderRequestWsDTO, @RequestParam(required=false,defaultValue="DEFAULT") String fields)
      Request to submit order in the system
      Parameters:
      fields - defaulted to DEFAULT but can be FULL or BASIC
      orderRequestWsDTO - object representing OrderRequestWsDTO
      Returns:
      submitted order
    • approvePotentiallyFraudulentOrder

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/fraud-reports/approve", method=POST) @ResponseStatus(OK) public void approvePotentiallyFraudulentOrder(@PathVariable @NotNull @NotNull String code) throws IllegalStateException
      Request to approve a potentially fraudulent order
      Parameters:
      code - order's code for which to approve the fraud check
      Throws:
      IllegalStateException - when the order is not in the OrderStatus.WAIT_FRAUD_MANUAL_CHECK status
    • rejectPotentiallyFraudulentOrder

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/fraud-reports/reject", method=POST) @ResponseStatus(OK) public void rejectPotentiallyFraudulentOrder(@PathVariable @NotNull @NotNull String code) throws IllegalStateException
      Request to reject a potentially fraudulent order
      Parameters:
      code - order's code for which to reject the fraud check
      Throws:
      IllegalStateException - when the order is not in the OrderStatus.WAIT_FRAUD_MANUAL_CHECK status
    • createCancelRequest

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/cancel", method=POST, produces={"application/json","application/xml"}, consumes={"application/json","application/xml"}) @ResponseStatus(CREATED) @ResponseBody public OrderCancelRecordEntryWsDTO createCancelRequest(@RequestBody OrderCancelRequestWsDTO orderCancelRequestWsDTO, @PathVariable @NotNull @NotNull String code)
      Request to create order cancellation in the system
      Parameters:
      orderCancelRequestWsDTO - object representing OrderCancelRequestWsDTO
      code - code of the order to be cancelled
      Returns:
      OrderCancelRecordEntryWsDTO showing the created cancel record
    • manuallyReleasePaymentVoid

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/manual/void-payment", method=POST, produces={"application/json","application/xml"}, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void manuallyReleasePaymentVoid(@PathVariable @NotNull @NotNull String code)
      Request to manually release the OrderModel from the waiting step after payment void fails.
      Parameters:
      code - the AbstractOrderModel.CODE for the order to be released
    • manuallyReleaseTaxVoid

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/manual/void-tax", method=POST, produces={"application/json","application/xml"}, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void manuallyReleaseTaxVoid(@PathVariable @NotNull @NotNull String code)
      Request to manually release the OrderModel from the waiting step after tax void fails.
      Parameters:
      code - the AbstractOrderModel.CODE for the order to be released
    • manuallyReleaseTaxCommit

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/manual/commit-tax", method=POST, produces={"application/json","application/xml"}, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void manuallyReleaseTaxCommit(@PathVariable @NotNull @NotNull String code)
      Request to manually release the OrderModel form the waiting step after tax commit has failed.
      Parameters:
      code - the AbstractOrderModel.CODE for the order to be released
    • manuallyReleaseTaxRequote

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/manual/requote-tax", method=POST, produces={"application/json","application/xml"}, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void manuallyReleaseTaxRequote(@PathVariable @NotNull @NotNull String code)
      Request to manually release the OrderModel form the waiting step after tax requote fails.
      Parameters:
      code - the AbstractOrderModel.CODE for the order to be released
    • manuallyReleasePaymentReauth

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/manual/reauth-payment", method=POST, produces={"application/json","application/xml"}, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void manuallyReleasePaymentReauth(@PathVariable @NotNull @NotNull String code)
      Request to manually release the OrderModel from the waiting step after payment reauth fails.
      Parameters:
      code - the AbstractOrderModel.CODE for the order to be released
    • manuallyReleaseDeliveryCostCommit

      @Secured({"ROLE_CUSTOMERSUPPORTAGENTGROUP","ROLE_CUSTOMERSUPPORTMANAGERGROUP","ROLE_CUSTOMERSUPPORTADMINISTRATORGROUP"}) @RequestMapping(value="/{code}/manual/delivery-cost-commit", method=POST, produces={"application/json","application/xml"}, consumes={"application/json","application/xml"}) @ResponseStatus(OK) public void manuallyReleaseDeliveryCostCommit(@PathVariable @NotNull @NotNull String code)
      Request to manually release the OrderModel from the waiting step after delivery cost commit fails.
      Parameters:
      code - the AbstractOrderModel.CODE for the order to be released
    • validateOrderRequest

      protected void validateOrderRequest(OrderRequestWsDTO orderRequestWsDTO)
      Validates OrderRequestWsDTO for null checks
      Parameters:
      orderRequestWsDTO - the OrderRequestWsDTO
    • extractOrderStatuses

      protected Set<OrderStatus> extractOrderStatuses(String statuses)
      Populates a set of OrderStatus out of the provided string
      Parameters:
      statuses - a comma-separated string that represents OrderStatus
      Returns:
      the newly populated Set<OrderStatus>
    • getOmsOrderFacade

      public OmsOrderFacade getOmsOrderFacade()