Package de.hybris.platform.b2b.services
Interface B2BPermissionService<T extends UserModel,P extends B2BPermissionResultModel>
- Type Parameters:
T- the user (subtype ofUserModel)P- the permission result (subtype ofB2BPermissionResultModel)
- All Known Implementing Classes:
DefaultB2BPermissionService
public interface B2BPermissionService<T extends UserModel,P extends B2BPermissionResultModel>
A service around
B2BPermissionResultModel. This interface evaluates the permissions(credit limits or budget
thresholds) on an order to determine if the order needs to be sent for approval. If the order needs to be approved,
the associated approver is applied to the permission so that an Approve or Reject decision on the order can be made.- Spring Bean ID:
- b2bPermissionService
-
Method Summary
Modifier and TypeMethodDescriptionevaluatePermissions(AbstractOrderModel order, T employee, List<Class<? extends B2BPermissionModel>> permissionTypes) Evaluate permissions of an order to determine if a violation has occurred and that an approver needs to intervene and approve/reject an order.Get all b2b permissions.Get all permission typesgetApproversForOpenPermissions(AbstractOrderModel order, T customer, Collection<P> openPermissions) Get the approvers for an order's associated permissions with a status of OPEN.Gets the b2b permission for the code provided.getEligableApprovers(OrderModel order) Get all approvers who have permissions to approve the order.Gets permissions with OPEN status.booleanneedsApproval(AbstractOrderModel order) Checks if the order requires approval by someone other than customer who placed the order.booleanpermissionExists(String code) Determine if a b2b permission exists based on a code.
-
Method Details
-
evaluatePermissions
Set<P> evaluatePermissions(AbstractOrderModel order, T employee, List<Class<? extends B2BPermissionModel>> permissionTypes) Evaluate permissions of an order to determine if a violation has occurred and that an approver needs to intervene and approve/reject an order.- Parameters:
order- the order to be evaluatedemployee- the person who placed the orderpermissionTypes- the permission types that will be checked- Returns:
- the set of
B2BPermissionResultModel
-
getApproversForOpenPermissions
Set<P> getApproversForOpenPermissions(AbstractOrderModel order, T customer, Collection<P> openPermissions) Get the approvers for an order's associated permissions with a status of OPEN. Approvers are assigned to a customer or it's unit and this evaluates/gathers the approvers for all units up the hierarchy.- Parameters:
order- the ordercustomer- the customer whom placed the orderopenPermissions- the permissions to be checked for status of OPEN- Returns:
- B2BPermissionResult the set of approvers
-
getOpenPermissions
Gets permissions with OPEN status.- Parameters:
order- the order- Returns:
- the open permissions
-
getB2BPermissionForCode
Gets the b2b permission for the code provided.- Parameters:
code- the code- Returns:
- the b2b permission model
-
getAllB2BPermissions
Set<B2BPermissionModel> getAllB2BPermissions()Get all b2b permissions.- Returns:
- the set of B2BPermissionModel
-
permissionExists
Determine if a b2b permission exists based on a code.- Parameters:
code- the code- Returns:
- True if permission exists
-
needsApproval
Checks if the order requires approval by someone other than customer who placed the order.- Parameters:
order- A b2b order.- Returns:
- True if order needs approval.
-
getEligableApprovers
Get all approvers who have permissions to approve the order.- Parameters:
order- A b2b order- Returns:
- approvers who are eligible to approve the order.
-
getAllB2BPermissionTypes
Get all permission types- Returns:
- permission types list
-