Files
exchange-2.0/app/Classes/Modules/Settings/ControllersLogic/CreateLockLogic.php
T

68 lines
2.0 KiB
PHP

<?php
namespace App\Classes\Modules\Settings\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Accounts\DataTransferObjects\KeyValuePairObject;
use App\Classes\Modules\Bookings\Standards\Rules\CanCreateBooking;
use App\Classes\Modules\Settings\Services\CreatesKeyValuePair;
use App\Classes\ValueObjects\Constants\KVPKey;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateLockLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Lock Created',
'message' => 'You have successfully created a lock'
];
}
// /** @var CanCreateBooking */
// private $canCreateBooking;
/** @var CreatesKeyValuePair */
private $createsKeyValuePair;
/**
* CreateLockLogic constructor.
* @param CanCreateBooking $canCreateBooking
* @param CreatesKeyValuePair $createsKeyValuePair
*/
public function __construct(CanCreateBooking $canCreateBooking, CreatesKeyValuePair $createsKeyValuePair)
{
// $this->canCreateBooking = $canCreateBooking;
$this->createsKeyValuePair = $createsKeyValuePair;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
{
// cief todo: 110 - CanCreateLock
// $password = $request->input('password');
// if($password !== 'prototype'){
// throw new AccessForbiddenException('Incorrect Password');
// }
$keyValuePairObject = new KeyValuePairObject(
KVPKey::UI_SUPPLIER_PAID_CURRENCY_ORDER_TAB_IS_LOCKED,
0
);
$this->createsKeyValuePair->execute(null, $keyValuePairObject);
return $this->response([]);
}
}