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 ofOrderNotes
.
-
-
Constructor Summary
Constructors Constructor Description OrderNoteEndpoint(OrderNoteService<OrderNote> orderNoteService, OrderService<com.broadleafcommerce.order.client.domain.Order> orderService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OrderNote
createOrderNote(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)
Ensures that theOrder
exists before we manageOrderNotes
in that order.protected OrderNoteService<OrderNote>
getOrderNoteService()
protected OrderService<com.broadleafcommerce.order.client.domain.Order>
getOrderService()
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)
OrderNote
readOrderNoteById(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String orderId, String orderNoteId)
-
-
-
Field Detail
-
BASE_URI
public static final String BASE_URI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OrderNoteEndpoint
public OrderNoteEndpoint(OrderNoteService<OrderNote> orderNoteService, OrderService<com.broadleafcommerce.order.client.domain.Order> orderService)
-
-
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 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
-
getOrderNoteService
protected OrderNoteService<OrderNote> getOrderNoteService()
-
getOrderService
protected OrderService<com.broadleafcommerce.order.client.domain.Order> getOrderService()
-
-