This commit is contained in:
Dennis Eichhorn 2023-05-19 02:33:03 +00:00
commit 47e5ddb4ba
18 changed files with 584 additions and 0 deletions

View File

@ -0,0 +1,33 @@
[
{
"id": 1006701001,
"pid": "/",
"type": 2,
"subtype": 1,
"name": "Budgeting",
"uri": "{/prefix}warehouse/stocktaking/list?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "StockTaking",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1001301001,
"children": [
{
"id": 1006702001,
"pid": "/warehouse/stocktaking",
"type": 3,
"subtype": 1,
"name": "Dashboard",
"uri": "{/prefix}warehouse/stocktaking/list?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "StockTaking",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1006701001,
"children": []
}
]
}
]

View File

@ -0,0 +1,43 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\StockTaking\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\StockTaking\Admin\Install;
use phpOMS\Application\ApplicationAbstract;
/**
* Navigation class.
*
* @package Modules\StockTaking\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\StockTaking\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\StockTaking\Admin;
use phpOMS\Module\InstallerAbstract;
/**
* Installer class.
*
* @package Modules\StockTaking\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__;
}

31
Admin/Routes/Web/Api.php Normal file
View File

@ -0,0 +1,31 @@
<?php declare(strict_types=1);
use Modules\StockTaking\Controller\ApiController;
use Modules\StockTaking\Models\PermissionState;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/warehouse/stocktaking$' => [
[
'dest' => '\Modules\StockTaking\Controller\ApiController:apiStockTakingCreate',
'verb' => RouteVerb::PUT,
'permission' => [
'module' => ApiController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
],
],
],
'^.*/warehouse/stocktaking/entry$' => [
[
'dest' => '\Modules\StockTaking\Controller\ApiController:apiStockTakingEntryCreate',
'verb' => RouteVerb::SET,
'permission' => [
'module' => ApiController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
],
],
],
];

View File

@ -0,0 +1,64 @@
<?php declare(strict_types=1);
use Modules\StockTaking\Controller\BackendController;
use Modules\StockTaking\Models\PermissionState;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/warehouse/stocktaking/list.*$' => [
[
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingList',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
],
],
],
'^.*/warehouse/stocktaking/overview.*$' => [
[
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingOverview',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
],
],
],
'^.*/warehouse/stocktaking/area.*$' => [
[
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingArea',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
],
],
],
'^.*/warehouse/stocktaking/entry.*$' => [
[
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingEntry',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
],
],
],
'^.*/warehouse/stocktaking/stats.*$' => [
[
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingStats',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::STOCK_TAKING_ADMINISTRATION,
],
],
],
];

36
Admin/Status.php Normal file
View File

@ -0,0 +1,36 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\StockTaking\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\StockTaking\Admin;
use phpOMS\Module\StatusAbstract;
/**
* Status class.
*
* @package Modules\StockTaking\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\StockTaking\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\StockTaking\Admin;
use phpOMS\Module\UninstallerAbstract;
/**
* Uninstaller class.
*
* @package Modules\StockTaking\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\StockTaking\Admin
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\StockTaking\Admin;
use phpOMS\Module\UpdaterAbstract;
/**
* Updater class.
*
* @package Modules\StockTaking\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\StockTaking
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\StockTaking\Controller;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
/**
* Budgeting controller class.
*
* @package Modules\StockTaking
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
final class ApiController extends Controller
{
}

View File

@ -0,0 +1,33 @@
<?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);
namespace Modules\StockTaking\Controller;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
/**
* Budgeting controller class.
*
* @package Modules\StockTaking
* @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\StockTaking
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\StockTaking\Controller;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Module\WebInterface;
/**
* Budgeting controller class.
*
* @package Modules\StockTaking
* @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 = 'StockTaking';
/**
* Module id.
*
* @var int
* @since 1.0.0
*/
public const MODULE_ID = 1006700000;
/**
* 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,32 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\StockTaking\Models
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\StockTaking\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Permision state enum.
*
* @package Modules\StockTaking\Models
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
abstract class PermissionState extends Enum
{
public const STOCK_TAKING_COUNTING = 1;
public const STOCK_TAKING_ADMINISTRATION = 2;
}

0
README.md Normal file
View File

View File

@ -0,0 +1,18 @@
<?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);
return ['Navigation' => [
'Budgeting' => 'Budgeting',
'Dashboard' => 'Dashboard',
]];

View File

@ -0,0 +1,16 @@
<?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);
return ['StockTaking' => [
]];

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": 1006700000,
"internal": "StockTaking",
"external": "Stock Taking"
},
"category": "Finance",
"version": "1.0.0",
"requirements": {
"phpOMS": "1.0.0",
"phpOMS-db": "1.0.0"
},
"creator": {
"name": "Jingga",
"website": "jingga.app"
},
"description": "Stock Taking module.",
"directory": "StockTaking",
"dependencies": {
"Controlling": "*"
},
"providing": {
"Navigation": "*"
},
"load": [
{
"pid": [
"/warehouse/stocktaking"
],
"type": 4,
"for": 0,
"from": "StockTaking",
"file": "StockTaking"
},
{
"pid": [
"/"
],
"type": 5,
"from": "StockTaking",
"for": "Navigation",
"file": "Navigation"
}
]
}