fond-of-impala / company-users-bulk-rest-api-business-central-connector
CompanyUsersBulkRestApi Module
Maintainers
Details
github.com/fond-of-impala/company-users-bulk-rest-api-business-central-connector
1.1.0
2024-01-10 12:49 UTC
Requires
- php: >=8.0
- fond-of-impala/company-users-bulk-rest-api-extension: ^1.0.0
- fond-of-impala/navision-company: 1.0.0
- spryker/company-business-unit: ^1.0.0 || ^2.0.0
- spryker/company-role: ^1.0.0
- spryker/company-user: ^2.0.0
Requires (Dev)
This package is not auto-updated.
Last update: 2024-11-13 17:03:07 UTC
README
Allows to add and delete company users by debtor number
Installation
composer require fond-of-impala/company-users-bulk-rest-api-business-central-connector
Configuration
Register plugin
<?php
namespace Pyz\Zed\CompanyUsersBulkRestApi;
use FondOfImpala\Zed\CompanyUsersBulkRestApi\CompanyUsersBulkRestApiDependencyProvider as FooCompanyUsersBulkRestApiDependencyProvider;
use FondOfImpala\Zed\CompanyUsersBulkRestApiBusinessCentralConnector\Communication\Plugin\CompanyUsersBulkRestApi\CompanyDebtorNumberResolverPreDataExpanderPlugin;
class CompanyUsersBulkRestApiDependencyProvider extends FooCompanyUsersBulkRestApiDependencyProvider
{
/**
* @return array<\FondOfImpala\Zed\CompanyUsersBulkRestApiExtension\Dependency\Plugin\CompanyUsersBulkDataExpanderPluginInterface>
*/
protected function getDataExpanderPlugins(): array
{
return [
...
new CompanyDebtorNumberResolverPreDataExpanderPlugin(),
];
}
}
Usage
POST {{glue_uri}}/company-users-bulk
Content-Type: application/vnd.api+json;version=1.1
Authorization: {{tokenType}} {{accessToken}}
Accept: application/vnd.api+json
{
"data": {
"type": "company-users-bulk",
"attributes": {
"assign": [
{
"customer":
{
"customerReference": "JD--371",
"email": "john.doe@johndoe.de"
},
"company":
{
"companyId": "",
"debtorNumber": "D123221"
},
"role": "superadministration"
},
{
"customer":
{
"customerReference": "",
"email": "jane.doe@johndoe.de"
},
"company":
{
"companyId": "",
"debtorNumber": "D123222"
},
"role": "administration"
}
],
"unassign": [
{
"customer":
{
"customerReference": "JD--373",
"email": ""
},
"company":
{
"companyId": "",
"debtorNumber": "D123223"
},
"role": "administration"
}
]
}
}
}