fix billing process

This commit is contained in:
Dennis Eichhorn 2023-04-08 04:36:26 +02:00
parent dff2729866
commit 5e8dcb81fb
5 changed files with 23 additions and 17 deletions

View File

@ -8,9 +8,11 @@ assignees: ''
---
# Bug Description
A clear and concise description of what the bug is.
# How to Reproduce
Steps to reproduce the behavior:
1. Go to '...'
@ -19,16 +21,20 @@ Steps to reproduce the behavior:
4. See error
# Expected Behavior
A clear and concise description of what you expected to happen.
# Screenshots
If applicable, add screenshots to help explain your problem.
# System Information
- System: [e.g. PC or iPhone11, ...]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- KarakaVersion [e.g. 22]
- System: [e.g. PC or iPhone11, ...]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- KarakaVersion [e.g. 22]
# Additional Information
Add any other context about the problem here.

View File

@ -73,7 +73,7 @@ final class ApiController extends Controller
private function validateNavElementCreate(RequestAbstract $request) : array
{
$val = [];
if (($val['name'] = empty($request->getData('name')))) {
if (($val['name'] = !$request->hasData('name'))) {
return $val;
}

View File

@ -55,7 +55,7 @@ final class BackendController extends Controller
$this->app->accountManager->get($request->header->account),
$this->app->dbPool,
$this->app->unitId,
$this->app->appName
$this->app->appId
);
$navView = new NavigationView($this->app->l11nManager, $request, $response);
@ -84,7 +84,7 @@ final class BackendController extends Controller
$this->app->accountManager->get($request->header->account),
$this->app->dbPool,
$this->app->unitId,
$this->app->appName
$this->app->appId
);
$nav = new NavigationView($this->app->l11nManager, $request, $response);
@ -150,7 +150,7 @@ final class BackendController extends Controller
$this->app->accountManager->get($request->header->account),
$this->app->dbPool,
$this->app->unitId,
$this->app->appName
$this->app->appId
);
$navView = new NavigationView($this->app->l11nManager, $request, $response);

View File

@ -62,14 +62,14 @@ class Navigation
* @param Account $account Account
* @param DatabasePool $dbPool Database pool
* @param int $unit Unit
* @param string $appName App name
* @param int $appId App id
*
* @since 1.0.0
*/
private function __construct(RequestAbstract $request, Account $account, DatabasePool $dbPool, int $unit, string $appName)
private function __construct(RequestAbstract $request, Account $account, DatabasePool $dbPool, int $unit, int $appId)
{
$this->dbPool = $dbPool;
$this->load($request->getHash(), $account, $unit, $appName);
$this->load($request->getHash(), $account, $unit, $appId);
}
/**
@ -78,13 +78,13 @@ class Navigation
* @param string[] $hashes Request hashes
* @param Account $account Account
* @param int $unit Unit
* @param string $app App name
* @param int $app App name
*
* @return void
*
* @since 1.0.0
*/
private function load(array $hashes, Account $account, int $unit, string $app) : void
private function load(array $hashes, Account $account, int $unit, int $app) : void
{
if (empty($this->nav)) {
$this->nav = [];
@ -161,7 +161,7 @@ class Navigation
* @param Account $account Account
* @param DatabasePool $dbPool Database pool
* @param int $unit Unit
* @param string $appName App name
* @param int $appId App name
*
* @return \Modules\Navigation\Models\Navigation
*
@ -169,14 +169,14 @@ class Navigation
*
* @since 1.0.0
*/
public static function getInstance(RequestAbstract $hashes = null, Account $account, DatabasePool $dbPool, int $unit, string $appName)
public static function getInstance(RequestAbstract $hashes = null, Account $account, DatabasePool $dbPool, int $unit, int $appId)
{
if (!isset(self::$instance)) {
if (!isset($hashes)) {
throw new \Exception('Invalid parameters');
}
self::$instance = new self($hashes, $account, $dbPool, $unit, $appName);
self::$instance = new self($hashes, $account, $dbPool, $unit, $appId);
}
return self::$instance;

View File

@ -72,7 +72,7 @@ final class SearchControllerTest extends \PHPUnit\Framework\TestCase
$permission = new AccountPermission();
$permission->setUnit(1);
$permission->setApp('backend');
$permission->setApp(2);
$permission->setPermission(
PermissionType::READ
| PermissionType::CREATE