Skip to content

Commit

Permalink
docs: organize B2B topics & update infos
Browse files Browse the repository at this point in the history
Co-authored-by: King-of-Babylon <[email protected]>
Co-authored-by: sushma gupta <[email protected]>
Co-authored-by: Nils Haberkamp <[email protected]>
  • Loading branch information
4 people committed Sep 22, 2023
1 parent 190f7ff commit 9f8b8c2
Show file tree
Hide file tree
Showing 61 changed files with 694 additions and 95 deletions.
567 changes: 567 additions & 0 deletions SUMMARY.md

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions products/extensions/b2b-components/employee-management/index.md

This file was deleted.

10 changes: 0 additions & 10 deletions products/extensions/b2b-components/index.md

This file was deleted.

10 changes: 0 additions & 10 deletions products/extensions/b2b-suite/guides/administration/index.md

This file was deleted.

3 changes: 3 additions & 0 deletions products/extensions/b2b/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# B2B Extension

Unlike the B2B Suite, the B2B Components aim to provide a flexible set of B2B-related features. This enables B2B merchants to deliver the experience they want to their business partners. This is achieved by providing abilities that allow B2B Merchants to conduct basic B2B jobs and enable agencies to extend the Components according to the merchant's specific requirements.
13 changes: 13 additions & 0 deletions products/extensions/b2b/b2b-components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# B2B components

The B2B Components allow merchants to selectively choose and configure B2B capabilities according to their needs. They offer merchants the ability to craft a tailored B2B ecommerce experience for their business partners while also allowing agencies to fine-tune Shopware to meet specific requirements. This means that B2B components can be individually activated or deactivated for each business partner.

In the world of digital B2B commerce, where businesses engage with other companies, we emphasize this vital distinction through these specific features :

* **Employee Management** enables B2B Merchants to create a buyer platform for their business partners.

* **Quote Managements** covers Sales Representative related jobs around negotiating quotes with customers.

* **Quick Order and Order List** takes care of distinctive B2B buying behaviors.

* **Digital Sales Composables** aims to provide a set of composable frontends to cover more complex Sales Representative jobs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Employee Management

A feature of the B2B components includes employee, role, and permission management. It is implemented into both Storefront and Administration and supports their respective APIs.

## Basic idea

Employee management, as one of the B2B components, is a feature that allows you to manage employees and their permissions as an extension to Shopware's account and customer management, but set into a company context. This means that employees are associated with a **company customer** and will act on behalf of that company, e.g., placing orders. Accordingly, employees can make use of addresses that have been defined by administrators of their company.

The **company customer** has the benefit of injecting company managed data into core processes without having to develop new employee processes from scratch or maintain multiple versions of these processes.

## Company customer

The company customer is a regular storefront customer but with a few additional properties. A customer's ID is used to associate employees with a company. Therefore, it is really easy to rely on Shopware's typical order relevant data like addresses. This allows us to keep using most core implementations, while only extending a few B2B related features, e.g., to reference an employee's actions.

## Role management

Employees are assigned roles that define their permissions and settings. These permissions can restrict or allow employees to perform certain actions, like ordering without approval or managing roles and employees. Refer to our guides section how permissions can be extended [via app](../employee-management/guides/creating-own-permissions-via-app.md) or [via plugin](../employee-management/guides/creating-own-permissions-via-plugin.md).
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Concept

This section includes are the concepts related to Employee Management.

## Additional info

It's important to keep in mind that employees are uniquely identified via their email address.
When a new employee gets invited a check will be performed to ensure that the email address is in use only once.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Guides

The following articles gives you an idea of roles. Also it guides you on creating your own permissions via app or plugin for the B2B Employee Management component.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# B2B Employee invite / registration

Employees can be created via storefront and api to get an invite mail. This has to be later confirmed by the employee to set a password.

It’s possible to invite new employees or manage them via the API.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# B2B permissions

Use permissions to restrict access to certain information or functionalities within the B2B Components. For example, the B2B supervisor can restrict which employee can manage the company's employee accounts.

## Groups
Permissions are divided into individual groups that have a logical relationship to each other.

## Dependencies
A permission can be dependent on another permission, without which this permission cannot be used. For example, if a role is created with the permission to edit employee accounts, this role must also have the permission to view employee accounts. This is because the `employee.edit` permission depends on the `employee.read` permission.

## Shopware base permissions
The following permissions are already included and used in the B2B Employee Management component. More "base" permissions will be duly added with future B2B Components.

|Group|Permission|Dependencies|
|---|---|---|---|
|employee|employee.read| |
|employee |employee.edit|employee.read|
|employee |employee.create|employee.read, employee.edit|
|employee |employee.delete|employee.read, employee.edit |
|order|order.read.all|
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Create Permissions via App

App needs to use the API to extend and create permissions. Therefore, the apps can send a request to the Store API and pass the required parameters to [`/store-api/permission`]() route.

After doing that, the already existing permissions created by Shopware or added by plugin, will be merged with the permission created by apps.

It is important to note that permissions have a unique name. So a permission named `employee.read` can neither be added by apps nor by plugins, because this name is already in use. So a new name can better be added by making use of snippets.

## Snippets

The Snippet for the new permissions have to be added to the following namespace: `b2b.role-edit.permissions.[name]`. The placeholder has to be replaced by the name of the new permission, e.g., `b2b.role-edit.permissions.order.delete`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# B2B Roles

Roles can be used to bind multiple permission to employees with contexts. Every employee can have one assigned role. Based on that role and the containing permission, the employee will get access to certain information and functionalities.

The business partner has the opportunity to create a “default” role that will be selected by default, when creating a new employee.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Administration

B2B Suite Administration modules are built following the official [Shopware Administration](https://developer.shopware.com/docs/guides/plugins/plugins/administration) documentation. For a more in-depth guide, please refer to the [User documentation](https://docs.shopware.com/en/shopware-6-en/extensions/b2b-suite-administration).
8 changes: 8 additions & 0 deletions resources/references/core-reference/actions-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Actions Reference

## B2B

| Class | Description | Component |
|:------------------------------------------------|:---------------------------------------------------------------|:--------------------|
| ChangeEmployeeStatusAction | Assigns the configured status to the employee | Employee Management |
| ChangeCustomerSpecificFeaturesAction | Adds or removes the configured b2b components for the customer | Employee Management |
20 changes: 20 additions & 0 deletions resources/references/core-reference/flow-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,23 @@ nav:
| state_leave.order.state.cancelled | Triggers when an order leaves status "Cancelled" | Add/remove tag, send mail, generate document, set order status |
| state_enter.order_transaction.state.unconfirmed | Triggers when an order payment enters status "Unconfirmed" | Add/remove tag, send mail, generate document, set order status |
| state_leave.order_transaction.state.unconfirmed | Triggers when an order payment leaves status "Unconfirmed" | Add/remove tag, send mail, generate document, set order status |

## B2B

### Trigger interfaces

| Name | Provided |
|:--------------|:-----------|
| EmployeeAware | employeeId |

### Events

| Class | Description | Component |
|:--------------------------|:-------------------------------------------------------|:--------------------|
| collect.permission-events | Triggers when base permissions are created | Employee Management |
| employee.invite.sent | Triggers when an employee invitation has been sent | Employee Management |
| employee.invite.accepted | Triggers when an employee invitation has been accepted | Employee Management |
| employee.recovery.request | Triggers when an employee requests password recovery | Employee Management |
| employee.status.changed | Triggers when the status of an employee changes | Employee Management |
| employee.role.changed | Triggers when the role of an employee changes | Employee Management |
| employee.order.placed | Triggers when an employee places an order | Employee Management |
11 changes: 11 additions & 0 deletions resources/references/core-reference/rules-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,14 @@ List of all rule classes across Shopware 6.
| Class | Description |
| :--- | :--- |
| [Shopware\Core\System\Currency\Rule\CurrencyRule](https://github.com/shopware/platform/blob/trunk/src/Core/System/Currency/Rule/CurrencyRule.php) | Match a specific currency to the current context. |

## B2B

| Class | Description | Component |
|:------------------------------|:----------------------------------------------------------------------|:--------------------|
| EmployeeOrderRule | Matches if the order was placed by an employee | Employee Management |
| EmployeeOfBusinessPartnerRule | Matches if the customer is an employee of a specific business partner | Employee Management |
| EmployeeRoleRule | Matches if a specific role is assigned to an employee | Employee Management |
| EmployeeStatusRule | Matches if the employee as a specific status | Employee Management |
| IsEmployeeRule | Matches if the customer is an employee | Employee Management |

0 comments on commit 9f8b8c2

Please sign in to comment.