Class CartApprovalRequestEventListener
java.lang.Object
com.broadleafcommerce.auth.user.messaging.CartApprovalRequestEventListener
Component responsible for handling
CartApprovalRequestEvents
.
This will look up the contact information for the approver users for the associated account and
attach it to a new notification event so that they can be contacted.- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCartApprovalRequestEventListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, UserService<User> userService, UserRoleService<UserRole> userRoleService, AccountRoleService<AccountRole> accountRoleService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, CartApprovalRequestNotificationProducer cartApprovalRequestNotificationProducer, AccountAncestorService accountAncestorService) -
Method Summary
Modifier and TypeMethodDescriptionprotected CartApprovalRequestEvent.ApproverRef
buildApproverRef
(@NonNull User user) protected AccountAncestorService
protected AccountRoleService<AccountRole>
protected CartApprovalRequestNotificationProducer
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
protected com.broadleafcommerce.common.extension.TypeFactory
protected UserRoleService<UserRole>
protected UserService<User>
protected CartApprovalRequestEvent
hydrateApproverUsers
(@NonNull CartApprovalRequestEvent event) Retrieves all the Approver Users associated with the account the cart-submitted-for-approval belongs to.void
listen
(org.springframework.messaging.Message<CartApprovalRequestEvent> message) protected void
processMessage
(org.springframework.messaging.Message<CartApprovalRequestEvent> message)
-
Field Details
-
APPROVER_PERMISSION
- See Also:
-
RANDOM
-
-
Constructor Details
-
CartApprovalRequestEventListener
public CartApprovalRequestEventListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, UserService<User> userService, UserRoleService<UserRole> userRoleService, AccountRoleService<AccountRole> accountRoleService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, CartApprovalRequestNotificationProducer cartApprovalRequestNotificationProducer, AccountAncestorService accountAncestorService)
-
-
Method Details
-
listen
@StreamListener("cartApprovalRequestInput") public void listen(org.springframework.messaging.Message<CartApprovalRequestEvent> message) -
processMessage
protected void processMessage(org.springframework.messaging.Message<CartApprovalRequestEvent> message) -
hydrateApproverUsers
protected CartApprovalRequestEvent hydrateApproverUsers(@NonNull @NonNull CartApprovalRequestEvent event) Retrieves all the Approver Users associated with the account the cart-submitted-for-approval belongs to.- Parameters:
event
- Event message after a cart was submitted for approval.- Returns:
- A hydrated
event
to includeCartApprovalRequestEvent.getApprovers()
.
-
buildApproverRef
-
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService() -
getUserService
-
getUserRoleService
-
getAccountRoleService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCartApprovalRequestNotificationProducer
-
getAccountAncestorService
-