test fixes + new test data

This commit is contained in:
Dennis Eichhorn 2023-05-19 02:37:35 +00:00
parent f44f133073
commit 52c85490a3
15 changed files with 474 additions and 0 deletions

View File

@ -0,0 +1,33 @@
[
{
"id": 1005701001,
"pid": "/",
"type": 2,
"subtype": 1,
"name": "Labeling",
"uri": "{/prefix}warehouse/labeling/dashboard?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "Labelling",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1001301001,
"children": [
{
"id": 1005702001,
"pid": "/warehouse/labeling",
"type": 3,
"subtype": 1,
"name": "Dashboard",
"uri": "{/prefix}warehouse/labeling/dashboard?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "Labeling",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1005701001,
"children": []
}
]
}
]

View File

@ -0,0 +1,43 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Labeling\Admin\Install;
use phpOMS\Application\ApplicationAbstract;
/**
* Navigation class.
*
* @package Modules\Labeling\Admin\Install
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Navigation
{
/**
* Install navigation providing
*
* @param ApplicationAbstract $app Application
* @param string $path Module path
*
* @return void
*
* @since 1.0.0
*/
public static function install(ApplicationAbstract $app, string $path) : void
{
\Modules\Navigation\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Navigation.install.json']);
}
}

36
Admin/Installer.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Labeling\Admin;
use phpOMS\Module\InstallerAbstract;
/**
* Installer class.
*
* @package Modules\Labeling\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class Installer extends InstallerAbstract
{
/**
* Path of the file
*
* @var string
* @since 1.0.0
*/
public const PATH = __DIR__;
}

View File

@ -0,0 +1,20 @@
<?php declare(strict_types=1);
use Modules\Labeling\Controller\BackendController;
use Modules\Labeling\Models\PermissionState;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/controlling/budget/dashboard.*$' => [
[
'dest' => '\Modules\Labeling\Controller\BackendController:viewBudgetingDashboard',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::LABEL,
],
],
],
];

36
Admin/Status.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Labeling\Admin;
use phpOMS\Module\StatusAbstract;
/**
* Status class.
*
* @package Modules\Labeling\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class Status extends StatusAbstract
{
/**
* Path of the file
*
* @var string
* @since 1.0.0
*/
public const PATH = __DIR__;
}

36
Admin/Uninstaller.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Labeling\Admin;
use phpOMS\Module\UninstallerAbstract;
/**
* Uninstaller class.
*
* @package Modules\Labeling\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class Uninstaller extends UninstallerAbstract
{
/**
* Path of the file
*
* @var string
* @since 1.0.0
*/
public const PATH = __DIR__;
}

36
Admin/Updater.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Labeling\Admin;
use phpOMS\Module\UpdaterAbstract;
/**
* Updater class.
*
* @package Modules\Labeling\Admin
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class Updater extends UpdaterAbstract
{
/**
* Path of the file
*
* @var string
* @since 1.0.0
*/
public const PATH = __DIR__;
}

View File

@ -0,0 +1,33 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Labeling\Controller;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
/**
* Budgeting controller class.
*
* @package Modules\Labeling
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class BackendController extends Controller
{
}

77
Controller/Controller.php Normal file
View File

@ -0,0 +1,77 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Labeling\Controller;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Module\WebInterface;
/**
* Budgeting controller class.
*
* @package Modules\Labeling
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Controller extends ModuleAbstract implements WebInterface
{
/**
* Module path.
*
* @var string
* @since 1.0.0
*/
public const MODULE_PATH = __DIR__ . '/../';
/**
* Module version.
*
* @var string
* @since 1.0.0
*/
public const MODULE_VERSION = '1.0.0';
/**
* Module name.
*
* @var string
* @since 1.0.0
*/
public const MODULE_NAME = 'Labeling';
/**
* Module id.
*
* @var int
* @since 1.0.0
*/
public const MODULE_ID = 1005700000;
/**
* Providing.
*
* @var string[]
* @since 1.0.0
*/
protected static array $providing = [];
/**
* Dependencies.
*
* @var string[]
* @since 1.0.0
*/
protected static array $dependencies = [];
}

View File

@ -0,0 +1,30 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Labeling\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Permision state enum.
*
* @package Modules\Labeling\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
abstract class PermissionState extends Enum
{
public const LABEL = 1;
}

View File

@ -0,0 +1,18 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Budgeting' => 'Budgeting',
'Dashboard' => 'Dashboard',
]];

View File

@ -0,0 +1,16 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\Labeling
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Labeling' => [
]];

View File

View File

@ -0,0 +1,15 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\StockTaking
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
echo $this->getData('nav')->render();

45
info.json Normal file
View File

@ -0,0 +1,45 @@
{
"name": {
"id": 1005700000,
"internal": "Labeling",
"external": "Labeling"
},
"category": "Finance",
"version": "1.0.0",
"requirements": {
"phpOMS": "1.0.0",
"phpOMS-db": "1.0.0"
},
"creator": {
"name": "Jingga",
"website": "jingga.app"
},
"description": "Labeling module.",
"directory": "Labeling",
"dependencies": {
"Controlling": "*"
},
"providing": {
"Navigation": "*"
},
"load": [
{
"pid": [
"/warehouse/stocktaking"
],
"type": 4,
"for": 0,
"from": "Labeling",
"file": "Labeling"
},
{
"pid": [
"/"
],
"type": 5,
"from": "Labeling",
"for": "Navigation",
"file": "Navigation"
}
]
}