Class OrderNoteEndpoint
java.lang.Object
com.broadleafcommerce.order.web.endpoint.OrderNoteEndpoint
@FrameworkRestController
@FrameworkMapping("/orders/{orderId}/notes")
@DataRouteByExample(OrderNote.class)
public class OrderNoteEndpoint
extends Object
Endpoint for management of
OrderNotes
.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOrderNoteEndpoint
(OrderNoteService<OrderNote> orderNoteService, OrderService<com.broadleafcommerce.order.client.domain.Order> orderService) -
Method Summary
Modifier and TypeMethodDescriptioncreateOrderNote
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String orderId, OrderNote orderNote) void
deleteOrderNote
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String orderId, String orderNoteId) protected OrderNote
ensureNoteBelongsToOrderAndReturn
(@NonNull String orderId, @NonNull String orderNoteId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Ensures that theOrderNote
is associated with the specified order ID.protected void
ensureOrderExists
(@NonNull String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.since 2.2.0.protected OrderNoteService<OrderNote>
protected OrderService<com.broadleafcommerce.order.client.domain.Order>
org.springframework.data.domain.Page<OrderNote>
readAllOrderNotes
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String orderId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page) readOrderNoteById
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String orderId, String orderNoteId) protected void
setApplicationOnContextInfo
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
Field Details
-
BASE_URI
- See Also:
-
IGNORE_ARCHIVED_FILTER
- See Also:
-
-
Constructor Details
-
OrderNoteEndpoint
public OrderNoteEndpoint(OrderNoteService<OrderNote> orderNoteService, OrderService<com.broadleafcommerce.order.client.domain.Order> orderService)
-
-
Method Details
-
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
-
createOrderNote
-
deleteOrderNote
-
ensureOrderExists
@Deprecated(forRemoval=true, since="2.2.0") protected void ensureOrderExists(@NonNull @NonNull String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.since 2.2.0. Redundant DB read.Ensures that theOrder
exists before we manageOrderNotes
in that order.- Parameters:
orderId
- ID of the order to check for existencecontextInfo
- 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 theOrderNote
is associated with the specified order ID. Also retrieves the order note.- Parameters:
orderId
- ID of the order to check for associationorderNoteId
- ID of the order note to check for associationcontextInfo
- 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
-
setApplicationOnContextInfo
protected void setApplicationOnContextInfo(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getOrderNoteService
-
getOrderService
-