Class OrderExtendedController

java.lang.Object
com.skava.oms.web.OrderExtendedController

@RestController @RequestMapping("/orders") public class OrderExtendedController extends Object
This class defines the controller implementations to handle the order request.
Author:
Infosys Equinox
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<OrderDTO>
    updateNotifications(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, long collectionid, String version, String locale, String orderId, @Valid NotificationPatchDTO notificationPatchDTO)
    This method is used to create the note to the given order id NoteRequest, collectionId, version and locale
    org.springframework.http.ResponseEntity<OrderDTO>
    updateOrder(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, long collectionid, String version, String locale, String orderId, @Valid OrderDTO orderDTO)
    This method is used to create the order based on given OrderRequest, collectionId, version and locale OrderRequest is validated by various constraints as followed:
    Fulfillment type validation
    Shipping method validation
    Tax validation
    Discount validation
    Math validation

    Methods inherited from class java.lang.Object

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

    • OrderExtendedController

      public OrderExtendedController()
  • Method Details

    • updateNotifications

      @PatchMapping("/{orderId}/notifications") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'oms/update/notification\', \'oms\', #collectionid)") public org.springframework.http.ResponseEntity<OrderDTO> updateNotifications(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @RequestHeader(value="x-collection-id",required=true) long collectionid, @RequestHeader(value="x-version",required=false) String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @PathVariable(value="orderId",required=true) String orderId, @RequestBody @Valid @Valid NotificationPatchDTO notificationPatchDTO)

      This method is used to create the note to the given order id NoteRequest, collectionId, version and locale

      Parameters:
      request - Request provides request information for HTTP servlets. Request provides request information for HTTP servlets.
      response - Response provides HTTP-specific functionality in sending a response.
      collectionid - It contains the valid collection identifier of this micro service and requested operation will be performed on this collection identifier
      version - It contains value of the API version.
      locale - API Response and error messages will be responded in the locale mentioned in this parameter.
      orderId - Id of the order for which the notes to be created
      notificationPatchDTO - contains the NoteDTO input
      Returns:
      It returns the OrderResponse
    • updateOrder

      @PutMapping("/{orderId}") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'oms/replace/order\', \'oms\', #collectionid)") public org.springframework.http.ResponseEntity<OrderDTO> updateOrder(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @RequestHeader(value="x-collection-id",required=true) long collectionid, @RequestHeader(value="x-version",required=false) String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @PathVariable("orderId") String orderId, @RequestBody @Valid @Valid OrderDTO orderDTO)

      This method is used to create the order based on given OrderRequest, collectionId, version and locale OrderRequest is validated by various constraints as followed:
      Fulfillment type validation
      Shipping method validation
      Tax validation
      Discount validation
      Math validation

      Parameters:
      request - Request provides request information for HTTP servlets. Request provides request information for HTTP servlets.
      response - Response provides HTTP-specific functionality in sending a response.
      collectionid - It contains the valid collection identifier of this micro service and requested operation will be performed on this collection identifier
      orderId - It refers to unique identifier of order for which the patch request has to be done
      version - It contains value of the API version.
      locale - API Response and error messages will be responded in the locale mentioned in this parameter.
      orderDTO - Contains the order which is the request
      Returns:
      It returns the OrderResponse which contains the Order being created