fix tests

This commit is contained in:
Dennis Eichhorn 2023-09-24 02:48:07 +00:00
parent 964afbd0e5
commit 57a8593457
3 changed files with 13 additions and 11 deletions

View File

@ -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);
}
/**

View File

@ -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;
}

View File

@ -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;
}