From 95f991eebca85fbab390eab837ed718aaddc276f Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi Date: Wed, 21 Oct 2020 23:15:06 +0300 Subject: [PATCH 1/6] ISSUE-7985: The topics for the "Company User" mutations have been created --- src/_data/toc/graphql.yml | 15 ++ .../graphql/mutations/create-company-user.md | 179 ++++++++++++++++++ .../graphql/mutations/delete-company-user.md | 76 ++++++++ .../graphql/mutations/update-company-user.md | 171 +++++++++++++++++ 4 files changed, 441 insertions(+) create mode 100644 src/guides/v2.4/graphql/mutations/create-company-user.md create mode 100644 src/guides/v2.4/graphql/mutations/delete-company-user.md create mode 100644 src/guides/v2.4/graphql/mutations/update-company-user.md diff --git a/src/_data/toc/graphql.yml b/src/_data/toc/graphql.yml index 839b454eb9b..fc256e89c1f 100644 --- a/src/_data/toc/graphql.yml +++ b/src/_data/toc/graphql.yml @@ -223,6 +223,11 @@ pages: edition: b2b-only exclude_versions: ["2.3"] + - label: createCompanyUser mutation + url: /graphql/mutations/create-company-user.html + edition: b2b-only + exclude_versions: ["2.3"] + - label: createCustomer mutation url: /graphql/mutations/create-customer.html @@ -260,6 +265,11 @@ pages: edition: b2b-only exclude_versions: ["2.3"] + - label: deleteCompanyUser mutation + url: /graphql/mutations/delete-company-user.html + edition: b2b-only + exclude_versions: ["2.3"] + - label: deleteCustomerAddress mutation url: /graphql/mutations/delete-customer-address.html @@ -377,6 +387,11 @@ pages: edition: b2b-only exclude_versions: ["2.3"] + - label: updateCompanyUser mutation + url: /graphql/mutations/update-company-user.html + edition: b2b-only + exclude_versions: ["2.3"] + - label: updateCustomer mutation url: /graphql/mutations/update-customer.html diff --git a/src/guides/v2.4/graphql/mutations/create-company-user.md b/src/guides/v2.4/graphql/mutations/create-company-user.md new file mode 100644 index 00000000000..06fe04d50c8 --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/create-company-user.md @@ -0,0 +1,179 @@ +--- +group: graphql +title: createCompanyUser mutation +contributor_name: Atwix +contributor_link: https://www.atwix.com/ +b2b_only: true +--- + +Use the `createCompanyUser` mutation to create a new company user or add a user from the existing customer for your company. + +The `target_id` input attribute allows you to specify which node in the company structure will be the parent node of the company user. If you do not specify a value, the user will be assigned to the top-level (root) node of the company structure. + +You can get the `target_id` and the `role_id` with the [`company`]({{page.baseurl}}/graphql/queries/company.html) query. + +## Syntax + +```graphql +mutation { + createCompanyUser( + input: CompanyUserCreateInput! + ) { + CreateCompanyUserOutput + } +} +``` + +## Example usage + +The following example shows the minimal payload for adding a new customer to a customer's company. + +**Request:** + +```graphql +mutation { + createCompanyUser( + input: { + email: "john.doe@example.com" + firstname: "John" + lastname: "Doe" + job_title: "User" + role_id: "MQ==" + status: ACTIVE + telephone: "1234567890" + } + ) { + user { + created_at + email + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "createCompanyUser": { + "user": { + "created_at": "2020-10-15 23:33:49", + "email": "john.doe@example.com" + } + } + } +} +``` + +This example creates a new company user of the parent company team specified in the `target_id` field. + +**Request:** + +```graphql +mutation { + createCompanyUser( + input: { + email: "jane.doe3@example.com" + firstname: "Jane" + lastname: "Doe3" + job_title: "User" + role_id: "NTc=" + status: ACTIVE + telephone: "1234567890" + target_id: "OA==" + } + ) { + user { + created_at + email + firstname + lastname + job_title + role { + id + name + } + team { + id + name + structure_id + } + status + telephone + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "createCompanyUser": { + "user": { + "created_at": "2020-10-15 23:39:11", + "email": "jane.doe@example.com", + "firstname": "Jane", + "lastname": "Doe", + "job_title": "User", + "role": { + "id": "NTc=", + "name": "Default User" + }, + "team": { + "id": "MQ==", + "name": "Test Team", + "structure_id": "Mg==" + }, + "status": "ACTIVE", + "telephone": "1234567890" + } + } + } +} +``` + +## Input attributes + +The `CompanyUserCreateInput` input object defines the company user data. + +### CompanyUserCreateInput attributes {#CompanyUserCreateInput} + +The `CompanyUserCreateInput` object contains the following attributes: + +Attribute | Data Type | Description +--- | --- | --- +`email` | String! | Company user's email address +`firstname` | String! | Company user's first name +`lastname` | String! | Company user's last name +`job_title` | String! | Company user's job title +`role_id` | ID! | Company user's role ID +`status` | CompanyUserStatusEnum! | Indicates whether the company user is ACTIVE or INACTIVE +`telephone` | String! | Company user's phone number +`target_id` | ID | The ID of a node within a company's structure. This ID will be the parent of the created company user + +## Output attributes + +The `CreateCompanyUserOutput` output object contains the following attribute: + +Attribute | Data Type | Description +--- | --- | --- +`user` | Customer! | Contains company user data + +### Customer attributes {#Customer} + +{% include graphql/customer-output-24.md %} + +## Errors + +Error | Description +--- | --- +`Invitation was sent to an existing customer, they will be added to your organization once they accept the invitation.` | The customer with email provided in the `input`.`email` argument belongs to an existing customer. The invitation was sent to an existing customer. The customer will assign to the company after accepting the invitation. +`A customer with the same email already assigned to company.` | The email provided in the `input`.`email` argument belongs to an existing customer and the customer has already assigned to the company. +`"Email" is not a valid email address.` | The value provided in the `input`.`email` argument has an invalid format. +`Field "createCompanyUser" argument "input" requires type String!, found xxx.` | The value specified in the one of the `input` arguments has an invalid type. +`Field "xxx" is not defined by type CompanyUserCreateInput.` | The `input`.`xxx` argument is undefined. +`Required parameters are missing: xxx` | The `input`.`xxx` argument was omitted or contains an empty value. +`No such entity with roleId = xxx` | The company role with ID `xxx` doesn't exist. diff --git a/src/guides/v2.4/graphql/mutations/delete-company-user.md b/src/guides/v2.4/graphql/mutations/delete-company-user.md new file mode 100644 index 00000000000..af3eb9c2f30 --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/delete-company-user.md @@ -0,0 +1,76 @@ +--- +group: graphql +title: deleteCompanyUser mutation +contributor_name: Atwix +contributor_link: https://www.atwix.com/ +b2b_only: true +--- + +Use the `deleteCompanyUser` mutation to deactivate a company user by ID. + +You can get the user ID with the [`company`]({{page.baseurl}}/graphql/queries/company.html) query. + +## Syntax + +```graphql +mutation { + deleteCompanyUser( + id: ID! + ) { + DeleteCompanyUserOutput + } +} +``` + +## Example usage + +The following example deactivates the user specified in ID. + +**Request:** + +```graphql +mutation { + deleteCompanyUser( + id: "Mg==" + ) { + success + } +} +``` + +**Response:** + +```json +{ + "data": { + "deleteCompanyUser": { + "success": true + } + } +} +``` + +## Input attributes + +The `deleteCompanyUser` mutation requires the following input: + +Attribute | Data Type | Description +--- | --- | --- +`id` | ID! | The encoded user ID to deactivate + +## Output attributes + +The `deleteCompanyUser` mutation returns a Boolean value that indicates whether the operation was successful. + +Attribute | Data Type | Description +--- | --- | --- +`success` | Boolean! | A value of `true` indicates the company user has been deactivated successfully, otherwise a value returns `false` + +## Errors + +Error | Description +--- | --- +`You do not have authorization to perform this action.` | The user with ID provided in the `input`.`id` argument not available to your company or you have no permissions for this operation. +`You cannot delete yourself.` | You have no a possibility to deactivate yourself. +`A customer with the same email address already exists in an associated website` | The email provided in the `input`.`email` argument has already exist to another user. +`The user XXX is the company admin and cannot be set to inactive. You must set another user as the company admin first.` | The company owner cannot be deactivated. You must set another user as the company admin first. diff --git a/src/guides/v2.4/graphql/mutations/update-company-user.md b/src/guides/v2.4/graphql/mutations/update-company-user.md new file mode 100644 index 00000000000..e91cee73292 --- /dev/null +++ b/src/guides/v2.4/graphql/mutations/update-company-user.md @@ -0,0 +1,171 @@ +--- +group: graphql +title: updateCompanyUser mutation +contributor_name: Atwix +contributor_link: https://www.atwix.com/ +b2b_only: true +--- + +Use the `updateCompanyUser` mutation to update the company user data. + +You can get the user ID and role ID with the [`company`]({{page.baseurl}}/graphql/queries/company.html) query. + +## Syntax + +```graphql +mutation { + updateCompanyUser( + input: CompanyUserUpdateInput! + ) { + UpdateCompanyUserOutput + } +} +``` + +## Example usage + +The following example updates the data of existing company user. + +**Request:** + +```graphql +mutation { + updateCompanyUser( + input: { + id: "Mg==" + job_title: "Company User" + } + ) { + user { + email + firstname + lastname + job_title + telephone + status + role { + id + name + users_count + } + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "updateCompanyUser": { + "user": { + "email": "jane.doe@example.com", + "firstname": "Jane", + "lastname": "Doe", + "job_title": "Company User", + "telephone": "1234567890", + "status": "ACTIVE", + "role": { + "id": "MQ==", + "name": "Default User", + "users_count": 1 + } + } + } + } +} +``` + +This example assigns the company user to other role and deactivates them. + +**Request:** + +```graphql +mutation { + updateCompanyUser( + input: { + id: "Mg==" + role_id: "MQ==" + status: INACTIVE + } + ) { + user { + email + firstname + lastname + job_title + telephone + status + role { + id + name + users_count + } + } + } +} +``` + +**Response:** + +```json +{ + "data": { + "updateCompanyUser": { + "user": { + "email": "jane.doe@example.com", + "firstname": "Jane", + "lastname": "Doe", + "job_title": "Company User", + "telephone": "1234567890", + "status": "INACTIVE", + "role": { + "id": "MQ==", + "name": "Default User", + "users_count": 1 + } + } + } + } +} +``` + +## Input attributes + +The `CompanyUserUpdateInput` input object defines the company user data. + +### CompanyUserUpdateInput attributes {#CompanyUserUpdateInput} + +The `CompanyUserUpdateInput` object contains the following attributes: + +Attribute | Data Type | Description +--- | --- | --- +`id` | ID! | The encoded user ID for updating +`email` | String | Company user's email address +`firstname` | String | Company user's first name +`lastname` | String | Company user's last name +`job_title` | String | Company user's job title +`role_id` | ID | Company user's role ID +`status` | CompanyUserStatusEnum | Indicates whether the company user is ACTIVE or INACTIVE +`telephone` | String | Company user's phone number + +## Output attributes + +The `UpdateCompanyUserOutput` output object contains the following attribute: + +Attribute | Data Type | Description +--- | --- | --- +`user` | Customer! | Contains company user data + +### Customer attributes {#Customer} + +{% include graphql/customer-output-24.md %} + +## Errors + +Error | Description +--- | --- +`You do not have authorization to perform this action.` | The user with ID provided in the `input`.`id` argument not available to your company. +`No such entity with roleId = xxx` | The company role with ID `xxx` doesn't exist. +`A customer with the same email address already exists in an associated website` | The email provided in the `input`.`email` argument has already exist to another user. From be5158150a315b8b27cfd2413702adaa7265f14f Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi Date: Thu, 22 Oct 2020 12:31:04 +0300 Subject: [PATCH 2/6] ISSUE-7985: The fixes by reviewer recommendations --- .../graphql/mutations/create-company-user.md | 28 ++++++++++++------- .../graphql/mutations/delete-company-user.md | 10 +++---- .../graphql/mutations/update-company-user.md | 24 ++++++++-------- 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/guides/v2.4/graphql/mutations/create-company-user.md b/src/guides/v2.4/graphql/mutations/create-company-user.md index 06fe04d50c8..f1f07182847 100644 --- a/src/guides/v2.4/graphql/mutations/create-company-user.md +++ b/src/guides/v2.4/graphql/mutations/create-company-user.md @@ -6,7 +6,15 @@ contributor_link: https://www.atwix.com/ b2b_only: true --- -Use the `createCompanyUser` mutation to create a new company user or add a user from the existing customer for your company. +The createCompanyUser mutation allows an existing company user with the role contained "Magento_Company::users_edit" permission to create a new company user. The specified email address determines how Magento processes the request. + +If the email address is unique for the website?/store?/store view?, Magento immediately creates the company user. + +If the email address belongs to a customer who is not a company user, Magento sends an invitation to join the company organization to the customer. When the customer accepts the invitation, Magento adds the customer to the company organization. + +If the email address belongs to an existing company user with the same company, Magento returns the error "A customer with the same email already assigned to company". + +If the email address belongs to a customer who is part of another company organization, Magento returns the error "A customer with the same email already assigned to company". The `target_id` input attribute allows you to specify which node in the company structure will be the parent node of the company user. If you do not specify a value, the user will be assigned to the top-level (root) node of the company structure. @@ -26,7 +34,7 @@ mutation { ## Example usage -The following example shows the minimal payload for adding a new customer to a customer's company. +The following example shows the minimal payload to add a company user. Because a `targit_id` is not specified, Magento places the new company user at the top node of the company structure. **Request:** @@ -145,13 +153,13 @@ The `CompanyUserCreateInput` object contains the following attributes: Attribute | Data Type | Description --- | --- | --- -`email` | String! | Company user's email address -`firstname` | String! | Company user's first name -`lastname` | String! | Company user's last name -`job_title` | String! | Company user's job title -`role_id` | ID! | Company user's role ID +`email` | String! | The company user's email address +`firstname` | String! | The company user's first name +`lastname` | String! | The company user's last name +`job_title` | String! | The company user's job title or function +`role_id` | ID! | The role ID to assign to the company user `status` | CompanyUserStatusEnum! | Indicates whether the company user is ACTIVE or INACTIVE -`telephone` | String! | Company user's phone number +`telephone` | String! | The company user's phone number `target_id` | ID | The ID of a node within a company's structure. This ID will be the parent of the created company user ## Output attributes @@ -170,8 +178,8 @@ Attribute | Data Type | Description Error | Description --- | --- -`Invitation was sent to an existing customer, they will be added to your organization once they accept the invitation.` | The customer with email provided in the `input`.`email` argument belongs to an existing customer. The invitation was sent to an existing customer. The customer will assign to the company after accepting the invitation. -`A customer with the same email already assigned to company.` | The email provided in the `input`.`email` argument belongs to an existing customer and the customer has already assigned to the company. +`Invitation was sent to an existing customer, they will be added to your organization once they accept the invitation.` | The email provided in the `input`.`email` argument belongs to an existing customer. Magento will send an invitation to this customer. When the customer accepts the invitation, the customer will be assigned to the company. +`A customer with the same email already assigned to company.` | The email provided in the `input`.`email` argument belongs to an existing customer, and the customer has already been assigned to the company. `"Email" is not a valid email address.` | The value provided in the `input`.`email` argument has an invalid format. `Field "createCompanyUser" argument "input" requires type String!, found xxx.` | The value specified in the one of the `input` arguments has an invalid type. `Field "xxx" is not defined by type CompanyUserCreateInput.` | The `input`.`xxx` argument is undefined. diff --git a/src/guides/v2.4/graphql/mutations/delete-company-user.md b/src/guides/v2.4/graphql/mutations/delete-company-user.md index af3eb9c2f30..9bc7609534b 100644 --- a/src/guides/v2.4/graphql/mutations/delete-company-user.md +++ b/src/guides/v2.4/graphql/mutations/delete-company-user.md @@ -6,7 +6,7 @@ contributor_link: https://www.atwix.com/ b2b_only: true --- -Use the `deleteCompanyUser` mutation to deactivate a company user by ID. +Use the `deleteCompanyUser` mutation to deactivate the specified company user. You can get the user ID with the [`company`]({{page.baseurl}}/graphql/queries/company.html) query. @@ -24,7 +24,7 @@ mutation { ## Example usage -The following example deactivates the user specified in ID. +The following example deactivates the user specified in the `id` attribute. **Request:** @@ -70,7 +70,7 @@ Attribute | Data Type | Description Error | Description --- | --- -`You do not have authorization to perform this action.` | The user with ID provided in the `input`.`id` argument not available to your company or you have no permissions for this operation. -`You cannot delete yourself.` | You have no a possibility to deactivate yourself. -`A customer with the same email address already exists in an associated website` | The email provided in the `input`.`email` argument has already exist to another user. +`You do not have authorization to perform this action.` | The user with ID provided in the `input`.`id` argument not available to your company, or you do not have the necessary permissions to perform this operation. +`You cannot delete yourself.` | You must specify a company user other than yourself. +`A customer with the same email address already exists in an associated website` | The email provided in the `input`.`email` argument belongs to another user. `The user XXX is the company admin and cannot be set to inactive. You must set another user as the company admin first.` | The company owner cannot be deactivated. You must set another user as the company admin first. diff --git a/src/guides/v2.4/graphql/mutations/update-company-user.md b/src/guides/v2.4/graphql/mutations/update-company-user.md index e91cee73292..c8935095d3e 100644 --- a/src/guides/v2.4/graphql/mutations/update-company-user.md +++ b/src/guides/v2.4/graphql/mutations/update-company-user.md @@ -6,7 +6,7 @@ contributor_link: https://www.atwix.com/ b2b_only: true --- -Use the `updateCompanyUser` mutation to update the company user data. +Use the `updateCompanyUser` mutation to update an existing company user. You can get the user ID and role ID with the [`company`]({{page.baseurl}}/graphql/queries/company.html) query. @@ -24,7 +24,7 @@ mutation { ## Example usage -The following example updates the data of existing company user. +The following example changes the job title of the specified company user. **Request:** @@ -77,7 +77,7 @@ mutation { } ``` -This example assigns the company user to other role and deactivates them. +This example deactivates the company user and assigns a different role. **Request:** @@ -141,14 +141,14 @@ The `CompanyUserUpdateInput` object contains the following attributes: Attribute | Data Type | Description --- | --- | --- -`id` | ID! | The encoded user ID for updating -`email` | String | Company user's email address -`firstname` | String | Company user's first name -`lastname` | String | Company user's last name -`job_title` | String | Company user's job title -`role_id` | ID | Company user's role ID +`id` | ID! | The encoded user ID of the company user to be updated +`email` | String | The company user's email address +`firstname` | String | The company user's first name +`lastname` | String | The company user's last name +`job_title` | String | The company user's job title or function +`role_id` | ID | The ID of the role assigned to the company user `status` | CompanyUserStatusEnum | Indicates whether the company user is ACTIVE or INACTIVE -`telephone` | String | Company user's phone number +`telephone` | String | The company user's phone number ## Output attributes @@ -166,6 +166,6 @@ Attribute | Data Type | Description Error | Description --- | --- -`You do not have authorization to perform this action.` | The user with ID provided in the `input`.`id` argument not available to your company. +`You do not have authorization to perform this action.` | The user with the ID provided in the `input`.`id` argument is not assigned to your company. `No such entity with roleId = xxx` | The company role with ID `xxx` doesn't exist. -`A customer with the same email address already exists in an associated website` | The email provided in the `input`.`email` argument has already exist to another user. +`A customer with the same email address already exists in an associated website` | The email provided in the `input`.`email` argument belongs to another user. From 64ab8724fee54fad36bee97241a3d362206630be Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi Date: Thu, 22 Oct 2020 20:27:40 +0300 Subject: [PATCH 3/6] ISSUE-7985: The fixes by reviewer recommendations --- src/guides/v2.4/graphql/mutations/create-company-user.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guides/v2.4/graphql/mutations/create-company-user.md b/src/guides/v2.4/graphql/mutations/create-company-user.md index f1f07182847..4f0934e2d2e 100644 --- a/src/guides/v2.4/graphql/mutations/create-company-user.md +++ b/src/guides/v2.4/graphql/mutations/create-company-user.md @@ -34,7 +34,7 @@ mutation { ## Example usage -The following example shows the minimal payload to add a company user. Because a `targit_id` is not specified, Magento places the new company user at the top node of the company structure. +The following example shows the minimal payload to add a company user. Because a `target_id` is not specified, Magento places the new company user at the top node of the company structure. **Request:** From a05d0f2ee0e8491d35f033f319e9a24f38a0e07f Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi Date: Thu, 22 Oct 2020 21:51:15 +0300 Subject: [PATCH 4/6] ISSUE-7985: The fixes by reviewer recommendations --- .../v2.4/graphql/mutations/create-company-user.md | 14 ++++++-------- .../v2.4/graphql/mutations/delete-company-user.md | 2 +- .../v2.4/graphql/mutations/update-company-user.md | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/guides/v2.4/graphql/mutations/create-company-user.md b/src/guides/v2.4/graphql/mutations/create-company-user.md index 4f0934e2d2e..bbf3440802e 100644 --- a/src/guides/v2.4/graphql/mutations/create-company-user.md +++ b/src/guides/v2.4/graphql/mutations/create-company-user.md @@ -6,15 +6,13 @@ contributor_link: https://www.atwix.com/ b2b_only: true --- -The createCompanyUser mutation allows an existing company user with the role contained "Magento_Company::users_edit" permission to create a new company user. The specified email address determines how Magento processes the request. +The `createCompanyUser` mutation allows an existing company user who is assigned a role that contains the `Magento_Company::users_edit` permission to create a new company user. The specified email address determines how Magento processes the request. -If the email address is unique for the website?/store?/store view?, Magento immediately creates the company user. +- If the email address is unique for the website?, Magento immediately creates the company user. -If the email address belongs to a customer who is not a company user, Magento sends an invitation to join the company organization to the customer. When the customer accepts the invitation, Magento adds the customer to the company organization. +- If the email address belongs to a customer who is not a company user, Magento sends an invitation to join the company organization to the customer. When the customer accepts the invitation, Magento adds the customer to the company organization. -If the email address belongs to an existing company user with the same company, Magento returns the error "A customer with the same email already assigned to company". - -If the email address belongs to a customer who is part of another company organization, Magento returns the error "A customer with the same email already assigned to company". +- If the email address belongs to a customer who is part of any company organization, Magento returns the error "A customer with the same email already assigned to company". The `target_id` input attribute allows you to specify which node in the company structure will be the parent node of the company user. If you do not specify a value, the user will be assigned to the top-level (root) node of the company structure. @@ -155,12 +153,12 @@ Attribute | Data Type | Description --- | --- | --- `email` | String! | The company user's email address `firstname` | String! | The company user's first name -`lastname` | String! | The company user's last name `job_title` | String! | The company user's job title or function +`lastname` | String! | The company user's last name `role_id` | ID! | The role ID to assign to the company user `status` | CompanyUserStatusEnum! | Indicates whether the company user is ACTIVE or INACTIVE -`telephone` | String! | The company user's phone number `target_id` | ID | The ID of a node within a company's structure. This ID will be the parent of the created company user +`telephone` | String! | The company user's phone number ## Output attributes diff --git a/src/guides/v2.4/graphql/mutations/delete-company-user.md b/src/guides/v2.4/graphql/mutations/delete-company-user.md index 9bc7609534b..6e0d65a3a75 100644 --- a/src/guides/v2.4/graphql/mutations/delete-company-user.md +++ b/src/guides/v2.4/graphql/mutations/delete-company-user.md @@ -70,7 +70,7 @@ Attribute | Data Type | Description Error | Description --- | --- -`You do not have authorization to perform this action.` | The user with ID provided in the `input`.`id` argument not available to your company, or you do not have the necessary permissions to perform this operation. +`You do not have authorization to perform this action.` | The user with the ID provided in the `input`.`id` argument is not available to your company, or you do not have the necessary permissions to perform this operation. `You cannot delete yourself.` | You must specify a company user other than yourself. `A customer with the same email address already exists in an associated website` | The email provided in the `input`.`email` argument belongs to another user. `The user XXX is the company admin and cannot be set to inactive. You must set another user as the company admin first.` | The company owner cannot be deactivated. You must set another user as the company admin first. diff --git a/src/guides/v2.4/graphql/mutations/update-company-user.md b/src/guides/v2.4/graphql/mutations/update-company-user.md index c8935095d3e..6b13ee43053 100644 --- a/src/guides/v2.4/graphql/mutations/update-company-user.md +++ b/src/guides/v2.4/graphql/mutations/update-company-user.md @@ -141,11 +141,11 @@ The `CompanyUserUpdateInput` object contains the following attributes: Attribute | Data Type | Description --- | --- | --- -`id` | ID! | The encoded user ID of the company user to be updated `email` | String | The company user's email address `firstname` | String | The company user's first name -`lastname` | String | The company user's last name +`id` | ID! | The encoded user ID of the company user to be updated `job_title` | String | The company user's job title or function +`lastname` | String | The company user's last name `role_id` | ID | The ID of the role assigned to the company user `status` | CompanyUserStatusEnum | Indicates whether the company user is ACTIVE or INACTIVE `telephone` | String | The company user's phone number From 22b5d5d6529f1d4fa1392966b4f87f92a167e7c8 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Thu, 22 Oct 2020 15:43:44 -0500 Subject: [PATCH 5/6] Update create-company-user.md --- src/guides/v2.4/graphql/mutations/create-company-user.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/guides/v2.4/graphql/mutations/create-company-user.md b/src/guides/v2.4/graphql/mutations/create-company-user.md index bbf3440802e..dbc5de59e6c 100644 --- a/src/guides/v2.4/graphql/mutations/create-company-user.md +++ b/src/guides/v2.4/graphql/mutations/create-company-user.md @@ -8,7 +8,7 @@ b2b_only: true The `createCompanyUser` mutation allows an existing company user who is assigned a role that contains the `Magento_Company::users_edit` permission to create a new company user. The specified email address determines how Magento processes the request. -- If the email address is unique for the website?, Magento immediately creates the company user. +- If the email address is unique for the website, Magento immediately creates the company user. - If the email address belongs to a customer who is not a company user, Magento sends an invitation to join the company organization to the customer. When the customer accepts the invitation, Magento adds the customer to the company organization. @@ -32,6 +32,8 @@ mutation { ## Example usage +### Create a company user (minimal payload) + The following example shows the minimal payload to add a company user. Because a `target_id` is not specified, Magento places the new company user at the top node of the company structure. **Request:** @@ -71,6 +73,7 @@ mutation { } } ``` +### Create a company user in a specific location in the company structure This example creates a new company user of the parent company team specified in the `target_id` field. From 0f79a2c28993adedd2c10019192affc669a11887 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Thu, 22 Oct 2020 15:47:06 -0500 Subject: [PATCH 6/6] Update create-company-user.md --- src/guides/v2.4/graphql/mutations/create-company-user.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/guides/v2.4/graphql/mutations/create-company-user.md b/src/guides/v2.4/graphql/mutations/create-company-user.md index dbc5de59e6c..2170e046c33 100644 --- a/src/guides/v2.4/graphql/mutations/create-company-user.md +++ b/src/guides/v2.4/graphql/mutations/create-company-user.md @@ -73,6 +73,7 @@ mutation { } } ``` + ### Create a company user in a specific location in the company structure This example creates a new company user of the parent company team specified in the `target_id` field.