From 6d53baa29e8e4fc308e9ece96e983c694948b6e6 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 26 Jan 2023 21:54:13 +0100 Subject: [PATCH] org -> unit change, some new functionality --- Admin/Install/Navigation.install.json | 58 ++++++- Admin/Install/Workflow.install.json | 48 ++++++ Admin/Install/attributes.json | 170 ++++++++++++++++++++ Admin/Install/db.json | 25 ++- Admin/Install/localizations.json | 3 + Admin/Installer.php | 213 +++++++++++++++++++++++++ Admin/Routes/Web/Backend.php | 22 +++ Controller/BackendController.php | 90 +++++++++++ Models/AttributeValueType.php | 4 + Models/ClientAttributeTypeMapper.php | 2 +- Models/ClientAttributeValue.php | 29 +++- Models/ClientAttributeValueMapper.php | 3 + tests/Controller/ApiControllerTest.php | 2 +- 13 files changed, 658 insertions(+), 11 deletions(-) create mode 100644 Admin/Install/Workflow.install.json create mode 100644 Admin/Install/attributes.json create mode 100644 Admin/Install/localizations.json diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index bd11657..42971b8 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -46,7 +46,53 @@ ] }, { - "id": 1003103001, + "id": 1003101001, + "pid": "/", + "type": 2, + "subtype": 1, + "name": "Attributes", + "uri": "{/lang}/{/app}/sales/client/attribute/type/list?{?}", + "target": "self", + "icon": null, + "order": 5, + "from": "ClientManagement", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1001601001, + "children": [ + { + "id": 1003101101, + "pid": "/sales", + "type": 3, + "subtype": 1, + "name": "Types", + "uri": "{/lang}/{/app}/sales/client/attribute/type/list?{?}", + "target": "self", + "icon": null, + "order": 15, + "from": "ClientManagement", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1003101001, + "children": [] + }, + { + "id": 1003101201, + "pid": "/sales", + "type": 3, + "subtype": 1, + "name": "Values", + "uri": "{/lang}/{/app}/sales/client/attribute/value/list?{?}", + "target": "self", + "icon": null, + "order": 15, + "from": "ClientManagement", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1003101001, + "children": [] + } + ] + }, + { + "id": 1003104001, "pid": "/sales/analysis", "type": 3, "subtype": 1, @@ -54,14 +100,14 @@ "uri": "{/lang}/{/app}/sales/analysis/client?{?}", "target": "self", "icon": null, - "order": 2, + "order": 10, "from": "ClientManagement", "permission": { "permission": 2, "category": null, "element": null }, "parent": 1001602001, "children": [] }, { - "id": 1003103002, + "id": 1003105001, "pid": "/sales/analysis", "type": 3, "subtype": 1, @@ -69,14 +115,14 @@ "uri": "{/lang}/{/app}/sales/analysis/region?{?}", "target": "self", "icon": null, - "order": 3, + "order": 15, "from": "ClientManagement", "permission": { "permission": 2, "category": null, "element": null }, "parent": 1001602001, "children": [] }, { - "id": 1003103003, + "id": 1003106001, "pid": "/sales/analysis", "type": 3, "subtype": 1, @@ -84,7 +130,7 @@ "uri": "{/lang}/{/app}/sales/analysis/rep?{?}", "target": "self", "icon": null, - "order": 4, + "order": 20, "from": "ClientManagement", "permission": { "permission": 2, "category": null, "element": null }, "parent": 1001602001, diff --git a/Admin/Install/Workflow.install.json b/Admin/Install/Workflow.install.json new file mode 100644 index 0000000..de29cca --- /dev/null +++ b/Admin/Install/Workflow.install.json @@ -0,0 +1,48 @@ +{ + "triggers": [ + "PRE:Module:client-create", + "POST:Module:client-create", + "PRE:Module:client-update", + "POST:Module:client-update", + "PRE:Module:client-delete", + "POST:Module:client-delete" + ], + "actions": { + "1003100001": { + "name": "", + "function": "", + "settings": { + "name1": { + "type": "select", + "subtype": null, + "title": { + "en": "", + "de": "" + }, + "options": [ + { + "value": 1, + "text": { + "en": "", + "de": "" + } + } + ] + }, + "name2": { + "type": "input", + "subtype": "text", + "title": { + "en": "", + "de": "" + } + } + } + }, + "unique_id": { + "name": "", + "function": "", + "settings": {} + } + } +} \ No newline at end of file diff --git a/Admin/Install/attributes.json b/Admin/Install/attributes.json new file mode 100644 index 0000000..86228cd --- /dev/null +++ b/Admin/Install/attributes.json @@ -0,0 +1,170 @@ +[ + { + "name": "abc_class", + "l11n": { + "en": "Rating", + "de": "Bewertung" + }, + "value_type": 2, + "is_custom_allowed": true, + "validation_pattern": "", + "is_required": false, + "default_value": "", + "values": [ + { + "value": "A", + "l11n": { + "en": "A", + "de": "A" + } + }, + { + "value": "B", + "l11n": { + "en": "B", + "de": "B" + } + }, + { + "value": "C", + "l11n": { + "en": "C", + "de": "C" + } + }, + { + "value": "D", + "l11n": { + "en": "D", + "de": "D" + } + }, + { + "value": "E", + "l11n": { + "en": "E", + "de": "E" + } + }, + { + "value": "F", + "l11n": { + "en": "F", + "de": "F" + } + } + ] + }, + { + "name": "group", + "l11n": { + "en": "Group", + "de": "Gruppe" + }, + "value_type": 1, + "is_custom_allowed": false, + "validation_pattern": "", + "is_required": true, + "default_value": "", + "values": [ + { + "value": 1, + "l11n": { + "en": "Group 1", + "de": "Gruppe 1" + } + } + ] + }, + { + "name": "vat_id", + "l11n": { + "en": "VAT Id", + "de": "USt IdNr." + }, + "value_type": 2, + "is_custom_allowed": true, + "validation_pattern": "", + "is_required": false, + "default_value": "", + "values": [] + }, + { + "name": "tax_id", + "l11n": { + "en": "Tax Id", + "de": "Steuernummer" + }, + "value_type": 2, + "is_custom_allowed": true, + "validation_pattern": "", + "is_required": false, + "default_value": "", + "values": [] + }, + { + "name": "legal_form", + "l11n": { + "en": "Legal form", + "de": "Rechtsform" + }, + "value_type": 2, + "is_custom_allowed": true, + "validation_pattern": "", + "is_required": false, + "default_value": "", + "values": [] + }, + { + "name": "credit_rating", + "l11n": { + "en": "Credit rating", + "de": "Bonität" + }, + "value_type": 2, + "is_custom_allowed": true, + "validation_pattern": "", + "is_required": false, + "default_value": "", + "values": [] + }, + { + "name": "line_of_credit", + "l11n": { + "en": "Line of credit", + "de": "Kreditlimit" + }, + "value_type": 1, + "is_custom_allowed": true, + "validation_pattern": "", + "is_required": false, + "default_value": "", + "values": [] + }, + { + "name": "order_limit", + "l11n": { + "en": "Order limit", + "de": "Bestelllimit" + }, + "value_type": 1, + "is_custom_allowed": true, + "validation_pattern": "", + "is_required": false, + "default_value": "", + "values": [] + }, + { + "name": "minimum_order", + "l11n": { + "en": "MOQ", + "de": "Mindestbestellmenge" + }, + "value_type": 1, + "is_custom_allowed": true, + "validation_pattern": "", + "is_required": false, + "default_value": "", + "values": [] + } +] \ No newline at end of file diff --git a/Admin/Install/db.json b/Admin/Install/db.json index cce30f4..43bf311 100755 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -60,8 +60,8 @@ "type": "INT", "default": null, "null": true, - "foreignTable": "organization_unit", - "foreignKey": "organization_unit_id" + "foreignTable": "unit", + "foreignKey": "unit_id" } } }, @@ -205,6 +205,27 @@ "type": "DATETIME", "null": true, "default": null + }, + "clientmgmt_attr_value_unit": { + "name": "clientmgmt_attr_value_unit", + "type": "VARCHAR(255)", + "null": false + }, + "clientmgmt_attr_value_deptype": { + "name": "clientmgmt_attr_value_deptype", + "type": "INT(11)", + "null": true, + "default": null, + "foreignTable": "clientmgmt_attr_type", + "foreignKey": "clientmgmt_attr_type_id" + }, + "clientmgmt_attr_value_depvalue": { + "name": "clientmgmt_attr_value_depvalue", + "type": "INT(11)", + "null": true, + "default": null, + "foreignTable": "clientmgmt_attr_value", + "foreignKey": "clientmgmt_attr_value_id" } } }, diff --git a/Admin/Install/localizations.json b/Admin/Install/localizations.json new file mode 100644 index 0000000..c44dc44 --- /dev/null +++ b/Admin/Install/localizations.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/Admin/Installer.php b/Admin/Installer.php index 235b28f..97c4d44 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -14,7 +14,13 @@ declare(strict_types=1); namespace Modules\ClientManagement\Admin; +use phpOMS\Application\ApplicationAbstract; +use phpOMS\Config\SettingsInterface; +use phpOMS\Message\Http\HttpRequest; +use phpOMS\Message\Http\HttpResponse; use phpOMS\Module\InstallerAbstract; +use phpOMS\Module\ModuleInfo; +use phpOMS\Uri\HttpUri; /** * Installer class. @@ -33,4 +39,211 @@ final class Installer extends InstallerAbstract * @since 1.0.0 */ public const PATH = __DIR__; + + /** + * {@inheritdoc} + */ + public static function install(ApplicationAbstract $app, ModuleInfo $info, SettingsInterface $cfgHandler) : void + { + parent::install($app, $info, $cfgHandler); + + /* Attributes */ + $fileContent = \file_get_contents(__DIR__ . '/Install/attributes.json'); + if ($fileContent === false) { + return; + } + + $attributes = \json_decode($fileContent, true); + $attrTypes = self::createClientAttributeTypes($app, $attributes); + $attrValues = self::createClientAttributeValues($app, $attrTypes, $attributes); + + /* Localizations */ + $fileContent = \file_get_contents(__DIR__ . '/Install/localizations.json'); + if ($fileContent === false) { + return; + } + + $localizations = \json_decode($fileContent, true); + $l11nTypes = self::createClientL11nTypes($app, $localizations); + } + + /** + * Install default l11n types + * + * @param ApplicationAbstract $app Application + * @param array $l11ns Attribute definition + * + * @return array + * + * @since 1.0.0 + */ + private static function createClientL11nTypes(ApplicationAbstract $app, array $l11ns) : array + { + /** @var array $l11nTypes */ + $l11nTypes = []; + + /** @var \Modules\ClientManagement\Controller\ApiController $module */ + $module = $app->moduleManager->getModuleInstance('ClientManagement'); + + foreach ($l11ns as $l11n) { + $response = new HttpResponse(); + $request = new HttpRequest(new HttpUri('')); + + $request->header->account = 1; + $request->setData('title', $l11n['name']); + $request->setData('is_required', $l11n['is_required'] ?? false); + + $module->apiClientL11nTypeCreate($request, $response); + + $responseData = $response->get(''); + if (!\is_array($responseData)) { + continue; + } + + $l11nTypes[] = !\is_array($responseData['response']) + ? $responseData['response']->toArray() + : $responseData['response']; + } + + return $l11nTypes; + } + + /** + * Install default attribute types + * + * @param ApplicationAbstract $app Application + * @param array, is_required?:bool, is_custom_allowed?:bool, validation_pattern?:string, value_type?:string, values?:array}> $attributes Attribute definition + * + * @return array + * + * @since 1.0.0 + */ + private static function createClientAttributeTypes(ApplicationAbstract $app, array $attributes) : array + { + /** @var array $clientAttrType */ + $clientAttrType = []; + + /** @var \Modules\ClientManagement\Controller\ApiController $module */ + $module = $app->moduleManager->getModuleInstance('ClientManagement'); + + /** @var array $attribute */ + foreach ($attributes as $attribute) { + $response = new HttpResponse(); + $request = new HttpRequest(new HttpUri('')); + + $request->header->account = 1; + $request->setData('name', $attribute['name'] ?? ''); + $request->setData('title', \reset($attribute['l11n'])); + $request->setData('language', \array_keys($attribute['l11n'])[0] ?? 'en'); + $request->setData('is_required', $attribute['is_required'] ?? false); + $request->setData('is_custom_allowed', $attribute['is_custom_allowed'] ?? false); + $request->setData('validation_pattern', $attribute['validation_pattern'] ?? ''); + $request->setData('datatype', (int) $attribute['value_type']); + + $module->apiClientAttributeTypeCreate($request, $response); + + $responseData = $response->get(''); + if (!\is_array($responseData)) { + continue; + } + + $clientAttrType[$attribute['name']] = !\is_array($responseData['response']) + ? $responseData['response']->toArray() + : $responseData['response']; + + $isFirst = true; + foreach ($attribute['l11n'] as $language => $l11n) { + if ($isFirst) { + $isFirst = false; + continue; + } + + $response = new HttpResponse(); + $request = new HttpRequest(new HttpUri('')); + + $request->header->account = 1; + $request->setData('title', $l11n); + $request->setData('language', $language); + $request->setData('type', $clientAttrType[$attribute['name']]['id']); + + $module->apiClientAttributeTypeL11nCreate($request, $response); + } + } + + return $clientAttrType; + } + + /** + * Create default attribute values for types + * + * @param ApplicationAbstract $app Application + * @param array $clientAttrType Attribute types + * @param array, is_required?:bool, is_custom_allowed?:bool, validation_pattern?:string, value_type?:string, values?:array}> $attributes Attribute definition + * + * @return array + * + * @since 1.0.0 + */ + private static function createClientAttributeValues(ApplicationAbstract $app, array $clientAttrType, array $attributes) : array + { + /** @var array $clientAttrValue */ + $clientAttrValue = []; + + /** @var \Modules\ClientManagement\Controller\ApiController $module */ + $module = $app->moduleManager->getModuleInstance('ClientManagement'); + + foreach ($attributes as $attribute) { + $clientAttrValue[$attribute['name']] = []; + + /** @var array $value */ + foreach ($attribute['values'] as $value) { + $response = new HttpResponse(); + $request = new HttpRequest(new HttpUri('')); + + $request->header->account = 1; + $request->setData('value', $value['value'] ?? ''); + $request->setData('unit', $value['unit'] ?? ''); + $request->setData('default', isset($attribute['values']) && !empty($attribute['values'])); + $request->setData('attributetype', $clientAttrType[$attribute['name']]['id']); + + if (isset($value['l11n']) && !empty($value['l11n'])) { + $request->setData('title', \reset($value['l11n'])); + $request->setData('language', \array_keys($value['l11n'])[0] ?? 'en'); + } + + $module->apiClientAttributeValueCreate($request, $response); + + $responseData = $response->get(''); + if (!\is_array($responseData)) { + continue; + } + + $attrValue = !\is_array($responseData['response']) + ? $responseData['response']->toArray() + : $responseData['response']; + + $clientAttrValue[$attribute['name']][] = $attrValue; + + $isFirst = true; + foreach (($value['l11n'] ?? []) as $language => $l11n) { + if ($isFirst) { + $isFirst = false; + continue; + } + + $response = new HttpResponse(); + $request = new HttpRequest(new HttpUri('')); + + $request->header->account = 1; + $request->setData('title', $l11n); + $request->setData('language', $language); + $request->setData('value', $attrValue['id']); + + $module->apiClientAttributeValueL11nCreate($request, $response); + } + } + } + + return $clientAttrValue; + } } diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index f03730f..0eccf5a 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -18,6 +18,28 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ + '^.*/sales/client/attribute/type/list.*$' => [ + [ + 'dest' => '\Modules\ClientManagement\Controller\BackendController:viewClientManagementAttributeTypeList', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::READ, + 'state' => PermissionCategory::CLIENT, + ], + ], + ], + '^.*/sales/client/attribute/type\?.*$' => [ + [ + 'dest' => '\Modules\ClientManagement\Controller\BackendController:viewClientManagementAttributeType', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::READ, + 'state' => PermissionCategory::CLIENT, + ], + ], + ], '^.*/sales/client/list.*$' => [ [ 'dest' => '\Modules\ClientManagement\Controller\BackendController:viewClientManagementClientList', diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 4824a1d..fb56557 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -15,6 +15,8 @@ declare(strict_types=1); namespace Modules\ClientManagement\Controller; use Modules\Billing\Models\SalesBillMapper; +use Modules\ClientManagement\Models\ClientAttributeTypeMapper; +use Modules\ClientManagement\Models\ClientAttributeValueMapper; use Modules\ClientManagement\Models\ClientMapper; use phpOMS\Asset\AssetType; use phpOMS\Contract\RenderableInterface; @@ -38,6 +40,94 @@ use phpOMS\Views\View; */ final class BackendController extends Controller { + /** + * Routing end-point for application behaviour. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewClientManagementAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface + { + $view = new View($this->app->l11nManager, $request, $response); + $view->setTemplate('/Modules/ClientManagement/Theme/Backend/attribute-type-list'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response)); + + /** @var \Modules\ClientManagement\Models\ClientAttributeType[] $attributes */ + $attributes = ClientAttributeTypeMapper::getAll() + ->with('l11n') + ->where('l11n/language', $response->getLanguage()) + ->execute(); + + $view->addData('attributes', $attributes); + + return $view; + } + + /** + * Routing end-point for application behaviour. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewClientManagementAttributeValues(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface + { + $view = new View($this->app->l11nManager, $request, $response); + $view->setTemplate('/Modules/ClientManagement/Theme/Backend/attribute-value-list'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response)); + + /** @var \Modules\ClientManagement\Models\ClientAttributeValue[] $attributes */ + $attributes = ClientAttributeValueMapper::getAll() + ->with('l11n') + ->where('l11n/language', $response->getLanguage()) + ->execute(); + + $view->addData('attributes', $attributes); + + return $view; + } + + /** + * Routing end-point for application behaviour. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewClientManagementAttributeType(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface + { + $view = new View($this->app->l11nManager, $request, $response); + $view->setTemplate('/Modules/ClientManagement/Theme/Backend/attribute-type'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response)); + + /** @var \Modules\ClientManagement\Models\ClientAttributeType $attribute */ + $attribute = ClientAttributeTypeMapper::get() + ->with('l11n') + ->where('id', (int) $request->getData('id')) + ->where('l11n/language', $response->getLanguage()) + ->execute(); + + $view->addData('attribute', $attribute); + + return $view; + } + /** * Routing end-point for application behaviour. * diff --git a/Models/AttributeValueType.php b/Models/AttributeValueType.php index 66561d5..4e0fafe 100755 --- a/Models/AttributeValueType.php +++ b/Models/AttributeValueType.php @@ -33,4 +33,8 @@ abstract class AttributeValueType extends Enum public const _FLOAT = 3; public const _DATETIME = 4; + + public const _BOOL = 5; + + public const _FLOAT_INT = 6; } diff --git a/Models/ClientAttributeTypeMapper.php b/Models/ClientAttributeTypeMapper.php index 189bd59..8394c77 100755 --- a/Models/ClientAttributeTypeMapper.php +++ b/Models/ClientAttributeTypeMapper.php @@ -53,7 +53,7 @@ final class ClientAttributeTypeMapper extends DataMapperFactory 'mapper' => ClientAttributeTypeL11nMapper::class, 'table' => 'clientmgmt_attr_type_l11n', 'self' => 'clientmgmt_attr_type_l11n_type', - 'column' => 'title', + 'column' => 'content', 'external' => null, ], 'defaults' => [ diff --git a/Models/ClientAttributeValue.php b/Models/ClientAttributeValue.php index 23aa39c..1999df7 100755 --- a/Models/ClientAttributeValue.php +++ b/Models/ClientAttributeValue.php @@ -37,6 +37,22 @@ class ClientAttributeValue implements \JsonSerializable */ protected int $id = 0; + /** + * Depending attribute type + * + * @var null|int + * @since 1.0.0 + */ + public ?int $dependingAttributeType = null; + + /** + * Depending attribute value + * + * @var null|int + * @since 1.0.0 + */ + public ?int $dependingAttributeValue = null; + /** * Int value * @@ -77,6 +93,14 @@ class ClientAttributeValue implements \JsonSerializable */ public bool $isDefault = false; + /** + * Unit of the value + * + * @var string + * @since 1.0.0 + */ + public string $unit = ''; + /** * Localization * @@ -146,7 +170,10 @@ class ClientAttributeValue implements \JsonSerializable { if ($datatype === AttributeValueType::_STRING) { $this->valueStr = (string) $value; - } elseif ($datatype === AttributeValueType::_INT) { + } elseif ($datatype === AttributeValueType::_INT + || $datatype === AttributeValueType::_FLOAT_INT + || $datatype === AttributeValueType::_BOOL + ) { $this->valueInt = (int) $value; } elseif ($datatype === AttributeValueType::_FLOAT) { $this->valueDec = (float) $value; diff --git a/Models/ClientAttributeValueMapper.php b/Models/ClientAttributeValueMapper.php index dee5f7f..1c96a9c 100755 --- a/Models/ClientAttributeValueMapper.php +++ b/Models/ClientAttributeValueMapper.php @@ -39,6 +39,9 @@ final class ClientAttributeValueMapper extends DataMapperFactory 'clientmgmt_attr_value_valueInt' => ['name' => 'clientmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'], 'clientmgmt_attr_value_valueDec' => ['name' => 'clientmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'], 'clientmgmt_attr_value_valueDat' => ['name' => 'clientmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'], + 'clientmgmt_attr_value_unit' => ['name' => 'clientmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'], + 'clientmgmt_attr_value_deptype' => ['name' => 'clientmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'], + 'clientmgmt_attr_value_depvalue' => ['name' => 'clientmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'], ]; /** diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 51cd4e2..9f2d17a 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -55,7 +55,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase }; $this->app->dbPool = $GLOBALS['dbpool']; - $this->app->orgId = 1; + $this->app->unitId = 1; $this->app->accountManager = new AccountManager($GLOBALS['session']); $this->app->appSettings = new CoreSettings(); $this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');