From d55c189748eb1aaba761790893606b62aae6c255 Mon Sep 17 00:00:00 2001 From: Dinh Duy Date: Tue, 16 Jan 2024 10:06:15 +0700 Subject: [PATCH] NEXT-32619 - Write document for order approval --- .../order-approval/01-entities-and-workflow.md | 5 ++--- .../order-approval/02-order-approval-permissions.md | 13 ++++++------- .../order-approval/03-payment-process.md | 6 ++---- .../order-approval/04-add-new-approval-condition.md | 4 ++-- .../b2b-components/order-approval/index.md | 2 +- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/products/extensions/b2b-components/order-approval/01-entities-and-workflow.md b/products/extensions/b2b-components/order-approval/01-entities-and-workflow.md index f89c62db9..21e6f6b9e 100644 --- a/products/extensions/b2b-components/order-approval/01-entities-and-workflow.md +++ b/products/extensions/b2b-components/order-approval/01-entities-and-workflow.md @@ -12,7 +12,7 @@ nav: ### Approval Rule -The approval rule entity represents a set of conditions that need to be met in order for an order to be approved. These conditions can be based on the order's total value, the order's currency or for all orders placed by employees with a specific role. Each approval rule can be assigned the reviewer to a specific role, which means that only employees with that role can approve orders that match the rule's conditions, and it can be assigned to specific role, which means that only employees with that role will need to request approval for orders that match the rule's conditions; and a priority, which is used to determine the order in which the rules are evaluated. +The approval rule entity represents a set of conditions that need to be met for an order to be approved. These conditions might be based on the order's total value, the order's currency or orders placed by employees with a specific role. Each approval rule can be assigned to a reviewer with specific role, which means that only employees that only employees possessing that role are authorized to approve orders meeting the rule's conditions. Additionally, it can be assigned to a particular role, requiring employees with that role to seek approval for orders meeting the rule's criteria. The rule also includes a priority, dictating the sequence in which the rules are evaluated. ### Pending Order @@ -32,10 +32,9 @@ flowchart TD E-->|Yes| G[Event: Order Approved & Event: Order placed] ``` - ## Who can request approval? -- Employees which have the role that is assigned as the "Effective role" of the approval rule that matched the order. +* Employees holding the role designated as the "Effective role" in the approval rule corresponding to the order are authorized to request approval. ## Who can view pending orders? diff --git a/products/extensions/b2b-components/order-approval/02-order-approval-permissions.md b/products/extensions/b2b-components/order-approval/02-order-approval-permissions.md index a9d5fd38f..53c889709 100644 --- a/products/extensions/b2b-components/order-approval/02-order-approval-permissions.md +++ b/products/extensions/b2b-components/order-approval/02-order-approval-permissions.md @@ -6,9 +6,8 @@ nav: --- # Order approval permissions -## Introduction -Below you can find a list of all the order approval rules that are available in the order approval component, which you can use to assign to the roles of your employees. +Below you can find a list of all the order approval rules that are available in the order approval component. You can utilize these rules for assigning roles to your employees. ### Approval rule permissions @@ -21,8 +20,8 @@ Below you can find a list of all the order approval rules that are available in ### Pending order Permissions -| Permission | Description | -|------------------------------------------|--------------------------------------------------------------------------------| -| `Can approve/decline all pending orders` | Allows the employee to approve or decline all pending orders. | -| `Can approve/decline pending orders` | Allows the employee to approve or decline pending orders that assigned to him. | -| `Can view all pending orders` | Allows the employee to view all pending orders. | \ No newline at end of file +| Permission | Description | +|------------------------------------------|---------------------------------------------------------------------| +| `Can approve/decline all pending orders` | Allows the employee to approve or decline all pending orders | +| `Can approve/decline pending orders` | Allows the employee to approve or decline assigned pending orders | +| `Can view all pending orders` | Allows the employee to view all pending orders | \ No newline at end of file diff --git a/products/extensions/b2b-components/order-approval/03-payment-process.md b/products/extensions/b2b-components/order-approval/03-payment-process.md index d9a253d36..dbcd41327 100644 --- a/products/extensions/b2b-components/order-approval/03-payment-process.md +++ b/products/extensions/b2b-components/order-approval/03-payment-process.md @@ -5,11 +5,9 @@ nav: --- -# Order approval's Payment Process +# Order approval's payment process -## Introduction - -The payment process of the order approval component is the same as the payment process of the order component, you can select the payment method that you want to use for your orders, with the exception that if this is the online payment method (Visa, PayPal, etc.), the payment process will be executed only after the order has been approved. +The payment process of the order approval component is the same as the payment process of the order component. You can select the payment method that you want to use for your orders; however unlike the standard order component, the payment process will be executed only after the order has been approved in case of the online payment method (Visa, PayPal, etc.). ## Customization diff --git a/products/extensions/b2b-components/order-approval/04-add-new-approval-condition.md b/products/extensions/b2b-components/order-approval/04-add-new-approval-condition.md index 47ae18b5e..7150d889f 100644 --- a/products/extensions/b2b-components/order-approval/04-add-new-approval-condition.md +++ b/products/extensions/b2b-components/order-approval/04-add-new-approval-condition.md @@ -7,11 +7,11 @@ nav: # How to add a new approval condition -The order approval component provides a set of conditions that you can use to define your approval rules. However, if you need to add a new condition, you can do so via app or plugin. +The order approval component provides a set of conditions for defining your approval rules. However, if you need to add a new condition, you can do so via an app or a plugin. ## Plugin -Each condition is represented by a class that extends the abstract class `Shopware\Commercial\B2B\OrderApproval\Domain\ApprovalRule\Rule\OrderApprovalRule` class. To add a new condition, you need to create a new class that extends the `OrderApprovalRule` class and implements the `match` and `getConstraints` methods. The `match` method is used to determine if the condition is met, and the `getConstraints` method is used to define the field, value or operator constraints that can be used in the condition. +Each condition is represented by a class that extends the abstract class `Shopware\Commercial\B2B\OrderApproval\Domain\ApprovalRule\Rule\OrderApprovalRule`. To add a new condition, you need to create a new class that extends the `OrderApprovalRule` class and implements the `match` and `getConstraints` methods. The `match` method is used to determine if the condition is met, and the `getConstraints` method is used to define the field, value or operator constraints that can be used in the condition. Example: diff --git a/products/extensions/b2b-components/order-approval/index.md b/products/extensions/b2b-components/order-approval/index.md index e5f4807e9..00548984e 100644 --- a/products/extensions/b2b-components/order-approval/index.md +++ b/products/extensions/b2b-components/order-approval/index.md @@ -5,7 +5,7 @@ nav: --- -# Order Approval Component +# Order approval component Order approval component is a part of the B2B Employee Management. It allows you to define rules that determine which orders require approval and which employees can approve them. It also allows you to view all pending orders and approve or decline them.