Class OrderNoteEndpoint


  • @FrameworkRestController
    @FrameworkMapping("/orders/{orderId}/notes")
    @DataRouteByExample(OrderNote.class)
    public class OrderNoteEndpoint
    extends Object
    Endpoint for management of OrderNotes.
    • Method Detail

      • readAllOrderNotes

        @Policy(permissionRoots="ORDER_NOTE")
        @FrameworkGetMapping
        public org.springframework.data.domain.Page<OrderNote> readAllOrderNotes​(@ContextOperation
                                                                                 com.broadleafcommerce.data.tracking.core.context.ContextInfo context,
                                                                                 @PathVariable("orderId")
                                                                                 String orderId,
                                                                                 cz.jirutka.rsql.parser.ast.Node filters,
                                                                                 @PageableDefault(size=50)
                                                                                 org.springframework.data.domain.Pageable page)
      • readOrderNoteById

        @Policy(permissionRoots="ORDER_NOTE")
        @FrameworkGetMapping("/{id}")
        public OrderNote readOrderNoteById​(@ContextOperation
                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo context,
                                           @PathVariable("orderId")
                                           String orderId,
                                           @PathVariable("id")
                                           String orderNoteId)
      • createOrderNote

        @Policy(permissionRoots="ORDER_NOTE")
        @FrameworkPostMapping(consumes="application/json")
        public OrderNote createOrderNote​(@ContextOperation(CREATE)
                                         com.broadleafcommerce.data.tracking.core.context.ContextInfo context,
                                         @PathVariable("orderId")
                                         String orderId,
                                         @RequestBody
                                         OrderNote orderNote)
      • deleteOrderNote

        @Policy(permissionRoots="ORDER_NOTE")
        @FrameworkDeleteMapping("/{id}")
        public void deleteOrderNote​(@ContextOperation(DELETE)
                                    com.broadleafcommerce.data.tracking.core.context.ContextInfo context,
                                    @PathVariable("orderId")
                                    String orderId,
                                    @PathVariable("id")
                                    String orderNoteId)
      • ensureOrderExists

        protected void ensureOrderExists​(@NonNull
                                         @NonNull String orderId,
                                         com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Ensures that the Order exists before we manage OrderNotes in that order.
        Parameters:
        orderId - ID of the order to check for existence
        contextInfo - context information around sandbox and multitenant state
      • ensureNoteBelongsToOrderAndReturn

        protected OrderNote ensureNoteBelongsToOrderAndReturn​(@NonNull
                                                              @NonNull String orderId,
                                                              @NonNull
                                                              @NonNull String orderNoteId,
                                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Ensures that the OrderNote is associated with the specified order ID. Also retrieves the order note.
        Parameters:
        orderId - ID of the order to check for association
        orderNoteId - ID of the order note to check for association
        contextInfo - context information around sandbox and multitenant state
        Returns:
        the found order note
        Throws:
        com.broadleafcommerce.data.tracking.core.exception.EntityMissingException - if the order note is not associated to the order
      • getOrderService

        protected OrderService<com.broadleafcommerce.order.client.domain.Order> getOrderService()