rename module constants and fix some unit test bugs

This commit is contained in:
Dennis Eichhorn 2021-09-28 18:28:42 +02:00
parent e70b45551f
commit 3928fbd1a3
3 changed files with 17 additions and 17 deletions

View File

@ -23,7 +23,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoiceCreate', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoiceCreate',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::CREATE, 'type' => PermissionType::CREATE,
'state' => PermissionState::SALES_INVOICE, 'state' => PermissionState::SALES_INVOICE,
], ],
@ -34,7 +34,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesList', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::SALES_INVOICE, 'state' => PermissionState::SALES_INVOICE,
], ],
@ -45,7 +45,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoice', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoice',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::SALES_INVOICE, 'state' => PermissionState::SALES_INVOICE,
], ],
@ -56,7 +56,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::CREATE, 'type' => PermissionType::CREATE,
'state' => PermissionState::PURCHASE_INVOICE, 'state' => PermissionState::PURCHASE_INVOICE,
], ],
@ -67,7 +67,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseList', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::PURCHASE_INVOICE, 'state' => PermissionState::PURCHASE_INVOICE,
], ],
@ -78,7 +78,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoice', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoice',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::SALES_INVOICE, 'state' => PermissionState::SALES_INVOICE,
], ],
@ -89,7 +89,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockInvoiceCreate', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockInvoiceCreate',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::CREATE, 'type' => PermissionType::CREATE,
'state' => PermissionState::PURCHASE_INVOICE, 'state' => PermissionState::PURCHASE_INVOICE,
], ],
@ -100,7 +100,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockList', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::PURCHASE_INVOICE, 'state' => PermissionState::PURCHASE_INVOICE,
], ],
@ -111,7 +111,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockInvoice', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockInvoice',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::SALES_INVOICE, 'state' => PermissionState::SALES_INVOICE,
], ],
@ -122,7 +122,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillAnalysis', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillAnalysis',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::SALES_INVOICE, 'state' => PermissionState::SALES_INVOICE,
], ],
@ -133,7 +133,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewSalesRepAnalysis', 'dest' => '\Modules\Billing\Controller\BackendController:viewSalesRepAnalysis',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::SALES_ANALYSIS, 'state' => PermissionState::SALES_ANALYSIS,
], ],
@ -144,7 +144,7 @@ return [
'dest' => '\Modules\Billing\Controller\BackendController:viewRegionAnalysis', 'dest' => '\Modules\Billing\Controller\BackendController:viewRegionAnalysis',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::SALES_ANALYSIS, 'state' => PermissionState::SALES_ANALYSIS,
], ],

View File

@ -269,7 +269,7 @@ final class ApiController extends Controller
$bill = BillMapper::get($request->getData('bill')); $bill = BillMapper::get($request->getData('bill'));
$defaultTemplate = $this->app->appSettings->get(null, 'default_template', null, self::MODULE_NAME); $defaultTemplate = $this->app->appSettings->get(null, 'default_template', null, self::NAME);
$template = CollectionMapper::get((int) $defaultTemplate['content']); $template = CollectionMapper::get((int) $defaultTemplate['content']);
$pdfDir = __DIR__ . '/../../../Modules/Media/Files/Modules/Billing/Bills/' $pdfDir = __DIR__ . '/../../../Modules/Media/Files/Modules/Billing/Bills/'

View File

@ -33,7 +33,7 @@ class Controller extends ModuleAbstract implements WebInterface
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
public const MODULE_PATH = __DIR__ . '/../'; public const PATH = __DIR__ . '/../';
/** /**
* Module version. * Module version.
@ -41,7 +41,7 @@ class Controller extends ModuleAbstract implements WebInterface
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
public const MODULE_VERSION = '1.0.0'; public const VERSION = '1.0.0';
/** /**
* Module name. * Module name.
@ -49,7 +49,7 @@ class Controller extends ModuleAbstract implements WebInterface
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
public const MODULE_NAME = 'Billing'; public const NAME = 'Billing';
/** /**
* Module id. * Module id.
@ -57,7 +57,7 @@ class Controller extends ModuleAbstract implements WebInterface
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
public const MODULE_ID = 1005100000; public const ID = 1005100000;
/** /**
* Providing. * Providing.