mirror of
https://github.com/Karaka-Management/oms-ItemManagement.git
synced 2026-02-14 11:18:41 +00:00
fix billing process
This commit is contained in:
parent
06f1de97ac
commit
3e6d0cfc3c
14
.github/user_bug_report.md
vendored
14
.github/user_bug_report.md
vendored
|
|
@ -8,9 +8,11 @@ assignees: ''
|
||||||
---
|
---
|
||||||
|
|
||||||
# Bug Description
|
# Bug Description
|
||||||
|
|
||||||
A clear and concise description of what the bug is.
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
# How to Reproduce
|
# How to Reproduce
|
||||||
|
|
||||||
Steps to reproduce the behavior:
|
Steps to reproduce the behavior:
|
||||||
|
|
||||||
1. Go to '...'
|
1. Go to '...'
|
||||||
|
|
@ -19,16 +21,20 @@ Steps to reproduce the behavior:
|
||||||
4. See error
|
4. See error
|
||||||
|
|
||||||
# Expected Behavior
|
# Expected Behavior
|
||||||
|
|
||||||
A clear and concise description of what you expected to happen.
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
# Screenshots
|
# Screenshots
|
||||||
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
# System Information
|
# System Information
|
||||||
- System: [e.g. PC or iPhone11, ...]
|
|
||||||
- OS: [e.g. iOS]
|
- System: [e.g. PC or iPhone11, ...]
|
||||||
- Browser [e.g. chrome, safari]
|
- OS: [e.g. iOS]
|
||||||
- KarakaVersion [e.g. 22]
|
- Browser [e.g. chrome, safari]
|
||||||
|
- KarakaVersion [e.g. 22]
|
||||||
|
|
||||||
# Additional Information
|
# Additional Information
|
||||||
|
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ final class ApiController extends Controller
|
||||||
private function validateItemCreate(RequestAbstract $request) : array
|
private function validateItemCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['number'] = empty($request->getData('number')))) {
|
if (($val['number'] = !$request->hasData('number'))) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -361,7 +361,7 @@ final class ApiController extends Controller
|
||||||
private function validateItemPriceCreate(RequestAbstract $request) : array
|
private function validateItemPriceCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['price'] = empty($request->getData('price')))
|
if (($val['price'] = !$request->hasData('price'))
|
||||||
|| ($val['currency'] = !ISO4217CharEnum::isValidValue($request->getData('currency')))
|
|| ($val['currency'] = !ISO4217CharEnum::isValidValue($request->getData('currency')))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
|
|
@ -439,9 +439,9 @@ final class ApiController extends Controller
|
||||||
private function validateItemAttributeCreate(RequestAbstract $request) : array
|
private function validateItemAttributeCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['type'] = empty($request->getData('type')))
|
if (($val['type'] = !$request->hasData('type'))
|
||||||
|| ($val['value'] = (empty($request->getData('value')) && empty($request->getData('custom'))))
|
|| ($val['value'] = (!$request->hasData('value') && !$request->hasData('custom')))
|
||||||
|| ($val['item'] = empty($request->getData('item')))
|
|| ($val['item'] = !$request->hasData('item'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
@ -509,8 +509,8 @@ final class ApiController extends Controller
|
||||||
private function validateItemAttributeTypeL11nCreate(RequestAbstract $request) : array
|
private function validateItemAttributeTypeL11nCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['title'] = empty($request->getData('title')))
|
if (($val['title'] = !$request->hasData('title'))
|
||||||
|| ($val['type'] = empty($request->getData('type')))
|
|| ($val['type'] = !$request->hasData('type'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
@ -580,8 +580,8 @@ final class ApiController extends Controller
|
||||||
private function validateItemAttributeTypeCreate(RequestAbstract $request) : array
|
private function validateItemAttributeTypeCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['title'] = empty($request->getData('title')))
|
if (($val['title'] = !$request->hasData('title'))
|
||||||
|| ($val['name'] = empty($request->getData('name')))
|
|| ($val['name'] = !$request->hasData('name'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
@ -665,8 +665,8 @@ final class ApiController extends Controller
|
||||||
private function validateItemAttributeValueCreate(RequestAbstract $request) : array
|
private function validateItemAttributeValueCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['type'] = empty($request->getData('type')))
|
if (($val['type'] = !$request->hasData('type'))
|
||||||
|| ($val['value'] = empty($request->getData('value')))
|
|| ($val['value'] = !$request->hasData('value'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
@ -734,8 +734,8 @@ final class ApiController extends Controller
|
||||||
private function validateItemAttributeValueL11nCreate(RequestAbstract $request) : array
|
private function validateItemAttributeValueL11nCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['title'] = empty($request->getData('title')))
|
if (($val['title'] = !$request->hasData('title'))
|
||||||
|| ($val['value'] = empty($request->getData('value')))
|
|| ($val['value'] = !$request->hasData('value'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
@ -800,7 +800,7 @@ final class ApiController extends Controller
|
||||||
private function validateItemL11nTypeCreate(RequestAbstract $request) : array
|
private function validateItemL11nTypeCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['title'] = empty($request->getData('title')))) {
|
if (($val['title'] = !$request->hasData('title'))) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -863,7 +863,7 @@ final class ApiController extends Controller
|
||||||
private function validateItemRelationTypeCreate(RequestAbstract $request) : array
|
private function validateItemRelationTypeCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['title'] = empty($request->getData('title')))) {
|
if (($val['title'] = !$request->hasData('title'))) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -931,9 +931,9 @@ final class ApiController extends Controller
|
||||||
private function validateItemL11nCreate(RequestAbstract $request) : array
|
private function validateItemL11nCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['item'] = empty($request->getData('item')))
|
if (($val['item'] = !$request->hasData('item'))
|
||||||
|| ($val['type'] = empty($request->getData('type')))
|
|| ($val['type'] = !$request->hasData('type'))
|
||||||
|| ($val['description'] = empty($request->getData('description')))
|
|| ($val['description'] = !$request->hasData('description'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
@ -1025,7 +1025,7 @@ final class ApiController extends Controller
|
||||||
private function validateFileCreate(RequestAbstract $request) : array
|
private function validateFileCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['item'] = empty($request->getData('item')))
|
if (($val['item'] = !$request->hasData('item'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
@ -1083,7 +1083,7 @@ final class ApiController extends Controller
|
||||||
private function validateNoteCreate(RequestAbstract $request) : array
|
private function validateNoteCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['id'] = empty($request->getData('id')))
|
if (($val['id'] = !$request->hasData('id'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,12 @@ class Item implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public function addL11n(ItemL11n $l11n) : void
|
public function addL11n(ItemL11n $l11n) : void
|
||||||
{
|
{
|
||||||
|
foreach ($this->l11n as $l11n) {
|
||||||
|
if ($l11n->type->title === $l11n->type->title) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->l11n[] = $l11n;
|
$this->l11n[] = $l11n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,20 @@ class ItemAttributeType implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public bool $custom = false;
|
public bool $custom = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validation pattern for the value
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public string $validationPattern = '';
|
public string $validationPattern = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the attribute required
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public bool $isRequired = false;
|
public bool $isRequired = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -74,7 +86,8 @@ class ItemAttributeType implements \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Localization
|
* Localization
|
||||||
*
|
*
|
||||||
* @var BaseStringL11n
|
* @var string|BaseStringL11n
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private string | BaseStringL11n $l11n = '';
|
private string | BaseStringL11n $l11n = '';
|
||||||
|
|
||||||
|
|
@ -82,6 +95,7 @@ class ItemAttributeType implements \JsonSerializable
|
||||||
* Possible default attribute values
|
* Possible default attribute values
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private array $defaults = [];
|
private array $defaults = [];
|
||||||
|
|
||||||
|
|
@ -117,6 +131,15 @@ class ItemAttributeType implements \JsonSerializable
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get default value by value
|
||||||
|
*
|
||||||
|
* @param mixed $value Value
|
||||||
|
*
|
||||||
|
* @return ItemAttributeValue
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function getDefaultByValue(mixed $value) : ItemAttributeValue
|
public function getDefaultByValue(mixed $value) : ItemAttributeValue
|
||||||
{
|
{
|
||||||
foreach ($this->defaults as $default) {
|
foreach ($this->defaults as $default) {
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
$permission = new AccountPermission();
|
$permission = new AccountPermission();
|
||||||
$permission->setUnit(1);
|
$permission->setUnit(1);
|
||||||
$permission->setApp('backend');
|
$permission->setApp(2);
|
||||||
$permission->setPermission(
|
$permission->setPermission(
|
||||||
PermissionType::READ
|
PermissionType::READ
|
||||||
| PermissionType::CREATE
|
| PermissionType::CREATE
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user