From 57a85934570b281844c4451395f6bce02ff3c46a Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 24 Sep 2023 02:48:07 +0000 Subject: [PATCH] fix tests --- Controller/ApiAttributeController.php | 18 +++++++++--------- Controller/ApiBillController.php | 4 +++- Controller/ApiPriceController.php | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Controller/ApiAttributeController.php b/Controller/ApiAttributeController.php index dafef68..afb478e 100755 --- a/Controller/ApiAttributeController.php +++ b/Controller/ApiAttributeController.php @@ -451,17 +451,17 @@ final class ApiAttributeController extends Controller // @todo: I don't think values can be deleted? Only Attributes // However, It should be possible to remove UNUSED default values // either here or other function? - if (!empty($val = $this->validateAttributeValueDelete($request))) { - $response->header->status = RequestStatusCode::R_400; - $this->createInvalidDeleteResponse($request, $response, $val); + // if (!empty($val = $this->validateAttributeValueDelete($request))) { + // $response->header->status = RequestStatusCode::R_400; + // $this->createInvalidDeleteResponse($request, $response, $val); - return; - } + // return; + // } - /** @var \Modules\Billing\Models\BillAttributeValue $billAttributeValue */ - $billAttributeValue = BillAttributeValueMapper::get()->where('id', (int) $request->getData('id'))->execute(); - $this->deleteModel($request->header->account, $billAttributeValue, BillAttributeValueMapper::class, 'bill_attribute_value', $request->getOrigin()); - $this->createStandardDeleteResponse($request, $response, $billAttributeValue); + // /** @var \Modules\Billing\Models\BillAttributeValue $billAttributeValue */ + // $billAttributeValue = BillAttributeValueMapper::get()->where('id', (int) $request->getData('id'))->execute(); + // $this->deleteModel($request->header->account, $billAttributeValue, BillAttributeValueMapper::class, 'bill_attribute_value', $request->getOrigin()); + // $this->createStandardDeleteResponse($request, $response, $billAttributeValue); } /** diff --git a/Controller/ApiBillController.php b/Controller/ApiBillController.php index 64fafde..39ddce1 100755 --- a/Controller/ApiBillController.php +++ b/Controller/ApiBillController.php @@ -726,9 +726,11 @@ final class ApiBillController extends Controller $element->bill = new NullBill($bill->id); // discounts + // @todo: implement a addDiscount function + /* if ($request->getData('discount_percentage') !== null) { - // @todo: implement a addDiscount function } + */ return $element; } diff --git a/Controller/ApiPriceController.php b/Controller/ApiPriceController.php index 7c304a6..9602395 100755 --- a/Controller/ApiPriceController.php +++ b/Controller/ApiPriceController.php @@ -306,7 +306,7 @@ final class ApiPriceController extends Controller private function validatePriceCreate(RequestAbstract $request) : array { $val = []; - if (false) { + if (($val['name'] = !$request->hasData('name'))) { return $val; }