fix billing process

This commit is contained in:
Dennis Eichhorn 2023-04-08 04:36:26 +02:00
parent 48726b15b0
commit 9181b90c5d
7 changed files with 68 additions and 25 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

@ -0,0 +1,9 @@
[
{
"type": "setting",
"name": "1007500001",
"content": "#ff000000;#ff00ff00;#ffffffff",
"pattern": "/(#[a-fA-F0-9]{8};)*(#[a-fA-F0-9]{8})/",
"module": "Tag"
}
]

43
Admin/Install/Admin.php Normal file
View File

@ -0,0 +1,43 @@
<?php
/**
* Karaka
*
* PHP Version 8.1
*
* @package Modules\Tag\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Tag\Admin\Install;
use phpOMS\Application\ApplicationAbstract;
/**
* Admin class.
*
* @package Modules\Tag\Admin\Install
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
class Admin
{
/**
* Install Admin 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\Admin\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Admin.install.json']);
}
}

View File

@ -45,21 +45,5 @@ final class Installer extends InstallerAbstract
public static function install(ApplicationAbstract $app, ModuleInfo $info, SettingsInterface $cfgHandler) : void
{
parent::install($app, $info, $cfgHandler);
self::installDefaultColors();
}
/**
* Installing default tag colors
*
* @return void
*/
private static function installDefaultColors() : void
{
// @todo: move to Admin.install.json file where it belongs and make this module providing for Admin
$setting = new Setting();
SettingMapper::create()->execute(
$setting->with(0, '1007500001', '#ff000000;#ff00ff00;#ffffffff', '/(#[a-fA-F0-9]{8};)*(#[a-fA-F0-9]{8})/', module: 'Tag')
);
}
}

View File

@ -47,8 +47,8 @@ final class ApiController extends Controller
private function validateTagCreate(RequestAbstract $request) : array
{
$val = [];
if (($val['title'] = empty($request->getData('title')))
|| ($val['color'] = (!empty($request->getData('color'))
if (($val['title'] = !$request->hasData('title'))
|| ($val['color'] = ($request->hasData('color')
&& (!\ctype_xdigit(\ltrim((string) $request->getData('color'), '#'))
|| \stripos((string) $request->getData('color'), '#') !== 0)))
) {
@ -141,8 +141,8 @@ final class ApiController extends Controller
private function validateTagL11nCreate(RequestAbstract $request) : array
{
$val = [];
if (($val['title'] = empty($request->getData('title')))
|| ($val['tag'] = empty($request->getData('tag')))
if (($val['title'] = !$request->hasData('title'))
|| ($val['tag'] = !$request->hasData('tag'))
) {
return $val;
}

View File

@ -21,6 +21,7 @@
"Home": "1.0.0"
},
"providing": {
"Admin": "*",
"Navigation": "*"
},
"load": [

View File

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